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.

[aws-eks] Fail to create FargateProfile - Missing permissions for `ec2:DescribeSubnets`

See original GitHub issue

We 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:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
pahudcommented, Apr 30, 2020

Can we just add those permissions always?

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.

0reactions
eladbcommented, Apr 30, 2020

Can we just add those permissions always?

Read more comments on GitHub >

github_iconTop 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 >

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