Describe the bug
ECR permissions are attached even when the role is a custom role (or an imported role). (https://github.com/aws/aws-cdk/blob/v2.221.0/packages/%40aws-cdk/aws-bedrock-agentcore-alpha/agentcore/runtime/runtime-artifact.ts#L65)
However, the other required permissions are only granted to a policy for an auto-generated role. (https://github.com/aws/aws-cdk/blob/v2.221.0/packages/%40aws-cdk/aws-bedrock-agentcore-alpha/agentcore/runtime/runtime.ts#L252-L259)
In constructs of other common modules, permissions are attached even when a custom role is passed.
So we need to add the permissions to the custom role.
FYI: If you avoid to add the permissions to the custom role, you can use withoutPolicyUpdates() method for Role.
Regression Issue
Last Known Working CDK Library Version
No response
Expected Behavior
The same permissions are attached to the custom role as to the auto-generated role.
Current Behavior
Permissions other than ECR are not granted to the custom role.
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 role = new iam.Role(stack, 'ExecutionRole', {
assumedBy: new iam.ServicePrincipal('bedrock-agentcore.amazonaws.com'),
});
const runtime = new agentcore.Runtime(stack, 'Runtime', {
runtimeName: 'integ_test_runtime',
agentRuntimeArtifact: runtimeArtifact,
executionRole: role,
});
And then you can see the permissions in the console or cdk.out.
FYI: correct permissions: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-permissions.html#runtime-permissions-execution
Possible Solution
Add the same permissions to the custom role.
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
Describe the bug
ECR permissions are attached even when the role is a custom role (or an imported role). (https://github.com/aws/aws-cdk/blob/v2.221.0/packages/%40aws-cdk/aws-bedrock-agentcore-alpha/agentcore/runtime/runtime-artifact.ts#L65)
However, the other required permissions are only granted to a policy for an auto-generated role. (https://github.com/aws/aws-cdk/blob/v2.221.0/packages/%40aws-cdk/aws-bedrock-agentcore-alpha/agentcore/runtime/runtime.ts#L252-L259)
In constructs of other common modules, permissions are attached even when a custom role is passed.
So we need to add the permissions to the custom role.
FYI: If you avoid to add the permissions to the custom role, you can use
withoutPolicyUpdates()method for Role.Regression Issue
Last Known Working CDK Library Version
No response
Expected Behavior
The same permissions are attached to the custom role as to the auto-generated role.
Current Behavior
Permissions other than ECR are not granted to the custom role.
Reproduction Steps
Deploy the following CDK code:
And then you can see the permissions in the console or cdk.out.
FYI: correct permissions: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-permissions.html#runtime-permissions-execution
Possible Solution
Add the same permissions to the custom role.
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