Interface PolicyDocumentProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
PolicyDocumentProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-20T23:37:23.007Z")
@Stability(Stable)
public interface PolicyDocumentProps
extends software.amazon.jsii.JsiiSerializable
Properties for a new PolicyDocument.
Example:
Topic topic = new Topic(this, "Topic");
PolicyDocument policyDocument = PolicyDocument.Builder.create()
.assignSids(true)
.statements(List.of(
PolicyStatement.Builder.create()
.actions(List.of("sns:Publish"))
.principals(List.of(new ServicePrincipal("s3.amazonaws.com")))
.resources(List.of(topic.getTopicArn()))
.build()))
.build();
TopicPolicy topicPolicy = TopicPolicy.Builder.create(this, "Policy")
.topics(List.of(topic))
.policyDocument(policyDocument)
.enforceSSL(true)
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forPolicyDocumentPropsstatic final classAn implementation forPolicyDocumentProps -
Method Summary
Modifier and TypeMethodDescriptionstatic PolicyDocumentProps.Builderbuilder()default BooleanAutomatically assign Statement Ids to all statements.default BooleanTry to minimize the policy by merging statements.default List<PolicyStatement> Initial statements to add to the policy document.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAssignSids
Automatically assign Statement Ids to all statements.Default: false
-
getMinimize
Try to minimize the policy by merging statements.To avoid overrunning the maximum policy size, combine statements if they produce the same result. Merging happens according to the following rules:
- The Effect of both statements is the same
- Neither of the statements have a 'Sid'
- Combine Principals if the rest of the statement is exactly the same.
- Combine Resources if the rest of the statement is exactly the same.
- Combine Actions if the rest of the statement is exactly the same.
- We will never combine NotPrincipals, NotResources or NotActions, because doing so would change the meaning of the policy document.
Default: - false, unless the feature flag `@aws-cdk/aws-iam:minimizePolicies` is set
-
getStatements
Initial statements to add to the policy document.Default: - No statements
-
builder
- Returns:
- a
PolicyDocumentProps.BuilderofPolicyDocumentProps
-