aws-apprunner-alpha: accessRole
prop doesn't work #32974
Closed
Description
Describe the bug
The accessRole
prop in the Service
L2 construct doesn't work. If you try to set it, it gets ignored.
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
No response
Expected Behavior
I expected the App Runner service to be created with the configured access role, like for this service I manually created from AWS Console:
Current Behavior
The App Runner service gets deployed without the configured access role:
Reproduction Steps
Deploy the following Stack:
const apprunnerInstanceRole = new Role(this, "ApprunnerInstanceRole", {
assumedBy: new ServicePrincipal("tasks.apprunner.amazonaws.com"),
});
const apprunnerAccessRole = new Role(this, "ApprunnerAccessRole", {
assumedBy: new ServicePrincipal("build.apprunner.amazonaws.com"),
managedPolicies: [
{
managedPolicyArn: "arn:aws:iam::aws:policy/AdministratorAccess",
},
],
});
new Service(this, "ApacheService", {
accessRole: apprunnerAccessRole,
instanceRole: apprunnerInstanceRole,
source: Source.fromEcrPublic({
imageIdentifier: "public.ecr.aws/docker/library/httpd:bookworm",
imageConfiguration: {
port: 80,
},
}),
});
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.175.1
Framework Version
No response
Node.js Version
22.12.0
OS
Ubuntu 24.04.1
Language
TypeScript
Language Version
No response
Other information
No response