Class PolicyStatement.Builder

java.lang.Object
software.amazon.awscdk.services.bedrockagentcore.PolicyStatement.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<PolicyStatement>
Enclosing class:
PolicyStatement

@Stability(Stable) public static final class PolicyStatement.Builder extends Object implements software.amazon.jsii.Builder<PolicyStatement>
A fluent builder for PolicyStatement.
  • Method Details

    • create

      @Stability(Stable) public static PolicyStatement.Builder create()
      Returns:
      a new instance of PolicyStatement.Builder.
    • action

      @Stability(Stable) public PolicyStatement.Builder action(PolicyAction action)
      The action the statement applies to.

      Parameters:
      action - The action the statement applies to. This parameter is required.
      Returns:
      this
    • effect

      @Stability(Stable) public PolicyStatement.Builder effect(PolicyEffect effect)
      Whether the statement permits or forbids the action.

      Parameters:
      effect - Whether the statement permits or forbids the action. This parameter is required.
      Returns:
      this
    • principal

      @Stability(Stable) public PolicyStatement.Builder principal(PolicyPrincipal principal)
      The principal the statement applies to.

      Parameters:
      principal - The principal the statement applies to. This parameter is required.
      Returns:
      this
    • resource

      @Stability(Stable) public PolicyStatement.Builder resource(PolicyResource resource)
      The resource the statement applies to.

      Parameters:
      resource - The resource the statement applies to. This parameter is required.
      Returns:
      this
    • unless

      @Stability(Stable) public PolicyStatement.Builder unless(List<? extends PolicyCondition> unless)
      Conditions that must not hold for the statement to apply.

      Default: - no exclusions

      Parameters:
      unless - Conditions that must not hold for the statement to apply. This parameter is required.
      Returns:
      this
    • when

      @Stability(Stable) public PolicyStatement.Builder when(List<? extends PolicyCondition> when)
      Conditions that must all hold for the statement to apply.

      Use PolicyCondition.anyOf() for a member that only needs one of several conditions to hold.

      Default: - the statement applies whenever its principal, action and resource match

      Parameters:
      when - Conditions that must all hold for the statement to apply. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public PolicyStatement build()
      Specified by:
      build in interface software.amazon.jsii.Builder<PolicyStatement>
      Returns:
      a newly built instance of PolicyStatement.