class PolicyResource
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.BedrockAgentCore.PolicyResource |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsbedrockagentcore#PolicyResource |
Java | software.amazon.awscdk.services.bedrockagentcore.PolicyResource |
Python | aws_cdk.aws_bedrockagentcore.PolicyResource |
TypeScript (source) | aws-cdk-lib » aws_bedrockagentcore » PolicyResource |
The resource a policy statement applies to.
AgentCore rejects a policy whose resource is an unconstrained wildcard, so a statement must name either a resource type or a specific resource.
Example
import { PolicyResource } from 'aws-cdk-lib/aws-bedrockagentcore';
declare const gatewayArn: string;
PolicyResource.anyOfType('AgentCore::Gateway'); // resource is AgentCore::Gateway
PolicyResource.instance('AgentCore::Gateway', gatewayArn); // resource == AgentCore::Gateway::"<arn>"
Methods
| Name | Description |
|---|---|
| static any | Any resource of the given entity type. |
| static instance(entityType, entityArn) | One specific resource. |
static anyOfType(entityType)
public static anyOfType(entityType: string): PolicyResource
Parameters
- entityType
string— - The entity type, for example 'AgentCore::Gateway'.
Returns
Any resource of the given entity type.
static instance(entityType, entityArn)
public static instance(entityType: string, entityArn: string): PolicyResource
Parameters
- entityType
string— - The entity type, for example 'AgentCore::Gateway'. - entityArn
string— - The resource ARN or identifier.
Returns
One specific resource.
AgentCore requires a specific resource when the statement names specific actions rather than any action.

.NET
Go
Java
Python
TypeScript (