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()
filterPolicyWithMessageBody
(Map<String, ? extends FilterOrPolicy> filterPolicyWithMessageBody) Sets the value ofSubscriptionOptions.getFilterPolicyWithMessageBody()
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
(software.constructs.Construct subscriberScope) Sets the value ofTopicSubscriptionConfig.getSubscriberScope()
subscriptionDependency
(software.constructs.IDependable subscriptionDependency) Sets the value ofTopicSubscriptionConfig.getSubscriptionDependency()
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(software.constructs.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
-
subscriptionDependency
@Stability(Stable) public TopicSubscriptionConfig.Builder subscriptionDependency(software.constructs.IDependable subscriptionDependency) Sets the value ofTopicSubscriptionConfig.getSubscriptionDependency()
- Parameters:
subscriptionDependency
- The resources that need to be created before the subscription can be safely created. For example for SQS subscription, the subscription needs to have a dependency on the SQS queue policy in order for the subscription to successfully deliver messages.- 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
-
filterPolicyWithMessageBody
@Stability(Stable) public TopicSubscriptionConfig.Builder filterPolicyWithMessageBody(Map<String, ? extends FilterOrPolicy> filterPolicyWithMessageBody) Sets the value ofSubscriptionOptions.getFilterPolicyWithMessageBody()
- Parameters:
filterPolicyWithMessageBody
- The filter policy that is applied on the message body. To apply a filter policy to the message attributes, usefilterPolicy
. A maximum of one offilterPolicyWithMessageBody
andfilterPolicy
may be used.- 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
-