Class Subscription.Builder

java.lang.Object
software.amazon.awscdk.services.sns.Subscription.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<Subscription>
Enclosing class:
Subscription

@Stability(Stable) public static final class Subscription.Builder extends Object implements software.amazon.jsii.Builder<Subscription>
A fluent builder for Subscription.
  • Method Details

    • create

      @Stability(Stable) public static Subscription.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of Subscription.Builder.
    • endpoint

      @Stability(Stable) public Subscription.Builder endpoint(String endpoint)
      The subscription endpoint.

      The meaning of this value depends on the value for 'protocol'.

      Parameters:
      endpoint - The subscription endpoint. This parameter is required.
      Returns:
      this
    • protocol

      @Stability(Stable) public Subscription.Builder protocol(SubscriptionProtocol protocol)
      What type of subscription to add.

      Parameters:
      protocol - What type of subscription to add. This parameter is required.
      Returns:
      this
    • deadLetterQueue

      @Stability(Stable) public Subscription.Builder deadLetterQueue(IQueue deadLetterQueue)
      Queue to be used as dead letter queue.

      If not passed no dead letter queue is enabled.

      Default: - No dead letter queue enabled.

      Parameters:
      deadLetterQueue - Queue to be used as dead letter queue. This parameter is required.
      Returns:
      this
    • filterPolicy

      @Stability(Stable) public Subscription.Builder filterPolicy(Map<String,? extends SubscriptionFilter> filterPolicy)
      The filter policy.

      Default: - all messages are delivered

      Parameters:
      filterPolicy - The filter policy. This parameter is required.
      Returns:
      this
    • rawMessageDelivery

      @Stability(Stable) public Subscription.Builder rawMessageDelivery(Boolean rawMessageDelivery)
      true if raw message delivery is enabled for the subscription.

      Raw messages are free of JSON formatting and can be sent to HTTP/S and Amazon SQS endpoints. For more information, see GetSubscriptionAttributes in the Amazon Simple Notification Service API Reference.

      Default: false

      Parameters:
      rawMessageDelivery - true if raw message delivery is enabled for the subscription. This parameter is required.
      Returns:
      this
    • region

      @Stability(Stable) public Subscription.Builder region(String region)
      The region where the topic resides, in the case of cross-region subscriptions.

      Default: - the region where the CloudFormation stack is being deployed.

      Parameters:
      region - The region where the topic resides, in the case of cross-region subscriptions. This parameter is required.
      Returns:
      this
    • subscriptionRoleArn

      @Stability(Stable) public Subscription.Builder subscriptionRoleArn(String subscriptionRoleArn)
      Arn of role allowing access to firehose delivery stream.

      Required for a firehose subscription protocol.

      Default: - No subscription role is provided

      Parameters:
      subscriptionRoleArn - Arn of role allowing access to firehose delivery stream. This parameter is required.
      Returns:
      this
    • topic

      @Stability(Stable) public Subscription.Builder topic(ITopic topic)
      The topic to subscribe to.

      Parameters:
      topic - The topic to subscribe to. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public Subscription build()
      Specified by:
      build in interface software.amazon.jsii.Builder<Subscription>
      Returns:
      a newly built instance of Subscription.