Class: AWSCDK::SNS::CfnTopicProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
sns/cfn_topic_props.rb

Overview

Properties for defining a CfnTopic.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(archive_policy: nil, content_based_deduplication: nil, data_protection_policy: nil, delivery_status_logging: nil, display_name: nil, fifo_throughput_scope: nil, fifo_topic: nil, kms_master_key_id: nil, signature_version: nil, subscription: nil, tags: nil, topic_name: nil, tracing_config: nil) ⇒ CfnTopicProps

Returns a new instance of CfnTopicProps.

Parameters:

  • archive_policy (Object, nil) (defaults to: nil)

    The ArchivePolicy determines the number of days Amazon retains messages in FIFO topics.

  • content_based_deduplication (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    ContentBasedDeduplication enables deduplication of messages based on their content for FIFO topics.

  • data_protection_policy (Object, nil) (defaults to: nil)

    The body of the policy document you want to use for this topic.

  • delivery_status_logging (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::SNS::CfnTopic::LoggingConfigProperty>, nil) (defaults to: nil)

    The DeliveryStatusLogging configuration enables you to log the delivery status of messages sent from your Amazon SNS topic to subscribed endpoints with the following supported delivery protocols:.

  • display_name (String, nil) (defaults to: nil)

    The display name to use for an Amazon topic with SMS subscriptions.

  • fifo_throughput_scope (String, nil) (defaults to: nil)

    Specifies the throughput quota and deduplication behavior to apply for the FIFO topic.

  • fifo_topic (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Set to true to create a FIFO topic.

  • kms_master_key_id (String, AWSCDK::Interfaces::AWSKMS::IAliasRef, AWSCDK::Interfaces::AWSKMS::IKeyRef, nil) (defaults to: nil)

    The ID of an AWS managed customer master key (CMK) for Amazon or a custom CMK.

  • signature_version (String, nil) (defaults to: nil)

    The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS.

  • subscription (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::SNS::CfnTopic::SubscriptionProperty>, nil) (defaults to: nil)

    The Amazon subscriptions (endpoints) for this topic.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    The list of tags to add to a new topic.

  • topic_name (String, nil) (defaults to: nil)

    The name of the topic you want to create.

  • tracing_config (String, nil) (defaults to: nil)

    Tracing mode of an Amazon topic.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'sns/cfn_topic_props.rb', line 22

def initialize(archive_policy: nil, content_based_deduplication: nil, data_protection_policy: nil, delivery_status_logging: nil, display_name: nil, fifo_throughput_scope: nil, fifo_topic: nil, kms_master_key_id: nil, signature_version: nil, subscription: nil, tags: nil, topic_name: nil, tracing_config: nil)
  @archive_policy = archive_policy
  Jsii::Type.check_type(@archive_policy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "archivePolicy") unless @archive_policy.nil?
  @content_based_deduplication = content_based_deduplication
  Jsii::Type.check_type(@content_based_deduplication, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "contentBasedDeduplication") unless @content_based_deduplication.nil?
  @data_protection_policy = data_protection_policy
  Jsii::Type.check_type(@data_protection_policy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "dataProtectionPolicy") unless @data_protection_policy.nil?
  @delivery_status_logging = delivery_status_logging
  Jsii::Type.check_type(@delivery_status_logging, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc25zLkNmblRvcGljLkxvZ2dpbmdDb25maWdQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "deliveryStatusLogging") unless @delivery_status_logging.nil?
  @display_name = display_name
  Jsii::Type.check_type(@display_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "displayName") unless @display_name.nil?
  @fifo_throughput_scope = fifo_throughput_scope
  Jsii::Type.check_type(@fifo_throughput_scope, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "fifoThroughputScope") unless @fifo_throughput_scope.nil?
  @fifo_topic = fifo_topic
  Jsii::Type.check_type(@fifo_topic, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "fifoTopic") unless @fifo_topic.nil?
  @kms_master_key_id = kms_master_key_id
  Jsii::Type.check_type(@kms_master_key_id, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19rbXMuSUFsaWFzUmVmIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19rbXMuSUtleVJlZiJ9XX19")), "kmsMasterKeyId") unless @kms_master_key_id.nil?
  @signature_version = signature_version
  Jsii::Type.check_type(@signature_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "signatureVersion") unless @signature_version.nil?
  @subscription = subscription
  Jsii::Type.check_type(@subscription, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc25zLkNmblRvcGljLlN1YnNjcmlwdGlvblByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "subscription") unless @subscription.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
  @topic_name = topic_name
  Jsii::Type.check_type(@topic_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "topicName") unless @topic_name.nil?
  @tracing_config = tracing_config
  Jsii::Type.check_type(@tracing_config, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tracingConfig") unless @tracing_config.nil?
end

Instance Attribute Details

#archive_policyObject? (readonly)

The ArchivePolicy determines the number of days Amazon retains messages in FIFO topics.

You can set a retention period ranging from 1 to 365 days. This property is only applicable to FIFO topics; attempting to use it with standard topics will result in a creation failure.



57
58
59
# File 'sns/cfn_topic_props.rb', line 57

def archive_policy
  @archive_policy
end

#content_based_deduplicationBoolean, ... (readonly)

ContentBasedDeduplication enables deduplication of messages based on their content for FIFO topics.

By default, this property is set to false. If you create a FIFO topic with ContentBasedDeduplication set to false, you must provide a MessageDeduplicationId for each Publish action. When set to true, Amazon automatically generates a MessageDeduplicationId using a SHA-256 hash of the message body (excluding message attributes). You can optionally override this generated value by specifying a MessageDeduplicationId in the Publish action. Note that this property only applies to FIFO topics; using it with standard topics will cause the creation to fail.



64
65
66
# File 'sns/cfn_topic_props.rb', line 64

def content_based_deduplication
  @content_based_deduplication
end

#data_protection_policyObject? (readonly)

The body of the policy document you want to use for this topic.

You can only add one policy per topic.

The policy must be in JSON string format.

Length Constraints: Maximum length of 30,720.



75
76
77
# File 'sns/cfn_topic_props.rb', line 75

def data_protection_policy
  @data_protection_policy
end

#delivery_status_loggingAWSCDK::IResolvable, ... (readonly)

The DeliveryStatusLogging configuration enables you to log the delivery status of messages sent from your Amazon SNS topic to subscribed endpoints with the following supported delivery protocols:.

  • HTTP
  • Amazon Kinesis Data Firehose
  • AWS Lambda
  • Platform application endpoint
  • Amazon Simple Queue Service

Once configured, log entries are sent to Amazon CloudWatch Logs.



88
89
90
# File 'sns/cfn_topic_props.rb', line 88

def delivery_status_logging
  @delivery_status_logging
end

#display_nameString? (readonly)

The display name to use for an Amazon topic with SMS subscriptions.

The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.



95
96
97
# File 'sns/cfn_topic_props.rb', line 95

def display_name
  @display_name
end

#fifo_throughput_scopeString? (readonly)

Specifies the throughput quota and deduplication behavior to apply for the FIFO topic.

Valid values are Topic or MessageGroup .



102
103
104
# File 'sns/cfn_topic_props.rb', line 102

def fifo_throughput_scope
  @fifo_throughput_scope
end

#fifo_topicBoolean, ... (readonly)

Set to true to create a FIFO topic.



107
108
109
# File 'sns/cfn_topic_props.rb', line 107

def fifo_topic
  @fifo_topic
end

#kms_master_key_idString, ... (readonly)

The ID of an AWS managed customer master key (CMK) for Amazon or a custom CMK.

For more information, see Key terms . For more examples, see [KeyId](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) in the AWS Key Management Service API Reference .

This property applies only to server-side-encryption .



116
117
118
# File 'sns/cfn_topic_props.rb', line 116

def kms_master_key_id
  @kms_master_key_id
end

#signature_versionString? (readonly)

The signature version corresponds to the hashing algorithm used while creating the signature of the notifications, subscription confirmations, or unsubscribe confirmation messages sent by Amazon SNS.

By default, SignatureVersion is set to 1 .



123
124
125
# File 'sns/cfn_topic_props.rb', line 123

def signature_version
  @signature_version
end

#subscriptionAWSCDK::IResolvable, ... (readonly)

The Amazon subscriptions (endpoints) for this topic.

If you specify the Subscription property in the AWS::SNS::Topic resource and it creates an associated subscription resource, the associated subscription is not deleted when the AWS::SNS::Topic resource is deleted.



130
131
132
# File 'sns/cfn_topic_props.rb', line 130

def subscription
  @subscription
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

The list of tags to add to a new topic.

To be able to tag a topic on creation, you must have the sns:CreateTopic and sns:TagResource permissions.



137
138
139
# File 'sns/cfn_topic_props.rb', line 137

def tags
  @tags
end

#topic_nameString? (readonly)

The name of the topic you want to create.

Topic names must include only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens, and must be between 1 and 256 characters long. FIFO topic names must end with .fifo .

If you don't specify a name, CloudFormation generates a unique physical ID and uses that ID for the topic name. For more information, see Name type .

If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.



148
149
150
# File 'sns/cfn_topic_props.rb', line 148

def topic_name
  @topic_name
end

#tracing_configString? (readonly)

Tracing mode of an Amazon topic.

By default TracingConfig is set to PassThrough , and the topic passes through the tracing header it receives from an Amazon publisher to its subscriptions. If set to Active , Amazon will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true.



155
156
157
# File 'sns/cfn_topic_props.rb', line 155

def tracing_config
  @tracing_config
end

Class Method Details

.jsii_propertiesObject



157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'sns/cfn_topic_props.rb', line 157

def self.jsii_properties
  {
    :archive_policy => "archivePolicy",
    :content_based_deduplication => "contentBasedDeduplication",
    :data_protection_policy => "dataProtectionPolicy",
    :delivery_status_logging => "deliveryStatusLogging",
    :display_name => "displayName",
    :fifo_throughput_scope => "fifoThroughputScope",
    :fifo_topic => "fifoTopic",
    :kms_master_key_id => "kmsMasterKeyId",
    :signature_version => "signatureVersion",
    :subscription => "subscription",
    :tags => "tags",
    :topic_name => "topicName",
    :tracing_config => "tracingConfig",
  }
end

Instance Method Details

#to_jsiiObject



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'sns/cfn_topic_props.rb', line 175

def to_jsii
  result = {}
  result.merge!({
    "archivePolicy" => @archive_policy,
    "contentBasedDeduplication" => @content_based_deduplication,
    "dataProtectionPolicy" => @data_protection_policy,
    "deliveryStatusLogging" => @delivery_status_logging,
    "displayName" => @display_name,
    "fifoThroughputScope" => @fifo_throughput_scope,
    "fifoTopic" => @fifo_topic,
    "kmsMasterKeyId" => @kms_master_key_id,
    "signatureVersion" => @signature_version,
    "subscription" => @subscription,
    "tags" => @tags,
    "topicName" => @topic_name,
    "tracingConfig" => @tracing_config,
  })
  result.compact
end