Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SubscribeCommand

Subscribes an endpoint to an Amazon SNS topic. If the endpoint type is HTTP/S or email, or if the endpoint and the topic are not in the same Amazon Web Services account, the endpoint owner must run the ConfirmSubscription action to confirm the subscription.

You call the ConfirmSubscription action with the token from the subscription response. Confirmation tokens are valid for three days.

This action is throttled at 100 transactions per second (TPS).

example

Use a bare-bones client and the command you need to make an API call.

import { SNSClient, SubscribeCommand } from "@aws-sdk/client-sns"; // ES Modules import
// const { SNSClient, SubscribeCommand } = require("@aws-sdk/client-sns"); // CommonJS import
const client = new SNSClient(config);
const command = new SubscribeCommand(input);
const response = await client.send(command);
see

SubscribeCommandInput for command's input shape.

see

SubscribeCommandOutput for command's response shape.

see

config for SNSClient's config shape.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Readonly input

input: SubscribeCommandInput

Readonly middlewareStack

middlewareStack: IMiddlewareStack<SubscribeCommandInput, SubscribeCommandOutput>

Methods

Static getEndpointParameterInstructions