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
FieldsModifier and TypeFieldDescriptionstatic final PolicyValidationModeFail policy creation if any validation findings are detected.static final PolicyValidationModeIgnore all validation findings and create the policy anyway. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPolicyValidationMode(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedPolicyValidationMode(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptiongetValue()The string value of the validation mode.static PolicyValidationModeA 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, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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
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
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-liband 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
The string value of the validation mode.
-