interface TopicPolicyProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.SNS.TopicPolicyProps |
Java | software.amazon.awscdk.services.sns.TopicPolicyProps |
Python | aws_cdk.aws_sns.TopicPolicyProps |
TypeScript (source) | @aws-cdk/aws-sns » TopicPolicyProps |
Properties to associate SNS topics with a policy.
Example
const topic = new sns.Topic(this, 'Topic');
const topicPolicy = new sns.TopicPolicy(this, 'TopicPolicy', {
topics: [topic],
});
topicPolicy.document.addStatements(new iam.PolicyStatement({
actions: ["sns:Subscribe"],
principals: [new iam.AnyPrincipal()],
resources: [topic.topicArn],
}));
Properties
Name | Type | Description |
---|---|---|
topics | ITopic [] | The set of topics this policy applies to. |
policy | Policy | IAM policy document to apply to topic(s). |
topics
Type:
ITopic
[]
The set of topics this policy applies to.
policyDocument?
Type:
Policy
(optional, default: empty policy document)
IAM policy document to apply to topic(s).