Skip to content

Subscribe

Source: src/AWS/SNS/Subscribe.ts

Runtime binding for sns:Subscribe.

Bind this operation to a Topic to subscribe endpoints (email, sms, https, sqs, …) to the topic at runtime — for example subscribing a user’s email address from an API handler. The TopicArn is injected automatically. Provide the SubscribeHttp layer on the Function to implement the binding.

const subscribe = yield* SNS.Subscribe(topic);
const response = yield* subscribe({
Protocol: "email",
Endpoint: "user@example.com",
});