Carina

Resource

awscc.sns.Subscription

CloudFormation Type: AWS::SNS::Subscription

Resource Type definition for AWS::SNS::Subscription

Example

let alerts = awscc.sns.Topic {
  topic_name   = 'carina-example-subscription-alerts'
  display_name = 'Carina example alerts'

  tags = {
    Environment = 'example'
  }
}

awscc.sns.Subscription {
  topic_arn = alerts.topic_arn
  protocol  = email
  # Replace this placeholder with an email address you control. SNS sends a
  # confirmation email; the subscription delivers nothing until the recipient
  # confirms it.
  endpoint  = 'alerts@example.com'
}

Argument Reference

delivery_policy

The delivery policy JSON assigned to the subscription. Enables the subscriber to define the message delivery retry strategy in the case of an HTTP/S endpoint subscribed to the topic.

endpoint

The subscription's endpoint. The endpoint value depends on the protocol that you specify.

filter_policy_scope

This attribute lets you choose the filtering scope by using one of the following string value types: MessageAttributes (default) and MessageBody.

protocol

The subscription's protocol.

raw_message_delivery

When set to true, enables raw message delivery. Raw messages don't contain any JSON formatting and can be sent to Amazon SQS and HTTP/S endpoints.

redrive_policy

When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue. Messages that can't be delivered due to client errors are held in the dead-letter queue for further analysis or reprocessing.

region

For cross-region subscriptions, the region in which the topic resides.If no region is specified, AWS CloudFormation uses the region of the caller as the default.

replay_policy

Specifies whether Amazon SNS resends the notification to the subscription when a message's attribute changes.

subscription_role_arn

This property applies only to Amazon Data Firehose delivery stream subscriptions.

topic_arn

The ARN of the topic to subscribe to.

Not yet supported

These CloudFormation properties require the free-form JSON document type tracked by carina-rs/carina#4144:

Enum Values

filter_policy_scope (FilterPolicyScope)

Value DSL Identifier
MessageAttributes aws.sns.Subscription.FilterPolicyScope.message_attributes
MessageBody aws.sns.Subscription.FilterPolicyScope.message_body

Shorthand formats: message_attributes or FilterPolicyScope.message_attributes

protocol (Protocol)

Value DSL Identifier
http aws.sns.Subscription.Protocol.http
https aws.sns.Subscription.Protocol.https
email aws.sns.Subscription.Protocol.email
email-json aws.sns.Subscription.Protocol.email_json
sms aws.sns.Subscription.Protocol.sms
sqs aws.sns.Subscription.Protocol.sqs
application aws.sns.Subscription.Protocol.application
lambda aws.sns.Subscription.Protocol.lambda
firehose aws.sns.Subscription.Protocol.firehose

Shorthand formats: http or Protocol.http

Attribute Reference

arn

Arn of the subscription

AWS API narrowings

These fields are narrower than or equal to CFN. Input rules combine documented AWS domains, recorded live observations, and Carina canonical spellings for stable state comparison. A canonical DSL spelling does not claim AWS rejects other spellings. Attaching a type name adds no structural constraints. Field names below use CFN spelling.

CFN field Relation to CFN Evidence URL Verbatim quote / exact observation Checked / observed
/properties/DeliveryPolicy Subset: CFN ∩ reviewed input domain Source record numRetries The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries. 0 to 100Default: 3 2026-11-07
/properties/DeliveryPolicy Subset: CFN ∩ reviewed input domain Source record maxReceivesPerSecond The maximum average number of message deliveries per second, per subscription. 1 or greaterDefault: No throttling (no limit on delivery rate) 2026-11-07
/properties/FilterPolicyScope Subset: CFN ∩ reviewed input domain Source record FilterPolicyScope – This attribute lets you choose the filtering scope by using one of the following string value types: MessageAttributes (default) – The filter is applied on the message attributes.MessageBody – The filter is applied on the message body.FilterPolicyScope – This attribute lets you choose the filtering scope by using one of the following string value types:MessageAttributes (default) – The filter is applied on the message attributes.MessageBody – The filter is applied on the message body. 2026-11-07
/properties/Protocol Subset: CFN ∩ reviewed input domain Source record The protocol that you want to use. Supported protocols include:http – delivery of JSON-encoded message via HTTP POSThttps – delivery of JSON-encoded message via HTTPS POSTemail – delivery of message via SMTPemail-json – delivery of JSON-encoded message via SMTPsms – delivery of message via SMSsqs – delivery of JSON-encoded message to an Amazon SQS queueapplication – delivery of JSON-encoded message to an EndpointArn for a mobile app and devicelambda – delivery of JSON-encoded message to an AWS Lambda functionfirehose – delivery of JSON-encoded message to an Amazon Data Firehose delivery stream. 2026-11-07
/properties/RedrivePolicy Subset: CFN ∩ reviewed input domain Source record Your messages are moved into a dead-letter queue using a redrive policy. A redrive policy is a JSON object that refers to the ARN of the dead-letter queue. The deadLetterTargetArn attribute specifies the ARN. The ARN must point to an Amazon SQS queue in the same AWS account and Region as your Amazon SNS subscription. For more information, see Configuring an Amazon SNS dead-letter queue for a subscription.The following JSON object is a sample redrive policy, attached to an SNS subscription.{ "deadLetterTargetArn": "arn:aws:sqs:us-east-2:123456789012:MyDeadLetterQueue" } 2026-11-07
/properties/ReplayPolicy Subset: CFN ∩ reviewed input domain Source record StartingPoint (Required) – Signals where to start replaying messages from.EndingPoint (Optional) – Signals when to stop replaying messages. If EndingPoint is omitted, then the replay will continue until caught up to the current time.PointType (Required) – Sets the type of starting and ending points. Currently, the supported value for PointType is Timestamp. 2026-11-07