Interface PolicyDocumentProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
PolicyDocumentProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2025-01-04T09:06:23.592Z")
@Stability(Stable)
public interface PolicyDocumentProps
extends software.amazon.jsii.JsiiSerializable
Properties for a new PolicyDocument.
Example:
import software.amazon.awscdk.services.iam.*; PolicyDocument myFileSystemPolicy = PolicyDocument.Builder.create() .statements(List.of(PolicyStatement.Builder.create() .actions(List.of("elasticfilesystem:ClientWrite", "elasticfilesystem:ClientMount")) .principals(List.of(new AccountRootPrincipal())) .resources(List.of("*")) .conditions(Map.of( "Bool", Map.of( "elasticfilesystem:AccessedViaMountTarget", "true"))) .build())) .build(); FileSystem fileSystem = FileSystem.Builder.create(this, "MyEfsFileSystem") .vpc(new Vpc(this, "VPC")) .fileSystemPolicy(myFileSystemPolicy) .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forPolicyDocumentProps
static final class
An implementation forPolicyDocumentProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic PolicyDocumentProps.Builder
builder()
default Boolean
Automatically assign Statement Ids to all statements.default Boolean
Try 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.Builder
ofPolicyDocumentProps
-