SubscriptionProtocol

class aws_cdk.aws_sns.SubscriptionProtocol(*values)

Bases: Enum

The type of subscription, controlling the type of the endpoint parameter.

ExampleMetadata:

infused

Example:

from aws_cdk import Environment
# producerStack defines an SNS topic
# topic: sns.Topic


# consumerStack subscribes to it with a weak reference,
# so the producer can be torn down without blocking on this consumer
consumer_stack = Stack(app, "Consumer",
    env=Environment(account="123456789012", region="us-east-1")
)
sns.Subscription(consumer_stack, "Subscription",
    topic=sns.Topic.from_topic_arn(consumer_stack, "Topic", Stack.consume_reference(topic.topic_arn)),
    endpoint="https://example.com/webhook",
    protocol=sns.SubscriptionProtocol.HTTPS
)

Attributes

APPLICATION

JSON-encoded notifications are sent to a mobile app endpoint.

EMAIL

Notifications are sent via email.

EMAIL_JSON

Notifications are JSON-encoded and sent via mail.

FIREHOSE

Notifications put records into a firehose delivery stream.

HTTP

JSON-encoded message is POSTED to an HTTP url.

HTTPS

JSON-encoded message is POSTed to an HTTPS url.

LAMBDA

Notifications trigger a Lambda function.

SMS

Notification is delivered by SMS.

SQS

Notifications are enqueued into an SQS queue.