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 Details

    • Builder

      public Builder()
  • Method Details

    • assignSids

      @Stability(Stable) public PolicyDocumentProps.Builder assignSids(Boolean assignSids)
      Parameters:
      assignSids - Automatically assign Statement Ids to all statements.
      Returns:
      this
    • minimize

      @Stability(Stable) public PolicyDocumentProps.Builder minimize(Boolean minimize)
      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)
      Parameters:
      statements - Initial statements to add to the policy document.
      Returns:
      this
    • build

      @Stability(Stable) public PolicyDocumentProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<PolicyDocumentProps>
      Returns:
      a new instance of PolicyDocumentProps
      Throws:
      NullPointerException - if any required attribute was not provided