Class PolicyEngineBase
- All Implemented Interfaces:
IPolicyEngineRef,IEnvironmentAware,IResource,IPolicyEngine,IGrantable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
- Direct Known Subclasses:
PolicyEngine
Contains methods and attributes valid for PolicyEngines either created with CDK or imported.
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.bedrockagentcore.IPolicyEngine
IPolicyEngine.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPolicyEngineBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedPolicyEngineBase(software.amazon.jsii.JsiiObjectRef objRef) protectedPolicyEngineBase(software.constructs.Construct scope, String id) protectedPolicyEngineBase(software.constructs.Construct scope, String id, ResourceProps props) -
Method Summary
Modifier and TypeMethodDescriptionabstract StringThe description of the policy engine.abstract IPrincipalThe principal to grant permissions to.abstract IKeyThe KMS key used for encryption.abstract StringThe ARN of the policy engine resource.abstract StringThe ID of the policy engine.abstract StringThe name of the policy engine.A reference to this PolicyEngine resource.grant(IGrantable grantee, String... actions) Grants IAM actions to the IAM Principal.grantEvaluate(IGrantable grantee) Grants permissions to evaluate policies at runtime (data plane operations).grantEvaluateForGateway(IGrantable grantee, IGateway gateway) Grants the full set of permissions required for a gateway execution role to use this policy engine, correctly scoped to both the policy engine and gateway ARNs.grantRead(IGrantable grantee) Grants read permissions on the PolicyEngine (data plane).Return the given named metric for this policy engine.metric(String metricName, MetricOptions props) Return the given named metric for this policy engine.Return a metric measuring the authorization latency for this policy engine.Return a metric measuring the authorization latency for this policy engine.Return a metric containing the total number of authorizations for this policy engine.Return a metric containing the total number of authorizations for this policy engine.Return a metric containing the number of denied authorization requests for this policy engine.Return a metric containing the number of denied authorization requests for this policy engine.Return a metric containing the number of errors during authorization for this policy engine.metricErrors(MetricOptions props) Return a metric containing the number of errors during authorization for this policy engine.Methods inherited from class software.amazon.awscdk.Resource
applyCrossStackReferenceStrength, applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource, withMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods 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, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNode, withMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
PolicyEngineBase
protected PolicyEngineBase(software.amazon.jsii.JsiiObjectRef objRef) -
PolicyEngineBase
protected PolicyEngineBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
PolicyEngineBase
@Stability(Stable) protected PolicyEngineBase(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable ResourceProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
PolicyEngineBase
@Stability(Stable) protected PolicyEngineBase(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Details
-
grant
@Stability(Stable) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull String... actions) Grants IAM actions to the IAM Principal.[disable-awslint:no-grants]
- Specified by:
grantin interfaceIPolicyEngine- Parameters:
grantee-- The IAM principal to grant permissions to.
actions-- The actions to grant.
- Returns:
- An IAM Grant object representing the granted permissions
-
grantEvaluate
Grants permissions to evaluate policies at runtime (data plane operations).This is the primary permission needed by Gateway execution roles to evaluate authorization decisions during agent requests. Grant this to roles that need to call AuthorizeAction or PartiallyAuthorizeActions at runtime.
[disable-awslint:no-grants]
- Specified by:
grantEvaluatein interfaceIPolicyEngine- Parameters:
grantee-- The IAM principal to grant evaluation permissions to.
- Returns:
- An IAM Grant object representing the granted permissions
-
grantEvaluateForGateway
@Stability(Stable) @NotNull public Grant grantEvaluateForGateway(@NotNull IGrantable grantee, @NotNull IGateway gateway) Grants the full set of permissions required for a gateway execution role to use this policy engine, correctly scoped to both the policy engine and gateway ARNs.Per the AWS docs:
GetPolicyEngine→ policy engine ARN onlyAuthorizeAction+PartiallyAuthorizeActions→ policy engine ARN and gateway ARN
[disable-awslint:no-grants]
- Specified by:
grantEvaluateForGatewayin interfaceIPolicyEngine- Parameters:
grantee-- The IAM principal (gateway execution role) to grant permissions to.
gateway-- The gateway that will use this policy engine [disable-awslint:prefer-ref-interface].
- Returns:
- A combined IAM Grant representing all granted permissions
-
grantRead
Grants read permissions on the PolicyEngine (data plane).This grants runtime read access to policy engine configuration. Use this for monitoring, observability, or read-only administrative roles that need to inspect policy engine settings at runtime.
[disable-awslint:no-grants]
- Specified by:
grantReadin interfaceIPolicyEngine- Parameters:
grantee-- The IAM principal to grant read permissions to.
- Returns:
- An IAM Grant object representing the granted permissions
-
metric
@Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props) Return the given named metric for this policy engine.By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the
statisticandperiodproperties.- Specified by:
metricin interfaceIPolicyEngine- Parameters:
metricName- The name of the metric. This parameter is required.props- Optional metric configuration.
-
metric
Return the given named metric for this policy engine.By default, the metric will be calculated as a sum over a period of 5 minutes. You can customize this by using the
statisticandperiodproperties.- Specified by:
metricin interfaceIPolicyEngine- Parameters:
metricName- The name of the metric. This parameter is required.
-
metricAuthorizationLatency
Return a metric measuring the authorization latency for this policy engine.This metric represents the time taken to evaluate authorization policies.
- Specified by:
metricAuthorizationLatencyin interfaceIPolicyEngine- Parameters:
props- Optional metric configuration.
-
metricAuthorizationLatency
Return a metric measuring the authorization latency for this policy engine.This metric represents the time taken to evaluate authorization policies.
- Specified by:
metricAuthorizationLatencyin interfaceIPolicyEngine
-
metricAuthorizations
Return a metric containing the total number of authorizations for this policy engine.This metric tracks all authorization requests processed by the policy engine.
- Parameters:
props- Optional metric configuration.
-
metricAuthorizations
Return a metric containing the total number of authorizations for this policy engine.This metric tracks all authorization requests processed by the policy engine.
-
metricDeniedRequests
Return a metric containing the number of denied authorization requests for this policy engine.This metric tracks authorization requests that were explicitly denied by policies.
- Specified by:
metricDeniedRequestsin interfaceIPolicyEngine- Parameters:
props- Optional metric configuration.
-
metricDeniedRequests
Return a metric containing the number of denied authorization requests for this policy engine.This metric tracks authorization requests that were explicitly denied by policies.
- Specified by:
metricDeniedRequestsin interfaceIPolicyEngine
-
metricErrors
Return a metric containing the number of errors during authorization for this policy engine.This metric tracks errors encountered during policy evaluation.
- Specified by:
metricErrorsin interfaceIPolicyEngine- Parameters:
props- Optional metric configuration.
-
metricErrors
Return a metric containing the number of errors during authorization for this policy engine.This metric tracks errors encountered during policy evaluation.
- Specified by:
metricErrorsin interfaceIPolicyEngine
-
getGrantPrincipal
The principal to grant permissions to.- Specified by:
getGrantPrincipalin interfaceIGrantable
-
getPolicyEngineArn
The ARN of the policy engine resource.- Specified by:
getPolicyEngineArnin interfaceIPolicyEngine
-
getPolicyEngineId
The ID of the policy engine.- Specified by:
getPolicyEngineIdin interfaceIPolicyEngine
-
getPolicyEngineName
The name of the policy engine.- Specified by:
getPolicyEngineNamein interfaceIPolicyEngine
-
getPolicyEngineRef
A reference to this PolicyEngine resource.- Specified by:
getPolicyEngineRefin interfaceIPolicyEngineRef
-
getDescription
The description of the policy engine.- Specified by:
getDescriptionin interfaceIPolicyEngine
-
getKmsKey
The KMS key used for encryption.- Specified by:
getKmsKeyin interfaceIPolicyEngine
-