Interface TopicPolicyProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
TopicPolicyProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-13T16:10:14.667Z")
@Stability(Stable)
public interface TopicPolicyProps
extends software.amazon.jsii.JsiiSerializable
Properties to associate SNS topics with a policy.
Example:
Topic topic = new Topic(this, "Topic");
PolicyDocument policyDocument = PolicyDocument.Builder.create()
.assignSids(true)
.statements(List.of(
PolicyStatement.Builder.create()
.actions(List.of("sns:Subscribe"))
.principals(List.of(new AnyPrincipal()))
.resources(List.of(topic.getTopicArn()))
.build()))
.build();
TopicPolicy topicPolicy = TopicPolicy.Builder.create(this, "Policy")
.topics(List.of(topic))
.policyDocument(policyDocument)
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forTopicPolicyPropsstatic final classAn implementation forTopicPolicyProps -
Method Summary
Modifier and TypeMethodDescriptionstatic TopicPolicyProps.Builderbuilder()default BooleanAdds a statement to enforce encryption of data in transit when publishing to the topic.default PolicyDocumentIAM policy document to apply to topic(s).The set of topics this policy applies to.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getTopics
The set of topics this policy applies to. -
getEnforceSSL
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.
Default: false
-
getPolicyDocument
IAM policy document to apply to topic(s).Default: empty policy document
-
builder
- Returns:
- a
TopicPolicyProps.BuilderofTopicPolicyProps
-