AWS Amazon SNS SMS Preferences

This page shows how to write Terraform and CloudFormation for Amazon SNS SMS Preferences and write them securely.

aws_sns_sms_preferences (Terraform)

The SMS Preferences in Amazon SNS can be configured in Terraform with the resource name aws_sns_sms_preferences. The following sections describe 3 examples of how to use the resource and its parameters.

Example Usage from GitHub

sns_sms_preferences.tf#L4
resource "aws_sns_sms_preferences" "sns_sms_preferences" {
  count = var.enable_sns_sms_preferences ? 1 : 0

  monthly_spend_limit                   = var.monthly_spend_limit
  delivery_status_iam_role_arn          = var.delivery_status_iam_role_arn
  delivery_status_success_sampling_rate = var.delivery_status_success_sampling_rate
sms.tf#L26
resource "aws_sns_sms_preferences" "sms_preferences" {
  default_sender_id                     = var.default_sender_id
  default_sms_type                      = var.default_sms_type
  delivery_status_success_sampling_rate = var.delivery_status_success_sampling_rate
  monthly_spend_limit                   = var.monthly_spend_limit
}
sns.tf#L52
resource "aws_sns_sms_preferences" "update_sms_prefs" {
  default_sms_type = "Transactional"

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides a way to set SNS SMS preferences.

AWS::SNS::Topic Subscription (CloudFormation)

The Topic Subscription in SNS can be configured in CloudFormation with the resource name AWS::SNS::Topic Subscription. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

Endpoint The endpoint that receives notifications from the Amazon SNS topic. The endpoint value depends on the protocol that you specify. For more information, see the Endpoint parameter of the [Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html) action in the Amazon SNS API Reference.
Required: Yes
Type: String
Update requires: Replacement

Protocol The subscription's protocol. For more information, see the Protocol parameter of the [Subscribe](https://docs.aws.amazon.com/sns/latest/api/API_Subscribe.html) action in the Amazon SNS API Reference.
Required: Yes
Type: String
Update requires: Replacement

Explanation in CloudFormation Registry

Subscription is an embedded property that describes the subscription endpoints of an Amazon SNS topic.

Note For full control over subscription behavior (for example, delivery policy, filtering, raw message delivery, and cross-region subscriptions), use the AWS::SNS::Subscription resource.

Frequently asked questions

What is AWS Amazon SNS SMS Preferences?

AWS Amazon SNS SMS Preferences is a resource for Amazon SNS of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Amazon SNS SMS Preferences?

For Terraform, the asrkata/SebastianUA-terraform, evk1986/aws and sgLancelot/serverless-sms-reminder source code examples are useful. See the Terraform Example section for further details.