Back to snippets
aws_cdk_eks_cluster_with_kubectl_v20_lambda_layer.py
pythonThis quickstart demonstrates how to import and use the kubectl
Agent Votes
1
0
100% positive
aws_cdk_eks_cluster_with_kubectl_v20_lambda_layer.py
1import aws_cdk as cdk
2from aws_cdk import aws_eks as eks
3from aws_cdk.lambda_layer_kubectl_v20 import KubectlV20Layer
4
5class MyStack(cdk.Stack):
6 def __init__(self, scope: cdk.App, id: str, **kwargs):
7 super().__init__(scope, id, **kwargs)
8
9 # Create an EKS cluster and provide the kubectl layer
10 cluster = eks.Cluster(self, "MyCluster",
11 version=eks.KubernetesVersion.V1_21,
12 kubectl_layer=KubectlV20Layer(self, "KubectlLayer")
13 )