question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IAM: Maximum policy size of 10240 bytes exceeded for role..

See original GitHub issue

What is the problem?

Our app has a lot of resources (mostly a lot of secrets). This is causing the auto-generated inline policy max combined size to be exceeded. Even though this bug is technically covered by this feature request since using Managed Policies is probably the primary fix, I thought I should formally file this issue.

Reproduction Steps

Grant a lot of permissions to a resource that exceeds a total of 10240 bytes.

What did you expect to happen?

Policy consolidation, see this feature request, or the use of managed policies enables more than 10240 of policies.

What actually happened?

CloudFormation error: Maximum policy size of 10240 bytes exceeded for role...

CDK CLI Version

2.7.0 (build cfb09d5)

Framework Version

No response

Node.js Version

16.13.1

OS

Mac OS 12.1

Language

Python

Language Version

No response

Possible solutions:

https://github.com/aws/aws-cdk/issues/7448 https://github.com/aws/aws-cdk/issues/18458

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
automartin5000commented, Feb 22, 2022

@automartin5000 I’ve run into this same issue (also with secrets). Have you figured out a scalable solution to this?

Nothing scalable. Just realized I was adding the secrets to the task role (which already had a bunch of policies) when they’re only needed on the execution role. That made both role policies small enough for now.

If I hit the limit again, I’ll probably strip all the secrets out of the task definition, grant the task permissions to get secrets on <env>/*, and make the task retrieve the secrets itself.

0reactions
github-actions[bot]commented, Mar 18, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Increase the managed policies or character size limit ... - AWS
The maximum limit for attaching a managed policy to an IAM role or user is 20. The maximum character size limit for managed...
Read more >
IamRoleLambdaExecution - Maximum policy size of 10240 ...
An error occurred : IamRoleLambdaExecution - Maximum policy size of 10240 bytes exceeded for role Vkonnect-dev-ap-south-1-lambdaRole ...
Read more >
AWS Amplify CLI “IAM Authorization Role Error: Maximum ...
“IAM Authorization Role Error: Maximum policy size of 10240 bytes exceeded for role”. Well, you're not alone, I'm gonna help you solve it ......
Read more >
How can I increase the default managed policies or ... - YouTube
How can I increase the default managed policies or character size limit for an IAM role or user?
Read more >
IAM and Amazon STS quotas, name requirements, and ...
IAM and STS character limits · User policy size cannot exceed 2,048 characters. · Role policy size cannot exceed 10,240 characters. · Group...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found