class PolicyPrincipal
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.BedrockAgentCore.PolicyPrincipal |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsbedrockagentcore#PolicyPrincipal |
Java | software.amazon.awscdk.services.bedrockagentcore.PolicyPrincipal |
Python | aws_cdk.aws_bedrockagentcore.PolicyPrincipal |
TypeScript (source) | aws-cdk-lib » aws_bedrockagentcore » PolicyPrincipal |
The principal a policy statement applies to.
Example
import { PolicyPrincipal } from 'aws-cdk-lib/aws-bedrockagentcore';
PolicyPrincipal.any(); // principal
PolicyPrincipal.entityType('AgentCore::OAuthUser'); // principal is AgentCore::OAuthUser
PolicyPrincipal.entity('AgentCore::OAuthUser', 'user123'); // principal == AgentCore::OAuthUser::"user123"
PolicyPrincipal.inGroup('AgentCore::OAuthGroup', 'admins'); // principal in AgentCore::OAuthGroup::"admins"
Methods
| Name | Description |
|---|---|
| static any() | Any principal, whoever the caller is. |
| static entity(entityType, entityId) | One specific principal. |
| static entity | Any principal of the given entity type. |
| static in | Any principal that is a member of the given group. |
static any()
public static any(): PolicyPrincipal
Returns
Any principal, whoever the caller is.
static entity(entityType, entityId)
public static entity(entityType: string, entityId: string): PolicyPrincipal
Parameters
- entityType
string— - The entity type, for example 'AgentCore::OAuthUser'. - entityId
string— - The entity identifier.
Returns
One specific principal.
static entityType(entityType)
public static entityType(entityType: string): PolicyPrincipal
Parameters
- entityType
string— - The entity type, for example 'AgentCore::OAuthUser'.
Returns
Any principal of the given entity type.
static inGroup(groupType, groupId)
public static inGroup(groupType: string, groupId: string): PolicyPrincipal
Parameters
- groupType
string— - The group entity type, for example 'AgentCore::OAuthGroup'. - groupId
string— - The group identifier.
Returns
Any principal that is a member of the given group.

.NET
Go
Java
Python
TypeScript (