Class CfnTopic
A CloudFormation AWS::SNS::Topic
.
Inherited Members
Namespace: Amazon.CDK.AWS.SNS
Assembly: Amazon.CDK.AWS.SNS.dll
Syntax (csharp)
public class CfnTopic : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnTopic
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
The AWS::SNS::Topic
resource creates a topic to which notifications can be published.
One account can create a maximum of 100,000 standard topics and 1,000 FIFO topics. For more information, see Amazon SNS endpoints and quotas in the AWS General Reference .
CloudformationResource: AWS::SNS::Topic
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sns-topic.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.SNS;
var dataProtectionPolicy;
var cfnTopic = new CfnTopic(this, "MyCfnTopic", new CfnTopicProps {
ContentBasedDeduplication = false,
DataProtectionPolicy = dataProtectionPolicy,
DisplayName = "displayName",
FifoTopic = false,
KmsMasterKeyId = "kmsMasterKeyId",
SignatureVersion = "signatureVersion",
Subscription = new [] { new SubscriptionProperty {
Endpoint = "endpoint",
Protocol = "protocol"
} },
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} },
TopicName = "topicName",
TracingConfig = "tracingConfig"
});
Synopsis
Constructors
CfnTopic(Construct, String, ICfnTopicProps) | Create a new |
CfnTopic(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnTopic(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AttrTopicArn | Returns the ARN of an Amazon SNS topic. |
AttrTopicName | Returns the name of an Amazon SNS topic. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
ContentBasedDeduplication | Enables content-based deduplication for FIFO topics. |
DataProtectionPolicy | The body of the policy document you want to use for this topic. |
DisplayName | The display name to use for an Amazon SNS topic with SMS subscriptions. |
FifoTopic | Set to true to create a FIFO topic. |
KmsMasterKeyId | The ID of an AWS managed customer master key (CMK) for Amazon SNS or a custom CMK. |
SignatureVersion | 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 | The Amazon SNS subscriptions (endpoints) for this topic. |
Tags | The list of tags to add to a new topic. |
TopicName | The name of the topic you want to create. |
TracingConfig | Tracing mode of an Amazon SNS topic. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnTopic(Construct, String, ICfnTopicProps)
Create a new AWS::SNS::Topic
.
public CfnTopic(Construct scope, string id, ICfnTopicProps props = null)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnTopicProps
- resource properties.
CfnTopic(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnTopic(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnTopic(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnTopic(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AttrTopicArn
Returns the ARN of an Amazon SNS topic.
public virtual string AttrTopicArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: TopicArn
AttrTopicName
Returns the name of an Amazon SNS topic.
public virtual string AttrTopicName { get; }
Property Value
System.String
Remarks
CloudformationAttribute: TopicName
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
ContentBasedDeduplication
Enables content-based deduplication for FIFO topics.
public virtual object ContentBasedDeduplication { get; set; }
Property Value
System.Object
Remarks
(Optional) To override the generated value, you can specify a value for the the MessageDeduplicationId
parameter for the Publish
action.
DataProtectionPolicy
The body of the policy document you want to use for this topic.
public virtual object DataProtectionPolicy { get; set; }
Property Value
System.Object
Remarks
You can only add one policy per topic.
The policy must be in JSON string format.
Length Constraints: Maximum length of 30,720.
DisplayName
The display name to use for an Amazon SNS topic with SMS subscriptions.
public virtual string DisplayName { get; set; }
Property Value
System.String
Remarks
The display name must be maximum 100 characters long, including hyphens (-), underscores (_), spaces, and tabs.
FifoTopic
Set to true to create a FIFO topic.
public virtual object FifoTopic { get; set; }
Property Value
System.Object
Remarks
KmsMasterKeyId
The ID of an AWS managed customer master key (CMK) for Amazon SNS or a custom CMK.
public virtual string KmsMasterKeyId { get; set; }
Property Value
System.String
Remarks
For more information, see Key terms . For more examples, see KeyId
in the AWS Key Management Service API Reference .
This property applies only to server-side-encryption .
SignatureVersion
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.
public virtual string SignatureVersion { get; set; }
Property Value
System.String
Remarks
By default, SignatureVersion
is set to 1
.
Subscription
The Amazon SNS subscriptions (endpoints) for this topic.
public virtual object Subscription { get; set; }
Property Value
System.Object
Remarks
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.
Tags
The list of tags to add to a new topic.
public virtual TagManager Tags { get; }
Property Value
Remarks
To be able to tag a topic on creation, you must have the sns:CreateTopic
and sns:TagResource
permissions.
TopicName
The name of the topic you want to create.
public virtual string TopicName { get; set; }
Property Value
System.String
Remarks
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, AWS 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.
TracingConfig
Tracing mode of an Amazon SNS topic.
public virtual string TracingConfig { get; set; }
Property Value
System.String
Remarks
By default TracingConfig
is set to PassThrough
, and the topic passes through the tracing header it receives from an SNS publisher to its subscriptions. If set to Active
, SNS will vend X-Ray segment data to topic owner account if the sampled flag in the tracing header is true. Only supported on standard topics.
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>