aws / aws/aws-cdk

[AWS EKS]: L2 EKS constructs which use L1s instead of custom resources

Open
#24,059 9 comments 15 reactions 0 assignees View on GitHub
@aws-cdk/aws-eks effort/large feature-request in-progress p1
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

We created an EKS Cluster via CDK V2 (2.63.1) using the L2 Construct (code shown below) and noticed that the creation of the cluster created multiple resources including some custom resource lambdas.

**Sample Code to create a test EKS Cluster using L2 Construct**
```typescript
import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';

export class TestingStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);

const eksCluster = new cdk.aws_eks.Cluster(this, 'simple-eks-cluster', {
version: cdk.aws_eks.KubernetesVersion.V1_21,
});
console.log(eksCluster)
}
}
```

From a deeper investigation we understand that CDK's EKS L2 construct deploys some custom resource lambdas that use AWS SDK inside those lambdas to actually create the EKS cluster.

The objective of this ticket is to understand **why did you choose to use AWS SDK to create the cluster (via custom resource lambda) and not used CloudFormation ([AWS::EKS::Cluster](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-cluster.html)) to create the EKS Cluster?**

We are seeking to understand the design decision behind this implementation.

### Use Case

We are using CloudFormation to deploy all our AWS Resources with CloudFormation Hooks to govern certain configurations for our customers.

Now, we want to restrict our customers to only create EKS clusters via CDK using CloudFormation, but because the current version of EKS L2 Construct doesn't use CloudFormation to create EKS Cluster, the CloudFormation Hooks doesn't get triggered when we use EKS L2 Construct which makes it harder for us to govern our customers.

### Proposed Solution

Is it possible for AWS CDK to update the EKS L2 construct to create the EKS Cluster using CloudFormation (AWS::EKS::Cluster) instead of AWS SDK

### Other Information

_No response_

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.62.0

### Environment details (OS name and version, etc.)

MacOS

Contributor guide

Open the contributing guide

Research direction

Start by reading the implementation of the EKS L2 Cluster construct and synthesizing the sample stack to identify the custom resource path. Compare that output with AWS::EKS::Cluster and determine whether the requested change can preserve existing behavior while allowing CloudFormation Hooks to trigger; done means the design decision and required implementation scope are established.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, kubernetes, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.