Class PolicyValidationMode

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.bedrockagentcore.PolicyValidationMode
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.139.0 (build 26a6b54)", date="2026-09-10T17:51:40.363Z") @Stability(Stable) public class PolicyValidationMode extends software.amazon.jsii.JsiiObject
Validation mode for Cedar policy definitions.

Example:

 PolicyEngine policyEngine;
 Gateway gateway;
 // Allow access unless the user is suspended
 Policy policyWithUnless = Policy.Builder.create(this, "UnlessPolicy")
         .policyEngine(policyEngine)
         .policyName("unless_suspended")
         .statement(PolicyStatement.Builder.create()
                 .effect(PolicyEffect.PERMIT)
                 .principal(PolicyPrincipal.entityType("AgentCore::OAuthUser"))
                 .action(PolicyAction.any())
                 .resource(PolicyResource.instance("AgentCore::Gateway", gateway.getGatewayArn()))
                 .unless(List.of(PolicyCondition.booleanEquals(PolicyAttribute.principal("suspended"), true)))
                 .build())
         .description("Allow all actions unless user is suspended")
         .validationMode(PolicyValidationMode.FAIL_ON_ANY_FINDINGS)
         .build();
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Fail policy creation if any validation findings are detected.
    Ignore all validation findings and create the policy anyway.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    PolicyValidationMode(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    PolicyValidationMode(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    The string value of the validation mode.
    of(String value)
    A validation mode that this version of the CDK does not model.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Field Details

    • FAIL_ON_ANY_FINDINGS

      @Stability(Stable) public static final PolicyValidationMode FAIL_ON_ANY_FINDINGS
      Fail policy creation if any validation findings are detected.

      This is the safer default - catches policy errors early.

    • IGNORE_ALL_FINDINGS

      @Stability(Stable) public static final PolicyValidationMode IGNORE_ALL_FINDINGS
      Ignore all validation findings and create the policy anyway.

      Use with caution - may result in runtime authorization errors.

  • Constructor Details

    • PolicyValidationMode

      protected PolicyValidationMode(software.amazon.jsii.JsiiObjectRef objRef)
    • PolicyValidationMode

      protected PolicyValidationMode(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • of

      @Stability(Stable) @NotNull public static PolicyValidationMode of(@NotNull String value)
      A validation mode that this version of the CDK does not model.

      Prefer the static members above. Use this when the service has added a mode that the CDK has no member for yet: the CloudFormation registry schemas that validate the synthesized template ship with aws-cdk-lib and refresh on release, while the members above are added by hand, so a released CDK can accept a mode before it models one.

      Parameters:
      value - the raw validation mode value to pass to CloudFormation. This parameter is required.
    • getValue

      @Stability(Stable) @NotNull public String getValue()
      The string value of the validation mode.