[aws-eks] Fail to create FargateProfile - Missing permissions for `ec2:DescribeSubnets`
See original GitHub issueWe just annouced the Fargate support for Amazon EKS in 4 additional regions and I was trying to deploy a simple EKS+Fargate cluster to them ended up missiong permissions failure in eu-central-1
, ap-southeast-1
and ap-southeast-2
.
Reproduction Steps
import * as cdk from '@aws-cdk/core';
import * as eks from '@aws-cdk/aws-eks';
import * as ec2 from '@aws-cdk/aws-ec2';
import * as iam from '@aws-cdk/aws-iam';
export class EksfgStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const vpc = new ec2.Vpc(this, 'Vpc', {
maxAzs: 3,
natGateways: 1
});
const mastersRole = new iam.Role(this, 'AdminRole', {
assumedBy: new iam.AccountRootPrincipal()
});
const cluster = new eks.Cluster(this, 'Cluster', {
vpc,
mastersRole
});
cluster.addFargateProfile('FargateProfile', {
selectors: [
{ namespace: 'default' },
{ namespace: 'kube-system' },
]
})
new cdk.CfnOutput(this, 'Region', { value: this.region })
}
}
Error Log
Cluster/fargate-profile-FargateProfile/Resource/Default (ClusterfargateprofileFargateProfileA6BADBA5) Failed to create resource. Error: Missing permissions for `ec2:DescribeSubnets` action
Environment
- CLI Version : 1.35.0
- Framework Version: 1.35.0
- OS : Mac OS X
- Language : Typescript
Other
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Troubleshoot creating a Fargate profile - Amazon AWS
The pod is scheduled according to a random Fargate profile, unless the following annotation is specified within the pod specification: eks.
Read more >Failed to create fargate profile - Stack Overflow
Error is hideous in that it suggests it is a permissions issue, while really the problem is that fargate with EKS (kubernetes) is...
Read more >Amazon managed policies for Amazon Elastic Kubernetes ...
This policy grants the AmazonServiceRoleForAmazonEKSNodegroup role permissions that allow it to create and manage Amazon EC2 node groups in your account.
Read more >Create AWS EKS Fargate Using Terraform (EFS, HPA, Ingress ...
This service account can then provide AWS permissions to the containers in any pod that uses that service account. With this feature, you...
Read more >Creating a Fargate Profile - Amazon EKS Workshop
When your EKS cluster schedules pods on Fargate, the pods will need to make calls to AWS APIs on your behalf to do...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, looks like adding the additional
ec2:DescribeRouteTables
will fix this issue. I am testing manually in different regions. Will create a PR for it today.Can we just add those permissions always?