Skip to content

Commit d571928

Browse files
committed
fix: Add missing IAM permission for AgentCore service-linked role creation
- Add iam:CreateServiceLinkedRole permission to Custom Resource role - Required for AWSServiceRoleForBedrockAgentCoreRuntimeIdentity creation - Fixes deployment failure since October 13, 2025 AgentCore Runtime changes - Resolves AccessDeniedException when creating AgentCore Runtime Fixes issue where GenU deployment fails with: 'Failed creating service linked role. Please verify that the calling role has sufficient permissions to create a service linked role.' Reference: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/service-linked-roles.html According to AWS documentation, starting October 13, 2025, new AgentCore Runtime resources automatically require the AWSServiceRoleForBedrockAgentCoreRuntimeIdentity service-linked role.
1 parent e75085c commit d571928

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/cdk/lib/construct/generic-agent-core.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,23 @@ export class GenericAgentCore extends Construct {
185185
})
186186
);
187187

188+
// Add permission to create AgentCore service-linked role (required since Oct 13, 2025)
189+
role.addToPolicy(
190+
new PolicyStatement({
191+
sid: 'CreateBedrockAgentCoreRuntimeIdentityServiceLinkedRole',
192+
effect: Effect.ALLOW,
193+
actions: ['iam:CreateServiceLinkedRole'],
194+
resources: [
195+
`arn:aws:iam::*:role/aws-service-role/runtime-identity.bedrock-agentcore.amazonaws.com/AWSServiceRoleForBedrockAgentCoreRuntimeIdentity`,
196+
],
197+
conditions: {
198+
StringEquals: {
199+
'iam:AWSServiceName': 'runtime-identity.bedrock-agentcore.amazonaws.com',
200+
},
201+
},
202+
})
203+
);
204+
188205
return role;
189206
}
190207

0 commit comments

Comments
 (0)