Class TopicPolicyProps
Properties to associate SNS topics with a policy.
Inheritance
System.Object
TopicPolicyProps
Implements
Namespace: Amazon.CDK.AWS.SNS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class TopicPolicyProps : Object, ITopicPolicyProps
Syntax (vb)
Public Class TopicPolicyProps
Inherits Object
Implements ITopicPolicyProps
Remarks
ExampleMetadata: infused
Examples
var topic = new Topic(this, "Topic");
var policyDocument = new PolicyDocument(new PolicyDocumentProps {
AssignSids = true,
Statements = new [] {
new PolicyStatement(new PolicyStatementProps {
Actions = new [] { "sns:Subscribe" },
Principals = new [] { new AnyPrincipal() },
Resources = new [] { topic.TopicArn }
}) }
});
var topicPolicy = new TopicPolicy(this, "Policy", new TopicPolicyProps {
Topics = new [] { topic },
PolicyDocument = policyDocument
});
Synopsis
Constructors
TopicPolicyProps() |
Properties
EnforceSSL | Adds a statement to enforce encryption of data in transit when publishing to the topic. |
PolicyDocument | IAM policy document to apply to topic(s). |
Topics | The set of topics this policy applies to. |
Constructors
TopicPolicyProps()
public TopicPolicyProps()
Properties
EnforceSSL
Adds a statement to enforce encryption of data in transit when publishing to the topic.
public Nullable<bool> EnforceSSL { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
For more information, see https://docs.aws.amazon.com/sns/latest/dg/sns-security-best-practices.html#enforce-encryption-data-in-transit.
Default: false
PolicyDocument
IAM policy document to apply to topic(s).
public PolicyDocument PolicyDocument { get; set; }
Property Value
Remarks
Default: empty policy document
Topics
The set of topics this policy applies to.
public ITopic[] Topics { get; set; }
Property Value
ITopic[]