enum SubscriptionProtocol
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.SNS.SubscriptionProtocol |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awssns#SubscriptionProtocol |
Java | software.amazon.awscdk.services.sns.SubscriptionProtocol |
Python | aws_cdk.aws_sns.SubscriptionProtocol |
TypeScript (source) | aws-cdk-lib » aws_sns » SubscriptionProtocol |
The type of subscription, controlling the type of the endpoint parameter.
Example
// producerStack defines an SNS topic
declare const topic: sns.Topic;
// consumerStack subscribes to it with a weak reference,
// so the producer can be torn down without blocking on this consumer
const consumerStack = new Stack(app, 'Consumer', {
env: { account: '123456789012', region: 'us-east-1' },
});
new sns.Subscription(consumerStack, 'Subscription', {
topic: sns.Topic.fromTopicArn(consumerStack, 'Topic', Stack.consumeReference(topic.topicArn)),
endpoint: 'https://example.com/webhook',
protocol: sns.SubscriptionProtocol.HTTPS,
});
Members
| Name | Description |
|---|---|
| HTTP | JSON-encoded message is POSTED to an HTTP url. |
| HTTPS | JSON-encoded message is POSTed to an HTTPS url. |
| Notifications are sent via email. | |
| EMAIL_JSON | Notifications are JSON-encoded and sent via mail. |
| SMS | Notification is delivered by SMS. |
| SQS | Notifications are enqueued into an SQS queue. |
| APPLICATION | JSON-encoded notifications are sent to a mobile app endpoint. |
| LAMBDA | Notifications trigger a Lambda function. |
| 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.
Notifications are sent via email.
EMAIL_JSON
Notifications are JSON-encoded and sent via mail.
SMS
Notification is delivered by SMS.
SQS
Notifications are enqueued into an SQS queue.
APPLICATION
JSON-encoded notifications are sent to a mobile app endpoint.
LAMBDA
Notifications trigger a Lambda function.
FIREHOSE
Notifications put records into a firehose delivery stream.

.NET
Go
Java
Python
TypeScript (