interface IPolicy
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.IPolicy |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#IPolicy |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.IPolicy |
Python | aws_cdk.aws_bedrock_agentcore_alpha.IPolicy |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป IPolicy |
Implements
IDependable, IConstruct, IEnvironment, IResource, IPolicy, IGrantable
Implemented by
Policy
Obtainable from
Policy.fromPolicyAttributes()
Minimal reference interface for Policy resources.
Used for resource identification and ARN construction.
Properties
| Name | Type | Description |
|---|---|---|
| env | Resource | The environment this resource belongs to. |
| grant | IPrincipal | The principal to grant permissions to. |
| node | Node | The tree node. |
| policy | string | The ARN of the policy resource. |
| policy | IPolicy | The policy engine this policy belongs to. |
| policy | string | The ID of the policy. |
| policy | string | The name of the policy. |
| policy | Policy | A reference to a Policy resource. |
| stack | Stack | The stack in which this resource is defined. |
| description? | string | The description of the policy. |
| validation | Policy | The validation mode for the policy. |
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
grantPrincipal
Type:
IPrincipal
The principal to grant permissions to.
node
Type:
Node
The tree node.
policyArn
Type:
string
The ARN of the policy resource.
policyEngine
Type:
IPolicy
The policy engine this policy belongs to.
policyId
Type:
string
The ID of the policy.
policyName
Type:
string
The name of the policy.
policyRef
Type:
Policy
A reference to a Policy resource.
stack
Type:
Stack
The stack in which this resource is defined.
description?
Type:
string
(optional)
The description of the policy.
validationMode?
Type:
Policy
(optional)
The validation mode for the policy.
Methods
| Name | Description |
|---|---|
| apply | Apply the given removal policy to this resource. |
| grant(grantee, ...actions) | Grants IAM actions to the IAM Principal. |
| grant | Grants read permissions on the Policy (data plane). |
| metric(metricName, dimensions, props?) | Return the given named metric for this policy. |
| metric | Return a metric measuring the evaluation latency for this policy. |
| metric | Return a metric containing the total number of evaluations for this policy. |
| with(...mixins) | Applies one or more mixins to this construct. |
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
RemovalPolicy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
grant(grantee, ...actions)
public grant(grantee: IGrantable, ...actions: string[]): Grant
Parameters
- grantee
IGrantableโ - The IAM principal to grant permissions to. - actions
stringโ - The actions to grant.
Returns
Grants IAM actions to the IAM Principal.
grantRead(grantee)
public grantRead(grantee: IGrantable): Grant
Parameters
- grantee
IGrantableโ - The IAM principal to grant read permissions to.
Returns
Grants read permissions on the Policy (data plane).
This grants runtime read access to policy configuration. Use this for monitoring, audit, or read-only administrative roles that need to inspect policy definitions.
metric(metricName, dimensions, props?)
public metric(metricName: string, dimensions: { [string]: string }, props?: MetricOptions): Metric
Parameters
- metricName
stringโ The name of the metric. - dimensions
{ [string]: string }โ Additional dimensions for the metric. - props
Metricโ Optional metric configuration.Options
Returns
Return the given named metric for this policy.
metricEvaluationLatency(props?)
public metricEvaluationLatency(props?: MetricOptions): Metric
Parameters
- props
Metricโ Optional metric configuration.Options
Returns
Return a metric measuring the evaluation latency for this policy.
This metric represents the time taken to evaluate this specific policy.
metricEvaluations(props?)
public metricEvaluations(props?: MetricOptions): Metric
Parameters
- props
Metricโ Optional metric configuration.Options
Returns
Return a metric containing the total number of evaluations for this policy.
This metric tracks how many times this policy has been evaluated.
with(...mixins)
public with(...mixins: IMixin[]): IConstruct
Parameters
- mixins
IMixinโ The mixins to apply.
Returns
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.

.NET
Go
Java
Python
TypeScript (