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
-
Method Summary
Modifier and TypeMethodDescriptionstatic SnsDestinationBuilder
builder()
builder factory method for SnsDestinationstatic SnsDestinationBuilder
builder
(SnsDestination template) create builder for SnsDestination instancestatic SnsDestination
deepCopy
(SnsDestination template) factory method to create a deep copy of SnsDestinationOnly present ifauthenticationMode
is set toCredentials
.Only present ifauthenticationMode
is set toCredentials
.Defines the method of authentication for the SNS topic.@NotNull String
Amazon Resource Name (ARN) of the topic.static SnsDestination
of()
factory methodstatic SnsDestination
of
(SnsDestination template) factory method to create a shallow copy SnsDestinationvoid
setAccessKey
(String accessKey) Only present ifauthenticationMode
is set toCredentials
.void
setAccessSecret
(String accessSecret) Only present ifauthenticationMode
is set toCredentials
.void
setAuthenticationMode
(AwsAuthenticationMode authenticationMode) Defines the method of authentication for the SNS topic.void
setTopicArn
(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> T
withSnsDestination
(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
authenticationMode
is set toCredentials
.- Returns:
- accessKey
-
getAccessSecret
String getAccessSecret()Only present if
authenticationMode
is 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
authenticationMode
is set toCredentials
.- Parameters:
accessKey
- value to be set
-
setAccessSecret
Only present if
authenticationMode
is 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
-
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
-