PolicyAttributes

class aws_cdk.aws_bedrockagentcore.PolicyAttributes(*, policy_arn, policy_engine)

Bases: object

Attributes for importing an existing Policy.

Parameters:
  • policy_arn (str) – The ARN of the policy.

  • policy_engine (IPolicyEngine) – The policy engine this policy belongs to [disable-awslint:prefer-ref-interface].

ExampleMetadata:

fixture=default infused

Example:

imported_engine = agentcore.PolicyEngine.from_policy_engine_attributes(self, "ImportedEngine",
    policy_engine_arn="policy-engine/my-engine-id"
)

imported_policy = agentcore.Policy.from_policy_attributes(self, "ImportedPolicy",
    policy_arn="my-policy-arn",
    policy_engine=imported_engine
)

# Grant permissions to the imported policy
role = iam.Role(self, "PolicyRole",
    assumed_by=iam.ServicePrincipal("lambda.amazonaws.com")
)

imported_policy.grant_read(role)

Attributes

policy_arn

The ARN of the policy.

policy_engine

prefer-ref-interface].

Type:

The policy engine this policy belongs to [disable-awslint