-
Notifications
You must be signed in to change notification settings - Fork 4.5k
bedrock-agentcore: execution role policy for runtime lacks permissions to invoke bedrock models #35853
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-iamRelated to AWS Identity and Access ManagementRelated to AWS Identity and Access ManagementbugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp2
Description
Describe the bug
The permissions for the execution role lacks permissions in Runtime construct.
The official document says that runtime execution role requires permissions to invoke bedrock models:
{
"Sid": "BedrockModelInvocation",
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream"
],
"Resource": [
"arn:aws:bedrock:*::foundation-model/*",
"arn:aws:bedrock:us-east-1:123456789012:*"
]
}
However, current code in the construct couldn't add the permissions:
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Library Version
No response
Expected Behavior
The "BedrockModelInvocation" permission is attached.
Current Behavior
The "BedrockModelInvocation" permission is not attached.
Reproduction Steps
Deploy the following CDK code:
const app = new cdk.App();
const stack = new cdk.Stack(app, 'stack');
const runtimeArtifact = agentcore.AgentRuntimeArtifact.fromAsset(
path.join(__dirname, 'testArtifact'),
);
const runtime = new agentcore.Runtime(stack, 'Runtime', {
runtimeName: 'integ_test_runtime',
agentRuntimeArtifact: runtimeArtifact,
});And then you can see the permissions in the console or cdk.out.
Possible Solution
Add the permissions including bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream actions.
Additional Information/Context
No response
AWS CDK Library version (aws-cdk-lib)
v2.221.0
AWS CDK CLI version
2.1030.0
Node.js Version
v22.14.0
OS
Mac
Language
TypeScript
Language Version
No response
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-iamRelated to AWS Identity and Access ManagementRelated to AWS Identity and Access ManagementbugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp2