-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iam] iam.Group should check if inline policy exceeds maximum size #11562
Comments
Hi @rix0rrr, I looked into how to implement this. Not sure if this is a bigger change then expected, so I figured i'd summarize an approach for feedback before writing code. For reference here's the documentation on policy character limits: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-quotas-entity-length Quick summary of existing classes involved
High level approach
Other Decisions
|
Got recently hit by this while doing unrelated changes to a stack. It resulted in CloudFormation getting stuck for 1 hour, then failing with this error, which is not a very good experience. The problem seems to be that cdk makes it easy to create huge IAM policies. I was able to refactor the stack to work around this. To exemplify, there were a lot of policies being added similar to this below, from various stacks: policy.addToPolicy(
new iam.PolicyStatement({
resources: [repository.repositoryArn],
actions: [
"ecr:InitiateLayerUpload",
"ecr:UploadLayerPart",
"ecr:CompleteLayerUpload",
"ecr:BatchCheckLayerAvailability",
"ecr:PutImage",
],
})
); Instead, a single policy with multiple arns listed in |
Got bit by this again via this innocent construct which was executed on multiple task definitions: taskDefinition.taskRole.grantPassRole(this.someGroup);
taskDefinition.executionRole?.grantPassRole(this.someGroup); It appears that only about 7 task definitions can be supported by the above code, after which it runs into the maximum size exeeded error. I was able to deploy a workaround similar to my previous comment above, but this seems like it should be handled better. |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Issue should be reopened, its really hurts deployment experience of CDK stacks. |
I received the following error after deploying my CDK stack. For some reason, it took a very long time for this error to appear.
Use Case
This error seems simple to test at synthesis time in CDK and would save a lot of debugging time.
Proposed Solution
Check the total size of the combined inline policies for an iam.Group and see if it is less than 5120 bytes.
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: