Interface PolicyStatementProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
PolicyStatementProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.139.0 (build 26a6b54)",
date="2026-09-10T17:51:40.363Z")
@Stability(Stable)
public interface PolicyStatementProps
extends software.amazon.jsii.JsiiSerializable
Properties for a policy statement.
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 ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forPolicyStatementPropsstatic final classAn implementation forPolicyStatementProps -
Method Summary
Modifier and TypeMethodDescriptionstatic PolicyStatementProps.Builderbuilder()The action the statement applies to.Whether the statement permits or forbids the action.The principal the statement applies to.The resource the statement applies to.default List<PolicyCondition> Conditions that must not hold for the statement to apply.default List<PolicyCondition> getWhen()Conditions that must all hold for the statement to apply.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAction
The action the statement applies to. -
getEffect
Whether the statement permits or forbids the action. -
getPrincipal
The principal the statement applies to. -
getResource
The resource the statement applies to. -
getUnless
Conditions that must not hold for the statement to apply.Default: - no exclusions
-
getWhen
Conditions that must all hold for the statement to apply.Use
PolicyCondition.anyOf()for a member that only needs one of several conditions to hold.Default: - the statement applies whenever its principal, action and resource match
-
builder
- Returns:
- a
PolicyStatementProps.BuilderofPolicyStatementProps
-