interface ICluster
| Language | Type name | 
|---|---|
  .NET | Amazon.CDK.AWS.EKS.ICluster | 
  Java | software.amazon.awscdk.services.eks.ICluster | 
  Python | aws_cdk.aws_eks.ICluster | 
  TypeScript (source) | @aws-cdk/aws-eks » ICluster | 
Implemented by
Cluster, Fargate
Obtainable from
Cluster.fromClusterAttributes()
An EKS cluster.
Properties
| Name | Type | Description | 
|---|---|---|
| cluster | string | The unique ARN assigned to the service by AWS in the form of arn:aws:eks:. | 
| cluster | string | The certificate-authority-data for your cluster. | 
| cluster | string | Amazon Resource Name (ARN) or alias of the customer master key (CMK). | 
| cluster | string | The API Server endpoint URL. | 
| cluster | string | The physical name of the Cluster. | 
| cluster | ISecurity | The cluster security group that was created by Amazon EKS for the cluster. | 
| cluster | string | The id of the cluster security group that was created by Amazon EKS for the cluster. | 
| connections | Connections | The network connections associated with this resource. | 
| env | Resource | The environment this resource belongs to. | 
| node | Construct | The construct tree node for this construct. | 
| open | IOpen | The Open ID Connect Provider of the cluster used to configure Service Accounts. | 
| prune | boolean | Indicates whether Kubernetes resources can be automatically pruned. | 
| stack | Stack | The stack in which this resource is defined. | 
| vpc | IVpc | The VPC in which this Cluster was created. | 
| cluster | ISecurity | A security group to associate with the Cluster Handler's Lambdas. | 
| kubectl | { [string]: string } | Custom environment variables when running kubectl against this cluster. | 
| kubectl | IRole | An IAM role that can perform kubectl operations against this cluster. | 
| kubectl | ILayer | An AWS Lambda layer that includes kubectl, helm and the aws CLI. | 
| kubectl | Size | Amount of memory to allocate to the provider's lambda function. | 
| kubectl | ISubnet[] | Subnets to host the kubectl compute resources. | 
| kubectl | IKubectl | Kubectl Provider for issuing kubectl commands against it. | 
| kubectl | IRole | An IAM role that can perform kubectl operations against this cluster. | 
| kubectl | ISecurity | A security group to use for kubectl execution. | 
| on | ILayer | An AWS Lambda layer that includes the NPM dependency proxy-agent. | 
clusterArn
Type:
string
The unique ARN assigned to the service by AWS in the form of arn:aws:eks:.
clusterCertificateAuthorityData
Type:
string
The certificate-authority-data for your cluster.
clusterEncryptionConfigKeyArn
Type:
string
Amazon Resource Name (ARN) or alias of the customer master key (CMK).
clusterEndpoint
Type:
string
The API Server endpoint URL.
clusterName
Type:
string
The physical name of the Cluster.
clusterSecurityGroup
Type:
ISecurity
The cluster security group that was created by Amazon EKS for the cluster.
clusterSecurityGroupId
Type:
string
The id of the cluster security group that was created by Amazon EKS for the cluster.
connections
Type:
Connections
The network connections associated with this resource.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
node
Type:
Construct
The construct tree node for this construct.
openIdConnectProvider
Type:
IOpen
The Open ID Connect Provider of the cluster used to configure Service Accounts.
prune
Type:
boolean
Indicates whether Kubernetes resources can be automatically pruned.
When
this is enabled (default), prune labels will be allocated and injected to
each resource. These labels will then be used when issuing the kubectl apply operation with the --prune switch.
stack
Type:
Stack
The stack in which this resource is defined.
vpc
Type:
IVpc
The VPC in which this Cluster was created.
clusterHandlerSecurityGroup?
Type:
ISecurity
(optional, default: No security group.)
A security group to associate with the Cluster Handler's Lambdas.
The Cluster Handler's Lambdas are responsible for calling AWS's EKS API.
Requires placeClusterHandlerInVpc to be set to true.
kubectlEnvironment?
Type:
{ [string]: string }
(optional)
Custom environment variables when running kubectl against this cluster.
kubectlLambdaRole?
Type:
IRole
(optional)
An IAM role that can perform kubectl operations against this cluster.
The role should be mapped to the system:masters Kubernetes RBAC role.
This role is directly passed to the lambda handler that sends Kube Ctl commands to the cluster.
kubectlLayer?
Type:
ILayer
(optional)
An AWS Lambda layer that includes kubectl, helm and the aws CLI.
If not defined, a default layer will be used.
kubectlMemory?
Type:
Size
(optional)
Amount of memory to allocate to the provider's lambda function.
kubectlPrivateSubnets?
Type:
ISubnet[]
(optional)
Subnets to host the kubectl compute resources.
If this is undefined, the k8s endpoint is expected to be accessible publicly.
kubectlProvider?
Type:
IKubectl
(optional)
Kubectl Provider for issuing kubectl commands against it.
If not defined, a default provider will be used
kubectlRole?
Type:
IRole
(optional)
An IAM role that can perform kubectl operations against this cluster.
The role should be mapped to the system:masters Kubernetes RBAC role.
kubectlSecurityGroup?
Type:
ISecurity
(optional)
A security group to use for kubectl execution.
If this is undefined, the k8s endpoint is expected to be accessible publicly.
onEventLayer?
Type:
ILayer
(optional)
An AWS Lambda layer that includes the NPM dependency proxy-agent.
If not defined, a default layer will be used.
Methods
| Name | Description | 
|---|---|
| add | Defines a CDK8s chart in this cluster. | 
| add | Defines a Helm chart in this cluster. | 
| add | Defines a Kubernetes resource in this cluster. | 
| add | Creates a new service account with corresponding IAM Role (IRSA). | 
| apply | Apply the given removal policy to this resource. | 
| connect | Connect capacity in the form of an existing AutoScalingGroup to the EKS cluster. | 
addCdk8sChart(id, chart, options?)  
public addCdk8sChart(id: string, chart: Construct, options?: KubernetesManifestOptions): KubernetesManifest
Parameters
- id 
string— logical id of this chart. - chart 
Construct— the cdk8s chart. - options 
KubernetesManifest Options  
Returns
Defines a CDK8s chart in this cluster.
addHelmChart(id, options)  
public addHelmChart(id: string, options: HelmChartOptions): HelmChart
Parameters
- id 
string— logical id of this chart. - options 
Helm— options of this chart.Chart Options  
Returns
Defines a Helm chart in this cluster.
addManifest(id, ...manifest) 
public addManifest(id: string, ...manifest: { [string]: any }[]): KubernetesManifest
Parameters
- id 
string— logical id of this manifest. - manifest 
{ [string]: any }— a list of Kubernetes resource specifications. 
Returns
Defines a Kubernetes resource in this cluster.
The manifest will be applied/deleted using kubectl as needed.
addServiceAccount(id, options?)  
public addServiceAccount(id: string, options?: ServiceAccountOptions): ServiceAccount
Parameters
- id 
string— logical id of service account. - options 
Service— service account options.Account Options  
Returns
Creates a new service account with corresponding IAM Role (IRSA).
applyRemovalPolicy(policy)  
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy 
RemovalPolicy  
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
connectAutoScalingGroupCapacity(autoScalingGroup, options)    
public connectAutoScalingGroupCapacity(autoScalingGroup: AutoScalingGroup, options: AutoScalingGroupOptions): void
Parameters
- autoScalingGroup 
Auto— [disable-awslint:ref-via-interface].Scaling Group  - options 
Auto— options for adding auto scaling groups, like customizing the bootstrap script.Scaling Group Options  
Connect capacity in the form of an existing AutoScalingGroup to the EKS cluster.
The AutoScalingGroup must be running an EKS-optimized AMI containing the /etc/eks/bootstrap.sh script. This method will configure Security Groups, add the right policies to the instance role, apply the right tags, and add the required user data to the instance's launch configuration.
Spot instances will be labeled lifecycle=Ec2Spot and tainted with PreferNoSchedule.
If kubectl is enabled, the
spot interrupt handler
daemon will be installed on all spot instances to handle
EC2 Spot Instance Termination Notices.
Prefer to use addAutoScalingGroupCapacity if possible.
See also: https://docs.aws.amazon.com/eks/latest/userguide/launch-workers.html

 .NET
 Java
 Python
 TypeScript (