Interface SnsDestination
- All Superinterfaces:
Destination
AWS SNS can be used to push messages to AWS Lambda, HTTP endpoints (webhooks), or fan-out messages to SQS queues. The SQS queue must be a Standard queue type.
We recommend setting authenticationMode to IAM, to avoid unnecessary key management. For IAM authentication and before creating the Subscription, give permissions to the following user account: arn:aws:iam::362576667341:user/subscriptions. Otherwise, a test notification will not be sent.
If you prefer to use Credentials for authentication, we recommend creating an IAM user with an accessKey and accessSecret pair specifically for each Subscription.
The IAM user should only have the sns:Publish permission on this topic.
Example to create an instance using the builder pattern
SnsDestination snsDestination = SnsDestination.builder()
.topicArn("{topicArn}")
.build()
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic SnsDestinationBuilderbuilder()builder factory method for SnsDestinationstatic SnsDestinationBuilderbuilder(SnsDestination template) create builder for SnsDestination instancecopyDeep()static SnsDestinationdeepCopy(SnsDestination template) factory method to create a deep copy of SnsDestinationOnly present ifauthenticationModeis set toCredentials.Only present ifauthenticationModeis set toCredentials.Defines the method of authentication for the SNS topic.@NotNull StringAmazon Resource Name (ARN) of the topic.static SnsDestinationof()factory methodstatic SnsDestinationof(SnsDestination template) factory method to create a shallow copy SnsDestinationvoidsetAccessKey(String accessKey) Only present ifauthenticationModeis set toCredentials.voidsetAccessSecret(String accessSecret) Only present ifauthenticationModeis set toCredentials.voidsetAuthenticationMode(AwsAuthenticationMode authenticationMode) Defines the method of authentication for the SNS topic.voidsetTopicArn(String topicArn) Amazon Resource Name (ARN) of the topic.static com.fasterxml.jackson.core.type.TypeReference<SnsDestination>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithSnsDestination(Function<SnsDestination, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.subscription.Destination
getType, withDestination
-
Field Details
-
SNS
discriminator value for SnsDestination- See Also:
-
-
Method Details
-
getAccessKey
String getAccessKey()Only present if
authenticationModeis set toCredentials.- Returns:
- accessKey
-
getAccessSecret
String getAccessSecret()Only present if
authenticationModeis set toCredentials.- Returns:
- accessSecret
-
getTopicArn
Amazon Resource Name (ARN) of the topic.
- Returns:
- topicArn
-
getAuthenticationMode
AwsAuthenticationMode getAuthenticationMode()Defines the method of authentication for the SNS topic.
- Returns:
- authenticationMode
-
setAccessKey
Only present if
authenticationModeis set toCredentials.- Parameters:
accessKey- value to be set
-
setAccessSecret
Only present if
authenticationModeis set toCredentials.- Parameters:
accessSecret- value to be set
-
setTopicArn
Amazon Resource Name (ARN) of the topic.
- Parameters:
topicArn- value to be set
-
setAuthenticationMode
Defines the method of authentication for the SNS topic.
- Parameters:
authenticationMode- value to be set
-
of
factory method- Returns:
- instance of SnsDestination
-
of
factory method to create a shallow copy SnsDestination- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
SnsDestination copyDeep()- Specified by:
copyDeepin interfaceDestination
-
deepCopy
factory method to create a deep copy of SnsDestination- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for SnsDestination- Returns:
- builder
-
builder
create builder for SnsDestination instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withSnsDestination
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-