Class PolicyDocumentProps.Builder
java.lang.Object
software.amazon.awscdk.services.iam.PolicyDocumentProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<PolicyDocumentProps>
- Enclosing interface:
PolicyDocumentProps
@Stability(Stable)
public static final class PolicyDocumentProps.Builder
extends Object
implements software.amazon.jsii.Builder<PolicyDocumentProps>
A builder for
PolicyDocumentProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionassignSids
(Boolean assignSids) Sets the value ofPolicyDocumentProps.getAssignSids()
build()
Builds the configured instance.Sets the value ofPolicyDocumentProps.getMinimize()
statements
(List<? extends PolicyStatement> statements) Sets the value ofPolicyDocumentProps.getStatements()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
assignSids
Sets the value ofPolicyDocumentProps.getAssignSids()
- Parameters:
assignSids
- Automatically assign Statement Ids to all statements.- Returns:
this
-
minimize
Sets the value ofPolicyDocumentProps.getMinimize()
- Parameters:
minimize
- 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.
- Returns:
this
-
statements
@Stability(Stable) public PolicyDocumentProps.Builder statements(List<? extends PolicyStatement> statements) Sets the value ofPolicyDocumentProps.getStatements()
- Parameters:
statements
- Initial statements to add to the policy document.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<PolicyDocumentProps>
- Returns:
- a new instance of
PolicyDocumentProps
- Throws:
NullPointerException
- if any required attribute was not provided
-