Class Policy.Builder

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

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

    • create

      @Stability(Stable) public static Policy.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of Policy.Builder.
    • policyEngine

      @Stability(Stable) public Policy.Builder policyEngine(IPolicyEngine policyEngine)
      The policy engine this policy belongs to.

      [disable-awslint:prefer-ref-interface]

      Parameters:
      policyEngine - The policy engine this policy belongs to. This parameter is required.
      Returns:
      this
    • statement

      @Stability(Stable) public Policy.Builder statement(PolicyStatement statement)
      The Cedar policy statement for this policy.

      Build a type-safe statement with the PolicyStatement factories, which validate at synthesis time and reject values that cannot be represented safely in Cedar.

      For raw Cedar (features this API does not model, or migrating an existing policy), use PolicyStatement.fromCedar('...'). That string is used exactly as given: the module does not escape, quote, or validate it, so it is treated as trusted input and you own its correctness and safety. Do not assemble it from values that come from outside your application, such as a request body or a database record.

      Parameters:
      statement - The Cedar policy statement for this policy. This parameter is required.
      Returns:
      this
    • description

      @Stability(Stable) public Policy.Builder description(String description)
      Optional description for the policy.

      Maximum length of 4096.

      Default: - No description

      Parameters:
      description - Optional description for the policy. This parameter is required.
      Returns:
      this
    • policyName

      @Stability(Stable) public Policy.Builder policyName(String policyName)
      The name of the policy.

      Valid characters: a-z, A-Z, 0-9, _ (underscore) Must start with a letter, 1-48 characters Pattern: ^[A-Za-z][A-Za-z0-9_]*$

      Default: - Auto-generated unique name

      Parameters:
      policyName - The name of the policy. This parameter is required.
      Returns:
      this
    • validationMode

      @Stability(Stable) public Policy.Builder validationMode(PolicyValidationMode validationMode)
      Validation mode for the policy.

      Controls how Cedar analyzer validation findings are handled.

      Default: PolicyValidationMode.FAIL_ON_ANY_FINDINGS

      Parameters:
      validationMode - Validation mode for the policy. This parameter is required.
      Returns:
      this
    • build

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