-
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
[aws-eks] ec2:DescribeVpcs
permission is missing when creating clusters
#9027
Comments
Thanks @eladb , I was about to raise a new issue for this since I wasn't sure you seen my comment. |
ec2:DescribeVpcs
permission is missing when creating clustersec2:DescribeVpcs
permission is missing when creating clusters
I've got the issue when deploying CDK app from scratch ( VPC and EKS as seperate stacks ). Deployment of EKS stack failed with the same error. During redeploy it worked fine. I am using CDK 1.60 |
@stefanolczak Can you share the code? Thanks |
The issue reproduces only on empty AWS account or on AWS account where CDK or EKS wasn't used for a while. I'm investigating it more why it does matter. |
I'm almost sure I have once seen other issue ( also with IAM policy ) related to deploying EKS that was fixed by redeploy so I'm guessing there is some global problem in that matter. I found the error message from mentioned issue from the past:
|
Upgraded to 1.60.0 Failed to create resource. IAM role's policy must include the redeploy goes through fine. |
@eladb This issue might have to be reopened. I've had the same issue with CDK 1.66.0 yesterday when trying to deploy a stack from scratch too. The first try to deploy fails with the mentioned error message but a re-deploy works. Seems the CDK cannot clean up all created stacks/resources and then those are re-used and it succeeds. I've also checked and the creation role now has the necessary permissions. So I'm speculating the policy is added to late with the changes in the MR when deploying from scratch. In our stack we're using a shared VPC with another AWS account that we're importing like so:
And then using it like so to create the EKS cluster (which fails the first time around):
|
Hi @kossmoboleat - Thanks, yeah looks like there is still something here. Re-opening and we'll investigate. |
I've got the same issue with CDK 1.67.0 . If you need a simple test project, just use this on GitHub. You can see the file log in aws-cdk-issue-9027.log . I can confirm what @kossmoboleat: if I run 'cdk deploy' just after this error, then the deploy is succesful :| |
I also ran in to this problem when setting up a test cluster. https://github.com/PerArneng/eks-cdk-test/tree/issue_9027 . I ran it against a blank account and then it worked on the second attempt. I also got an email from AWS saying that i was granted access to AWS resources Edit: In the branch above the instance type should be 't3.nano' because 't2.nano' is not available in that region |
Still happening with 1.76.0 and redeploying the stack fixed it |
Managed to reproduce this on a blank account as well, and also got the email that @PerArneng mentioned. I believe the error is coming from a validation that EKS makes on the cluster role, and not necessarily from an operation that requires this action. What happens is that the cluster role we pass gets created by default like so: aws-cdk/packages/@aws-cdk/aws-eks/lib/cluster.ts Lines 911 to 916 in 8216738
This I'll do some internal investigation to see what the best path forward here. |
I got the same problem. A deployment takes 30minutes, so re-deploying isn't a viable workaround for me. Any other solutions? |
We are still investigating the exact set of conditions where this would happen, and how one can avoid it. |
I had the same problem with CDK version: |
Same issue with CDK 1.86 on blank account. |
Same issue with 1.87.1. Re-deploy did the trick |
Hello, I was able to reproduce this (several times) using a tool that vends new accounts for training. Manually adding a policy to the synthesized CloudFormation Template to the role created by CDK fixed the issue for me:
|
I was able to reproduce this multiple times in a single account by manually deleting the However, seems like there might be an issue with this first deployment flow - which I am following up on internally. |
…3103) Give our creation role the necessary `ec2` permissions to allow creating clusters on environments without an existing SLR. The specific operations were taken from the managed policies of the SLRs. Comments inline. See #9027 (comment) for more context. Fixes #9027. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…s#13103) Give our creation role the necessary `ec2` permissions to allow creating clusters on environments without an existing SLR. The specific operations were taken from the managed policies of the SLRs. Comments inline. See aws#9027 (comment) for more context. Fixes aws#9027. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…3103) Give our creation role the necessary `ec2` permissions to allow creating clusters on environments without an existing SLR. The specific operations were taken from the managed policies of the SLRs. Comments inline. See #9027 (comment) for more context. Fixes #9027. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Unrelated to the original post, but it may be useful for people ending up here based on the title:
Also see context-lookups |
Today I've also gotten the same error but on the
ec2:DescribeVpcs
permission. This was not the case on Friday because I rolled out an EKS cluster with a CDK build done from the master branch. Adding the DescribeVpcs permission solved the problem, same as the PR in #8859Seems like AWS is changing stuff on their end that requires more permissions?
Originally posted by @jargelo in #8574 (comment)
The text was updated successfully, but these errors were encountered: