Class CfnSubscription

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-11T15:56:06.390Z") @Stability(Stable) public class CfnSubscription extends CfnResource implements IInspectable
The AWS::SNS::Subscription resource subscribes an endpoint to an Amazon SNS topic.

For a subscription to be created, the owner of the endpoint must` confirm the subscription.

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.*;
 Object deliveryPolicy;
 Object filterPolicy;
 Object redrivePolicy;
 Object replayPolicy;
 CfnSubscription cfnSubscription = CfnSubscription.Builder.create(this, "MyCfnSubscription")
         .protocol("protocol")
         .topicArn("topicArn")
         // the properties below are optional
         .deliveryPolicy(deliveryPolicy)
         .endpoint("endpoint")
         .filterPolicy(filterPolicy)
         .filterPolicyScope("filterPolicyScope")
         .rawMessageDelivery(false)
         .redrivePolicy(redrivePolicy)
         .region("region")
         .replayPolicy(replayPolicy)
         .subscriptionRoleArn("subscriptionRoleArn")
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnSubscription

      protected CfnSubscription(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnSubscription

      protected CfnSubscription(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnSubscription

      @Stability(Stable) public CfnSubscription(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnSubscriptionProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      Arn of the subscription.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getProtocol

      @Stability(Stable) @NotNull public String getProtocol()
      The subscription's protocol.
    • setProtocol

      @Stability(Stable) public void setProtocol(@NotNull String value)
      The subscription's protocol.
    • getTopicArn

      @Stability(Stable) @NotNull public String getTopicArn()
      The ARN of the topic to subscribe to.
    • setTopicArn

      @Stability(Stable) public void setTopicArn(@NotNull String value)
      The ARN of the topic to subscribe to.
    • getDeliveryPolicy

      @Stability(Stable) @Nullable public Object getDeliveryPolicy()
      The delivery policy JSON assigned to the subscription.
    • setDeliveryPolicy

      @Stability(Stable) public void setDeliveryPolicy(@Nullable Object value)
      The delivery policy JSON assigned to the subscription.
    • getEndpoint

      @Stability(Stable) @Nullable public String getEndpoint()
      The subscription's endpoint.
    • setEndpoint

      @Stability(Stable) public void setEndpoint(@Nullable String value)
      The subscription's endpoint.
    • getFilterPolicy

      @Stability(Stable) @Nullable public Object getFilterPolicy()
      The filter policy JSON assigned to the subscription.
    • setFilterPolicy

      @Stability(Stable) public void setFilterPolicy(@Nullable Object value)
      The filter policy JSON assigned to the subscription.
    • getFilterPolicyScope

      @Stability(Stable) @Nullable public String getFilterPolicyScope()
      This attribute lets you choose the filtering scope by using one of the following string value types:.
    • setFilterPolicyScope

      @Stability(Stable) public void setFilterPolicyScope(@Nullable String value)
      This attribute lets you choose the filtering scope by using one of the following string value types:.
    • getRawMessageDelivery

      @Stability(Stable) @Nullable public Object getRawMessageDelivery()
      When set to true , enables raw message delivery.
    • setRawMessageDelivery

      @Stability(Stable) public void setRawMessageDelivery(@Nullable Boolean value)
      When set to true , enables raw message delivery.
    • setRawMessageDelivery

      @Stability(Stable) public void setRawMessageDelivery(@Nullable IResolvable value)
      When set to true , enables raw message delivery.
    • getRedrivePolicy

      @Stability(Stable) @Nullable public Object getRedrivePolicy()
      When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue.
    • setRedrivePolicy

      @Stability(Stable) public void setRedrivePolicy(@Nullable Object value)
      When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue.
    • getRegion

      @Stability(Stable) @Nullable public String getRegion()
      For cross-region subscriptions, the region in which the topic resides.
    • setRegion

      @Stability(Stable) public void setRegion(@Nullable String value)
      For cross-region subscriptions, the region in which the topic resides.
    • getReplayPolicy

      @Stability(Stable) @Nullable public Object getReplayPolicy()
      Specifies whether Amazon SNS resends the notification to the subscription when a message's attribute changes.
    • setReplayPolicy

      @Stability(Stable) public void setReplayPolicy(@Nullable Object value)
      Specifies whether Amazon SNS resends the notification to the subscription when a message's attribute changes.
    • getSubscriptionRoleArn

      @Stability(Stable) @Nullable public String getSubscriptionRoleArn()
      This property applies only to Amazon Data Firehose delivery stream subscriptions.
    • setSubscriptionRoleArn

      @Stability(Stable) public void setSubscriptionRoleArn(@Nullable String value)
      This property applies only to Amazon Data Firehose delivery stream subscriptions.