# ICluster

An EKS cluster.

Extends: ICluster
Extends: IResource, IConnectable, IClusterRef
Implemented by: Cluster, FargateCluster

- Source: [`aws-eks-v2/lib/cluster.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-eks-v2/lib/cluster.ts#L53)
- Type last changed: v2.240.0 · 23 Feb 2026

## Properties

- `clusterArn`: string — The unique ARN assigned to the service by AWS in the form of arn:aws:eks:.

- `clusterCertificateAuthorityData`: string — The certificate-authority-data for your cluster.

- `clusterEncryptionConfigKeyArn`: string — Amazon Resource Name (ARN) or alias of the customer master key (CMK).

- `clusterEndpoint`: string — The API Server endpoint URL.

- `clusterName`: string — The physical name of the Cluster.

- `clusterRef`: [ClusterReference](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_eks.ClusterReference.html) — A reference to a Cluster resource.

- `clusterSecurityGroup`: [ISecurityGroup](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.ISecurityGroup.html) — The cluster security group that was created by Amazon EKS for the cluster.

- `clusterSecurityGroupId`: string — The id of the cluster security group that was created by Amazon EKS for the cluster.

- `connections`: [Connections](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.Connections.html) — The network connections associated with this resource.

- `eksPodIdentityAgent`: [IAddon](/cdk/api/v2/docs/aws-cdk-lib.aws_eks_v2.IAddon.html) — The EKS Pod Identity Agent addon for the EKS cluster.

  The EKS Pod Identity Agent is responsible for managing the temporary credentials
  used by pods in the cluster to access AWS resources. It runs as a DaemonSet on
  each node and provides the necessary credentials to the pods based on their
  associated service account.

  This property returns the `CfnAddon` resource representing the EKS Pod Identity
  Agent addon. If the addon has not been created yet, it will be created and
  returned.

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) — The environment this resource belongs to.

  For resources that are created and managed in a Stack (those created by
  creating new class instances like `new Role()`, `new Bucket()`, etc.), this
  is always the same as the environment of the stack they belong to.

  For referenced resources (those obtained from referencing methods like
  `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
  different than the stack they were imported into.

- `ipFamily`: [IpFamily](/cdk/api/v2/docs/aws-cdk-lib.aws_eks_v2.IpFamily.html) = IpFamily.IP_V4 — Specify which IP family is used to assign Kubernetes pod and service IP addresses.

- `kubectlProvider`: [IKubectlProvider](/cdk/api/v2/docs/aws-cdk-lib.aws_eks_v2.IKubectlProvider.html) — Kubectl Provider for issuing kubectl commands against it.

  If not defined, a default provider will be used

- `kubectlProviderOptions`: [KubectlProviderOptions](/cdk/api/v2/docs/aws-cdk-lib.aws_eks_v2.KubectlProviderOptions.html) — Options for creating the kubectl provider - a lambda function that executes `kubectl` and `helm` against the cluster.

  **Default:** kubectl provider will not be created

  If defined, `kubectlLayer` is a required property.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) — The tree node.

- `openIdConnectProvider`: [IOpenIdConnectProvider](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IOpenIdConnectProvider.html) — The Open ID Connect Provider of the cluster used to configure Service Accounts.

- `prune`: 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`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html) — The stack in which this resource is defined.

- `vpc`: [IVpc](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpc.html) — The VPC in which this Cluster was created.

## Methods

- `addCdk8sChart(id: string, chart: Construct, options?: KubernetesManifestOptions): KubernetesManifest` — Defines a CDK8s chart in this cluster.

  **Parameters**

  - `id` — logical id of this chart.
  - `chart` — the cdk8s chart.

  **Returns:** a `KubernetesManifest` construct representing the chart.

- `addHelmChart(id: string, options: HelmChartOptions): HelmChart` — Defines a Helm chart in this cluster.

  **Parameters**

  - `id` — logical id of this chart.
  - `options` — options of this chart.

  **Returns:** a `HelmChart` construct

- `addManifest(id: string, ...manifest: { [key: string]: any }[]): KubernetesManifest` — Defines a Kubernetes resource in this cluster.

  The manifest will be applied/deleted using kubectl as needed.

  **Parameters**

  - `id` — logical id of this manifest.
  - `manifest` — a list of Kubernetes resource specifications.

  **Returns:** a `KubernetesManifest` object.

- `addServiceAccount(id: string, options?: ServiceAccountOptions): ServiceAccount` — Creates a new service account with corresponding IAM Role (IRSA).

  **Parameters**

  - `id` — logical id of service account.
  - `options` — service account options.

- `applyRemovalPolicy(policy: RemovalPolicy): void` — 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: AutoScalingGroup, options: AutoScalingGroupOptions): void` — 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.

  Prefer to use `addAutoScalingGroupCapacity` if possible.

  **Parameters**

  - `autoScalingGroup` — [disable-awslint:ref-via-interface].
  - `options` — options for adding auto scaling groups, like customizing the bootstrap script.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.

  **Parameters**

  - `mixins` — The mixins to apply.

  **Returns:** This construct for chaining
