Interface CreatePolicyRequest.Builder

  • Method Details

    • name

      The customer-assigned immutable name for the policy. Must be unique within the account. This name is used for policy identification and cannot be changed after creation.

      Parameters:
      name - The customer-assigned immutable name for the policy. Must be unique within the account. This name is used for policy identification and cannot be changed after creation.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • definition

      The Cedar policy statement that defines the access control rules. This contains the actual policy logic written in Cedar policy language, specifying effect (permit or forbid), principals, actions, resources, and conditions for agent behavior control.

      Parameters:
      definition - The Cedar policy statement that defines the access control rules. This contains the actual policy logic written in Cedar policy language, specifying effect (permit or forbid), principals, actions, resources, and conditions for agent behavior control.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • definition

      The Cedar policy statement that defines the access control rules. This contains the actual policy logic written in Cedar policy language, specifying effect (permit or forbid), principals, actions, resources, and conditions for agent behavior control.

      This is a convenience method that creates an instance of the PolicyDefinition.Builder avoiding the need to create one manually via PolicyDefinition.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to definition(PolicyDefinition).

      Parameters:
      definition - a consumer that will call methods on PolicyDefinition.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • description

      CreatePolicyRequest.Builder description(String description)

      A human-readable description of the policy's purpose and functionality (1-4,096 characters). This helps policy administrators understand the policy's intent, business rules, and operational scope. Use this field to document why the policy exists, what business requirement it addresses, and any special considerations for maintenance. Clear descriptions are essential for policy governance, auditing, and troubleshooting.

      Parameters:
      description - A human-readable description of the policy's purpose and functionality (1-4,096 characters). This helps policy administrators understand the policy's intent, business rules, and operational scope. Use this field to document why the policy exists, what business requirement it addresses, and any special considerations for maintenance. Clear descriptions are essential for policy governance, auditing, and troubleshooting.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • validationMode

      CreatePolicyRequest.Builder validationMode(String validationMode)

      The validation mode for the policy creation. Determines how Cedar analyzer validation results are handled during policy creation. FAIL_ON_ANY_FINDINGS (default) runs the Cedar analyzer to validate the policy against the Cedar schema and tool context, failing creation if the analyzer detects any validation issues to ensure strict conformance. IGNORE_ALL_FINDINGS runs the Cedar analyzer but allows policy creation even if validation issues are detected, useful for testing or when the policy schema is evolving. Use FAIL_ON_ANY_FINDINGS for production policies to ensure correctness, and IGNORE_ALL_FINDINGS only when you understand and accept the analyzer findings.

      Parameters:
      validationMode - The validation mode for the policy creation. Determines how Cedar analyzer validation results are handled during policy creation. FAIL_ON_ANY_FINDINGS (default) runs the Cedar analyzer to validate the policy against the Cedar schema and tool context, failing creation if the analyzer detects any validation issues to ensure strict conformance. IGNORE_ALL_FINDINGS runs the Cedar analyzer but allows policy creation even if validation issues are detected, useful for testing or when the policy schema is evolving. Use FAIL_ON_ANY_FINDINGS for production policies to ensure correctness, and IGNORE_ALL_FINDINGS only when you understand and accept the analyzer findings.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • validationMode

      CreatePolicyRequest.Builder validationMode(PolicyValidationMode validationMode)

      The validation mode for the policy creation. Determines how Cedar analyzer validation results are handled during policy creation. FAIL_ON_ANY_FINDINGS (default) runs the Cedar analyzer to validate the policy against the Cedar schema and tool context, failing creation if the analyzer detects any validation issues to ensure strict conformance. IGNORE_ALL_FINDINGS runs the Cedar analyzer but allows policy creation even if validation issues are detected, useful for testing or when the policy schema is evolving. Use FAIL_ON_ANY_FINDINGS for production policies to ensure correctness, and IGNORE_ALL_FINDINGS only when you understand and accept the analyzer findings.

      Parameters:
      validationMode - The validation mode for the policy creation. Determines how Cedar analyzer validation results are handled during policy creation. FAIL_ON_ANY_FINDINGS (default) runs the Cedar analyzer to validate the policy against the Cedar schema and tool context, failing creation if the analyzer detects any validation issues to ensure strict conformance. IGNORE_ALL_FINDINGS runs the Cedar analyzer but allows policy creation even if validation issues are detected, useful for testing or when the policy schema is evolving. Use FAIL_ON_ANY_FINDINGS for production policies to ensure correctness, and IGNORE_ALL_FINDINGS only when you understand and accept the analyzer findings.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • policyEngineId

      CreatePolicyRequest.Builder policyEngineId(String policyEngineId)

      The identifier of the policy engine which contains this policy. Policy engines group related policies and provide the execution context for policy evaluation.

      Parameters:
      policyEngineId - The identifier of the policy engine which contains this policy. Policy engines group related policies and provide the execution context for policy evaluation.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • clientToken

      CreatePolicyRequest.Builder clientToken(String clientToken)

      A unique, case-sensitive identifier to ensure the idempotency of the request. The AWS SDK automatically generates this token, so you don't need to provide it in most cases. If you retry a request with the same client token, the service returns the same response without creating a duplicate policy.

      Parameters:
      clientToken - A unique, case-sensitive identifier to ensure the idempotency of the request. The AWS SDK automatically generates this token, so you don't need to provide it in most cases. If you retry a request with the same client token, the service returns the same response without creating a duplicate policy.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • overrideConfiguration

      CreatePolicyRequest.Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration)
      Description copied from interface: AwsRequest.Builder
      Add an optional request override configuration.
      Specified by:
      overrideConfiguration in interface AwsRequest.Builder
      Parameters:
      overrideConfiguration - The override configuration.
      Returns:
      This object for method chaining.
    • overrideConfiguration

      Description copied from interface: AwsRequest.Builder
      Add an optional request override configuration.
      Specified by:
      overrideConfiguration in interface AwsRequest.Builder
      Parameters:
      builderConsumer - A Consumer to which an empty AwsRequestOverrideConfiguration.Builder will be given.
      Returns:
      This object for method chaining.