Interface SnsDestination

All Superinterfaces:
Destination

public interface SnsDestination extends 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 Details

  • Method Details

    • getAccessKey

      String getAccessKey()

      Only present if authenticationMode is set to Credentials.

      Returns:
      accessKey
    • getAccessSecret

      String getAccessSecret()

      Only present if authenticationMode is set to Credentials.

      Returns:
      accessSecret
    • getTopicArn

      @NotNull @NotNull String 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

      void setAccessKey(String accessKey)

      Only present if authenticationMode is set to Credentials.

      Parameters:
      accessKey - value to be set
    • setAccessSecret

      void setAccessSecret(String accessSecret)

      Only present if authenticationMode is set to Credentials.

      Parameters:
      accessSecret - value to be set
    • setTopicArn

      void setTopicArn(String topicArn)

      Amazon Resource Name (ARN) of the topic.

      Parameters:
      topicArn - value to be set
    • setAuthenticationMode

      void setAuthenticationMode(AwsAuthenticationMode authenticationMode)

      Defines the method of authentication for the SNS topic.

      Parameters:
      authenticationMode - value to be set
    • of

      static SnsDestination of()
      factory method
      Returns:
      instance of SnsDestination
    • of

      static SnsDestination of(SnsDestination template)
      factory method to create a shallow copy SnsDestination
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static SnsDestination deepCopy(@Nullable SnsDestination template)
      factory method to create a deep copy of SnsDestination
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static SnsDestinationBuilder builder()
      builder factory method for SnsDestination
      Returns:
      builder
    • builder

      static SnsDestinationBuilder builder(SnsDestination template)
      create builder for SnsDestination instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withSnsDestination

      default <T> T withSnsDestination(Function<SnsDestination,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<SnsDestination> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference