@Generated(value="jsii-pacmak/1.70.0 (build 03c2f6f)", date="2022-11-01T13:16:50.135Z") @Stability(value=Experimental) public interface PolicyDocumentProps extends software.amazon.jsii.JsiiSerializable
Example:
IRole myTrustedAdminRole = Role.fromRoleArn(this, "TrustedRole", "arn:aws:iam:....");
// Creates a limited admin policy and assigns to the account root.
PolicyDocument myCustomPolicy = PolicyDocument.Builder.create()
.statements(List.of(PolicyStatement.Builder.create()
.actions(List.of("kms:Create*", "kms:Describe*", "kms:Enable*", "kms:List*", "kms:Put*"))
.principals(List.of(new AccountRootPrincipal()))
.resources(List.of("*"))
.build()))
.build();
Key key = Key.Builder.create(this, "MyKey")
.policy(myCustomPolicy)
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
PolicyDocumentProps.Builder
A builder for
PolicyDocumentProps |
static class |
PolicyDocumentProps.Jsii$Proxy
An implementation for
PolicyDocumentProps |
| Modifier and Type | Method and Description |
|---|---|
static PolicyDocumentProps.Builder |
builder() |
default Boolean |
getAssignSids()
(experimental) Automatically assign Statement Ids to all statements.
|
default Boolean |
getMinimize()
(experimental) Try to minimize the policy by merging statements.
|
default List<PolicyStatement> |
getStatements()
(experimental) Initial statements to add to the policy document.
|
@Stability(value=Experimental) @Nullable default Boolean getAssignSids()
Default: false
@Stability(value=Experimental) @Nullable default Boolean getMinimize()
To avoid overrunning the maximum policy size, combine statements if they produce the same result. Merging happens according to the following rules:
Default: - false, unless the feature flag `@aws-cdk/aws-iam:minimizePolicies` is set
@Stability(value=Experimental) @Nullable default List<PolicyStatement> getStatements()
Default: - No statements
@Stability(value=Experimental) static PolicyDocumentProps.Builder builder()
PolicyDocumentProps.Builder of PolicyDocumentPropsCopyright © 2022. All rights reserved.