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] Add EKS Cluster Lookup method

See original GitHub issue

Enable EKS cluster lookups simular to VPC lookup (using only the ID or the ARN). Currently, the closes thing is fromClusterAttributes which requires information about the VPC, the security groups, etc, which seems really unnecessary to me

https://github.com/aws/aws-cdk/blob/be6666b0fe5743c9f8a7747768101fb86380eb38/packages/%40aws-cdk/aws-eks/lib/cluster.ts#L59-L90

Use Case

I am creating an EKS cluster using CDK. In a separate stack, I would like to add a Fargate profile. I have no easy way to get the cluster so I can pass it to the FargateProfile constructor. There is no easy way to do so.

Proposed Solution

A similar solution as what’s used in the VPC module

https://github.com/aws/aws-cdk/blob/c4757831bc5ccb8ac510694d083f17d39a423033/packages/%40aws-cdk/aws-ec2/lib/vpc.ts#L993-L1032

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:8
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
samuelthancommented, May 26, 2020

love to see this feature. Helps me with trying to get the default security group that was created by AWS EKS.

At the moment i’m using boto3 to pull this information which seems a bit ugly in the cdk world.

Vote +1

0reactions
sunshineocommented, Apr 12, 2021

Our use case need to allow EKS cluster to access an RDS. We tried to have the RDS creation and allow access in a separate repository, but the EKS cluster we get from fromClusterAttributes did not work. And it failed silently

const eksCluster = eks.Cluster.fromClusterAttributes(this, 'cdk-managed-eks-cluster', { clusterName: 'cdk-managed-eks-cluster', })
const rdsCluster = new rds.DatabaseCluster(this, 'Database', {...});
rdsCluster.connections.allowFrom(eksCluster.connections, rdsPort, 'Allow eks cluster to connect to rds')

The code above works if we create the eks cluster in the same stack.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing Amazon EKS add-ons
Learn how to add, update, and delete Amazon EKS add-ons for your cluster. ... on your cluster, then use the following procedure to...
Read more >
Connect to Amazon EKS clusters
After you create your Amazon EKS cluster, you must configure your kubeconfig file with the AWS Command Line Interface (AWS CLI).
Read more >
aws-cdk/aws-eks module - AWS Documentation
Another way of allocating capacity to an EKS cluster is by using self-managed nodes. EC2 instances that are part of the auto-scaling group...
Read more >
Creating an Amazon EKS cluster - AWS Documentation
An existing VPC and subnets that meet Amazon EKS requirements. · The kubectl command line tool is installed on your device or AWS...
Read more >
Amazon EKS clusters - AWS Documentation
Amazon EKS nodes run in your AWS account and connect to your cluster's control plane via the API server endpoint and a certificate...
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