interface TopicPolicyProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.SNS.TopicPolicyProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awssns#TopicPolicyProps |
![]() | software.amazon.awscdk.services.sns.TopicPolicyProps |
![]() | aws_cdk.aws_sns.TopicPolicyProps |
![]() | aws-cdk-lib » aws_sns » TopicPolicyProps |
Properties to associate SNS topics with a policy.
Example
const topic = new sns.Topic(this, 'Topic');
const policyDocument = new iam.PolicyDocument({
assignSids: true,
statements: [
new iam.PolicyStatement({
actions: ["sns:Subscribe"],
principals: [new iam.AnyPrincipal()],
resources: [topic.topicArn],
}),
],
});
const topicPolicy = new sns.TopicPolicy(this, 'Policy', {
topics: [topic],
policyDocument,
});
Properties
Name | Type | Description |
---|---|---|
topics | ITopic [] | The set of topics this policy applies to. |
enforce | boolean | Adds a statement to enforce encryption of data in transit when publishing to the topic. |
policy | Policy | IAM policy document to apply to topic(s). |
topics
Type:
ITopic
[]
The set of topics this policy applies to.
enforceSSL?
Type:
boolean
(optional, default: false)
Adds a statement to enforce encryption of data in transit when publishing to the topic.
For more information, see https://docs.aws.amazon.com/sns/latest/dg/sns-security-best-practices.html#enforce-encryption-data-in-transit.
policyDocument?
Type:
Policy
(optional, default: empty policy document)
IAM policy document to apply to topic(s).