Interface TopicSubscriptionConfig

All Superinterfaces:
software.amazon.jsii.JsiiSerializable, SubscriptionOptions
All Known Implementing Classes:
TopicSubscriptionConfig.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:38.204Z") @Stability(Stable) public interface TopicSubscriptionConfig extends software.amazon.jsii.JsiiSerializable, SubscriptionOptions
Subscription configuration.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.sns.*;
 import software.amazon.awscdk.services.sqs.*;
 import software.amazon.awscdk.core.*;
 Construct construct;
 Queue queue;
 SubscriptionFilter subscriptionFilter;
 TopicSubscriptionConfig topicSubscriptionConfig = TopicSubscriptionConfig.builder()
         .endpoint("endpoint")
         .protocol(SubscriptionProtocol.HTTP)
         .subscriberId("subscriberId")
         // the properties below are optional
         .deadLetterQueue(queue)
         .filterPolicy(Map.of(
                 "filterPolicyKey", subscriptionFilter))
         .rawMessageDelivery(false)
         .region("region")
         .subscriberScope(construct)
         .subscriptionRoleArn("subscriptionRoleArn")
         .build();
 
  • Method Details

    • getSubscriberId

      @Stability(Stable) @NotNull String getSubscriberId()
      The id of the SNS subscription resource created under scope.

      In most cases, it is recommended to use the uniqueId of the topic you are subscribing to.

    • getSubscriberScope

      @Stability(Stable) @Nullable default Construct getSubscriberScope()
      The scope in which to create the SNS subscription resource.

      Normally you'd want the subscription to be created on the consuming stack because the topic is usually referenced by the consumer's resource policy (e.g. SQS queue policy). Otherwise, it will cause a cyclic reference.

      If this is undefined, the subscription will be created on the topic's stack.

      Default: - use the topic as the scope of the subscription, in which case `subscriberId` must be defined.

    • builder

      @Stability(Stable) static TopicSubscriptionConfig.Builder builder()
      Returns:
      a TopicSubscriptionConfig.Builder of TopicSubscriptionConfig