-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Open
Labels
@aws-cdk/aws-ecsRelated to Amazon Elastic ContainerRelated to Amazon Elastic ContainerbugThis 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
When using a cross-account secret for the registry, the grants do not apply the policy to the principal's (execution role) inline policy.
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Library Version
No response
Expected Behavior
The inline execution role policy should have policy attached.
Current Behavior
Inline policy is not working.
Reproduction Steps
- Create a secret from attributes (
Secret.fromSecretAttributes
) - Pass the secret to container definition.
const credentials = Secret.fromSecretAttributes(this, "DockerHubCredentials", {
encryptionKey: '...',
secretCompleteArn: '...',
});
taskDefinition.addContainer("nginx", {
image: ContainerImage.fromRegistry("nginx:latest", {
credentials,
}),
});
Possible Solution
No response
Additional Information/Context
aws-cdk/packages/aws-cdk-lib/aws-ecs/lib/images/repository.ts
Lines 42 to 44 in 0a55ed1
if (this.props.credentials) { | |
this.props.credentials.grantRead(containerDefinition.taskDefinition.obtainExecutionRole()); | |
} |
AWS CDK Library version (aws-cdk-lib)
2.202.0
AWS CDK CLI version
2.1019.2
Node.js Version
v22.12.0
OS
macOS
Language
TypeScript
Language Version
No response
Other information
No response
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-ecsRelated to Amazon Elastic ContainerRelated to Amazon Elastic ContainerbugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp2