I'm unable to deploy my stack that makes use of ECS Secrets. I'm trying to use 58 ECS Secrets (current hard limit is 60) but how CDK is currently writing the IAM Policy for the Execution Role I'm hitting a limit with the IAM Policy.
The limit is being hit because CDK is adding a statement to the policy per parameter which creates a lot of duplication within the statement.
Resource:
Fn::Join:
- ""
- - "arn:"
- Ref: AWS::Partition
- :ssm:us-east-2:065449092177:parameter/application/parameter1
- Action:
- ssm:DescribeParameters
- ssm:GetParameters
- ssm:GetParameter
- ssm:GetParameterHistory
Effect: Allow
Reproduction Steps
Sorry, I don't have a stack that I can share.
- Create ECS Application w/60 secrets
- cdk deploy
Error Log
Maximum policy size of 10240 bytes exceeded for role
Environment
- CLI Version : 1.44.0
- Framework Version: 1.44.0
- Node.js Version: v12.16.1
- OS : macOS 10.15.5
- Language (Version): TypeScript (3.7.2)
Other
My ideal solution would be an additional parameter for ecs.Secret.fromSsmParameter that gives the option to skip the grant. My stack already appends a Managed Policy to the Execution Role that has all of the access necessary for my application to pull the parameters.
A more immediate option would be to group all of the SSM parameter grants into a single statement to dramatically reduce the duplication of the Action statements 60 times
This is 🐛 Bug Report
I'm unable to deploy my stack that makes use of ECS Secrets. I'm trying to use 58 ECS Secrets (current hard limit is 60) but how CDK is currently writing the IAM Policy for the Execution Role I'm hitting a limit with the IAM Policy.
The limit is being hit because CDK is adding a statement to the policy per parameter which creates a lot of duplication within the statement.
Reproduction Steps
Sorry, I don't have a stack that I can share.
Error Log
Maximum policy size of 10240 bytes exceeded for roleEnvironment
Other
My ideal solution would be an additional parameter for
ecs.Secret.fromSsmParameterthat gives the option to skip the grant. My stack already appends a Managed Policy to the Execution Role that has all of the access necessary for my application to pull the parameters.A more immediate option would be to group all of the SSM parameter grants into a single statement to dramatically reduce the duplication of the
Actionstatements 60 timesThis is 🐛 Bug Report