Class TopicSubscriptionConfig.Builder
java.lang.Object
software.amazon.awscdk.services.sns.TopicSubscriptionConfig.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<TopicSubscriptionConfig>
- Enclosing interface:
TopicSubscriptionConfig
@Stability(Stable)
public static final class TopicSubscriptionConfig.Builder
extends Object
implements software.amazon.jsii.Builder<TopicSubscriptionConfig>
A builder for
TopicSubscriptionConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.deadLetterQueue
(IQueue deadLetterQueue) Sets the value ofSubscriptionOptions.getDeadLetterQueue()
Sets the value ofSubscriptionOptions.getEndpoint()
filterPolicy
(Map<String, ? extends SubscriptionFilter> filterPolicy) Sets the value ofSubscriptionOptions.getFilterPolicy()
protocol
(SubscriptionProtocol protocol) Sets the value ofSubscriptionOptions.getProtocol()
rawMessageDelivery
(Boolean rawMessageDelivery) Sets the value ofSubscriptionOptions.getRawMessageDelivery()
Sets the value ofSubscriptionOptions.getRegion()
subscriberId
(String subscriberId) Sets the value ofTopicSubscriptionConfig.getSubscriberId()
subscriberScope
(Construct subscriberScope) Sets the value ofTopicSubscriptionConfig.getSubscriberScope()
subscriptionRoleArn
(String subscriptionRoleArn) Sets the value ofSubscriptionOptions.getSubscriptionRoleArn()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
subscriberId
Sets the value ofTopicSubscriptionConfig.getSubscriberId()
- Parameters:
subscriberId
- The id of the SNS subscription resource created underscope
. This parameter is required. In most cases, it is recommended to use theuniqueId
of the topic you are subscribing to.- Returns:
this
-
subscriberScope
@Stability(Stable) public TopicSubscriptionConfig.Builder subscriberScope(Construct subscriberScope) Sets the value ofTopicSubscriptionConfig.getSubscriberScope()
- Parameters:
subscriberScope
- 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.
- Returns:
this
-
endpoint
Sets the value ofSubscriptionOptions.getEndpoint()
- Parameters:
endpoint
- The subscription endpoint. This parameter is required. The meaning of this value depends on the value for 'protocol'.- Returns:
this
-
protocol
Sets the value ofSubscriptionOptions.getProtocol()
- Parameters:
protocol
- What type of subscription to add. This parameter is required.- Returns:
this
-
deadLetterQueue
Sets the value ofSubscriptionOptions.getDeadLetterQueue()
- Parameters:
deadLetterQueue
- Queue to be used as dead letter queue. If not passed no dead letter queue is enabled.- Returns:
this
-
filterPolicy
@Stability(Stable) public TopicSubscriptionConfig.Builder filterPolicy(Map<String, ? extends SubscriptionFilter> filterPolicy) Sets the value ofSubscriptionOptions.getFilterPolicy()
- Parameters:
filterPolicy
- The filter policy.- Returns:
this
-
rawMessageDelivery
@Stability(Stable) public TopicSubscriptionConfig.Builder rawMessageDelivery(Boolean rawMessageDelivery) Sets the value ofSubscriptionOptions.getRawMessageDelivery()
- Parameters:
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.- Returns:
this
-
region
Sets the value ofSubscriptionOptions.getRegion()
- Parameters:
region
- The region where the topic resides, in the case of cross-region subscriptions.- Returns:
this
-
subscriptionRoleArn
@Stability(Stable) public TopicSubscriptionConfig.Builder subscriptionRoleArn(String subscriptionRoleArn) Sets the value ofSubscriptionOptions.getSubscriptionRoleArn()
- Parameters:
subscriptionRoleArn
- Arn of role allowing access to firehose delivery stream. Required for a firehose subscription protocol.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<TopicSubscriptionConfig>
- Returns:
- a new instance of
TopicSubscriptionConfig
- Throws:
NullPointerException
- if any required attribute was not provided
-