Interface TopicPolicyProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
TopicPolicyProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-25T14:21:24.051Z") @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();
 
  • Method Details

    • getTopics

      @Stability(Stable) @NotNull List<ITopic> getTopics()
      The set of topics this policy applies to.
    • getEnforceSSL

      @Stability(Stable) @Nullable default Boolean 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

      @Stability(Stable) @Nullable default PolicyDocument getPolicyDocument()
      IAM policy document to apply to topic(s).

      Default: empty policy document

    • builder

      @Stability(Stable) static TopicPolicyProps.Builder builder()
      Returns:
      a TopicPolicyProps.Builder of TopicPolicyProps