AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::EKS::Cluster

CfnCluster

Creates an Amazon EKS control plane. The Amazon EKS control plane consists of control plane instances that run the Kubernetes software, such as `etcd` and the API server. The control plane runs in an account managed by AWS , and the Kubernetes API is exposed by the Amazon EKS API server endpoint. Each Amazon EKS cluster control plane is single tenant and unique. It runs on its own set of Amazon EC2 instances. The cluster control plane is provisioned across multiple Availability Zones and fronted by an ELB Network Load Balancer. Amazon EKS also provisions elastic network interfaces in your VPC subnets to provide connectivity from the control plane instances to the nodes (for example, to support `kubectl exec` , `logs` , and `proxy` data flows). Amazon EKS nodes run in your AWS account and connect to your cluster's control plane over the Kubernetes API server endpoint and a certificate file that is created for your cluster. You can use the `endpointPublicAccess` and `endpointPrivateAccess` parameters to enable or disable public and private access to your cluster's Kubernetes API server endpoint. By default, public access is enabled, and private access is disabled. The endpoint domain name and IP address family depends on the value of the `ipFamily` for the cluster. For more information, see [Amazon EKS Cluster Endpoint Access Control](https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html) in the **Amazon EKS User Guide** . You can use the `logging` parameter to enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs. By default, cluster control plane logs aren't exported to CloudWatch Logs. For more information, see [Amazon EKS Cluster Control Plane Logs](https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) in the **Amazon EKS User Guide** . > CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For more information, see [CloudWatch Pricing](https://docs.aws.amazon.com/cloudwatch/pricing/) . In most cases, it takes several minutes to create a cluster. After you create an Amazon EKS cluster, you must configure your Kubernetes tooling to communicate with the API server and launch nodes into your cluster. For more information, see [Allowing users to access your cluster](https://docs.aws.amazon.com/eks/latest/userguide/cluster-auth.html) and [Launching Amazon EKS nodes](https://docs.aws.amazon.com/eks/latest/userguide/launch-workers.html) in the *Amazon EKS User Guide* .

Import

import { CfnCluster } from 'aws-cdk-lib/aws-eks';

Or use the module namespace:

import * as eks from 'aws-cdk-lib/aws-eks';
// eks.CfnCluster

Properties

Configuration passed to the constructor as CfnClusterProps.

resourcesVpcConfigRequired
IResolvable | ResourcesVpcConfigProperty

The VPC configuration that's used by the cluster control plane. Amazon EKS VPC resources have specific requirements to work properly with Kubernetes. For more information, see [Cluster VPC Considerations](https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html) and [Cluster Security Group Considerations](https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html) in the *Amazon EKS User Guide* . You must specify at least two subnets. You can specify up to five security groups, but we recommend that you use a dedicated security group for your cluster control plane.

roleArnRequired
string | IRoleRef

The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf. For more information, see [Amazon EKS Service IAM Role](https://docs.aws.amazon.com/eks/latest/userguide/service_IAM_role.html) in the **Amazon EKS User Guide** .

accessConfigOptional
IResolvable | AccessConfigProperty

The access configuration for the cluster.

bootstrapSelfManagedAddonsOptional
boolean | IResolvable

If you set this value to `False` when creating a cluster, the default networking add-ons will not be installed. The default networking add-ons include `vpc-cni` , `coredns` , and `kube-proxy` . Use this option when you plan to install third-party alternative add-ons or self-manage the default networking add-ons.

computeConfigOptional
IResolvable | ComputeConfigProperty

Indicates the current configuration of the compute capability on your EKS Auto Mode cluster. For example, if the capability is enabled or disabled. If the compute capability is enabled, EKS Auto Mode will create and delete EC2 Managed Instances in your AWS account. For more information, see EKS Auto Mode compute capability in the *Amazon EKS User Guide* .

controlPlaneScalingConfigOptional
IResolvable | ControlPlaneScalingConfigProperty

The control plane scaling tier configuration. For more information, see EKS Provisioned Control Plane in the Amazon EKS User Guide.

deletionProtectionOptional
boolean | IResolvable

The current deletion protection setting for the cluster. When `true` , deletion protection is enabled and the cluster cannot be deleted until protection is disabled. When `false` , the cluster can be deleted normally. This setting only applies to clusters in an active state.

encryptionConfigOptional
IResolvable | IResolvable | EncryptionConfigProperty[]

The encryption configuration for the cluster.

forceOptional
boolean | IResolvable

Set this value to `true` to override upgrade-blocking readiness checks when updating a cluster.

Default: - false

kubernetesNetworkConfigOptional
IResolvable | KubernetesNetworkConfigProperty

The Kubernetes network configuration for the cluster.

loggingOptional
IResolvable | LoggingProperty

The logging configuration for your cluster.

nameOptional
string

The unique name to give to your cluster. The name can contain only alphanumeric characters (case-sensitive) and hyphens. It must start with an alphanumeric character and can't be longer than 100 characters. The name must be unique within the AWS Region and AWS account that you're creating the cluster in. Note that underscores can't be used in CloudFormation .

outpostConfigOptional
IResolvable | OutpostConfigProperty

An object representing the configuration of your local Amazon EKS cluster on an AWS Outpost. This object isn't available for clusters on the AWS cloud.

remoteNetworkConfigOptional
IResolvable | RemoteNetworkConfigProperty

The configuration in the cluster for EKS Hybrid Nodes. You can add, change, or remove this configuration after the cluster is created.

storageConfigOptional
IResolvable | StorageConfigProperty

Indicates the current configuration of the block storage capability on your EKS Auto Mode cluster. For example, if the capability is enabled or disabled. If the block storage capability is enabled, EKS Auto Mode will create and delete EBS volumes in your AWS account. For more information, see EKS Auto Mode block storage capability in the *Amazon EKS User Guide* .

tagsOptional
CfnTag[]

The metadata that you apply to the cluster to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Cluster tags don't propagate to any other resources associated with the cluster. > You must have the `eks:TagResource` and `eks:UntagResource` permissions for your [IAM principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) to manage the CloudFormation stack. If you don't have these permissions, there might be unexpected behavior with stack-level tags propagating to the resource during resource creation and update.

upgradePolicyOptional
IResolvable | UpgradePolicyProperty

This value indicates if extended support is enabled or disabled for the cluster. [Learn more about EKS Extended Support in the *Amazon EKS User Guide* .](https://docs.aws.amazon.com/eks/latest/userguide/extended-support-control.html)

versionOptional
string

The desired Kubernetes version for your cluster. If you don't specify a value here, the default version available in Amazon EKS is used. > The default version might not be the latest version available.

zonalShiftConfigOptional
IResolvable | ZonalShiftConfigProperty

The configuration for zonal shift for the cluster.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter