Enum PolicyEffect
- All Implemented Interfaces:
Serializable,Comparable<PolicyEffect>,java.lang.constant.Constable
@Generated(value="jsii-pacmak/1.139.0 (build 26a6b54)",
date="2026-09-10T17:51:40.357Z")
@Stability(Stable)
public enum PolicyEffect
extends Enum<PolicyEffect>
Effect of a policy statement, whether it permits or forbids the action.
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 java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic PolicyEffectReturns the enum constant of this type with the specified name.static PolicyEffect[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
PERMIT
Permit the action when the statement matches and its conditions hold.Multiple permit statements can apply, and any matching permit grants access.
-
FORBID
Forbid the action when the statement matches and its conditions hold.A forbid always takes precedence over any permit.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-