Class

SNSService

SNSService(snsClient)

Constructor

# new SNSService(snsClient)

Creates an instance of SNSService.

Parameters:
Name Type Description
snsClient AWS.SNS

An instance of AWS.SNS

View Source src/aws/sns/SNSService.js, line 18

Methods

# async getTopicAttributes(topicArn) → {Promise.<Object>}

Get attributes for the specified SNS topic to verify it exists.

Parameters:
Name Type Description
topicArn string

The ARN of the SNS topic.

View Source src/aws/sns/SNSService.js, line 104

  • The topic attributes.
Promise.<Object>

# async publishMessage(topicArn, messageBody) → {Promise.<Object>}

Publish a message to the specified SNS topic.

Parameters:
Name Type Description
topicArn string

The ARN of the SNS topic.

messageBody Object

The message body to publish.

View Source src/aws/sns/SNSService.js, line 36

  • The result from SNS.
Promise.<Object>

# async subscribe(topicArn, protocol, endpoint) → {Promise.<Object>}

Subscribe an endpoint to the specified SNS topic.

Parameters:
Name Type Description
topicArn string

The ARN of the SNS topic.

protocol string

The protocol of the endpoint (e.g., 'email', 'sms', 'lambda', etc.).

endpoint string

The endpoint to subscribe (e.g., email address, phone number, Lambda ARN, etc.).

View Source src/aws/sns/SNSService.js, line 60

  • The result from SNS.
Promise.<Object>

# async unsubscribe(subscriptionArn) → {Promise.<Object>}

Unsubscribe an endpoint from the specified SNS topic.

Parameters:
Name Type Description
subscriptionArn string

The ARN of the subscription to unsubscribe.

View Source src/aws/sns/SNSService.js, line 83

  • The result from SNS.
Promise.<Object>