Show / Hide Table of Contents

Class TopicPolicyProps

Properties to associate SNS topics with a policy.

Inheritance
System.Object
TopicPolicyProps
Implements
ITopicPolicyProps
Namespace: Amazon.CDK.AWS.SNS
Assembly: Amazon.CDK.AWS.SNS.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 topicPolicy = new TopicPolicy(this, "TopicPolicy", new TopicPolicyProps {
    Topics = new [] { topic }
});

topicPolicy.Document.AddStatements(new PolicyStatement(new PolicyStatementProps {
    Actions = new [] { "sns:Subscribe" },
    Principals = new [] { new AnyPrincipal() },
    Resources = new [] { topic.TopicArn }
}));

Synopsis

Constructors

TopicPolicyProps()

Properties

PolicyDocument

IAM policy document to apply to topic(s).

Topics

The set of topics this policy applies to.

Constructors

TopicPolicyProps()

public TopicPolicyProps()

Properties

PolicyDocument

IAM policy document to apply to topic(s).

public PolicyDocument PolicyDocument { get; set; }
Property Value

PolicyDocument

Remarks

Default: empty policy document

Topics

The set of topics this policy applies to.

public ITopic[] Topics { get; set; }
Property Value

ITopic[]

Implements

ITopicPolicyProps
Back to top Generated by DocFX