aws-cdk-lib.aws_eks.CommonClusterOptions

interface CommonClusterOptions

LanguageType name
.NETAmazon.CDK.AWS.EKS.CommonClusterOptions
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awseks#CommonClusterOptions
Javasoftware.amazon.awscdk.services.eks.CommonClusterOptions
Pythonaws_cdk.aws_eks.CommonClusterOptions
TypeScript (source)aws-cdk-lib » aws_eks » CommonClusterOptions

Options for configuring an EKS cluster.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_eks as eks } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';

declare const kubernetesVersion: eks.KubernetesVersion;
declare const role: iam.Role;
declare const securityGroup: ec2.SecurityGroup;
declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const vpc: ec2.Vpc;
const commonClusterOptions: eks.CommonClusterOptions = {
  version: kubernetesVersion,

  // the properties below are optional
  clusterName: 'clusterName',
  outputClusterName: false,
  outputConfigCommand: false,
  role: role,
  securityGroup: securityGroup,
  vpc: vpc,
  vpcSubnets: [{
    availabilityZones: ['availabilityZones'],
    onePerAz: false,
    subnetFilters: [subnetFilter],
    subnetGroupName: 'subnetGroupName',
    subnets: [subnet],
    subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
  }],
};

Properties

NameTypeDescription
versionKubernetesVersionThe Kubernetes version to run in the cluster.
clusterName?stringName for the cluster.
outputClusterName?booleanDetermines whether a CloudFormation output with the name of the cluster will be synthesized.
outputConfigCommand?booleanDetermines whether a CloudFormation output with the aws eks update-kubeconfig command will be synthesized.
role?IRoleRole that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.
securityGroup?ISecurityGroupSecurity Group to use for Control Plane ENIs.
vpc?IVpcThe VPC in which to create the Cluster.
vpcSubnets?SubnetSelection[]Where to place EKS Control Plane ENIs.

version

Type: KubernetesVersion

The Kubernetes version to run in the cluster.


clusterName?

Type: string (optional, default: Automatically generated name)

Name for the cluster.


outputClusterName?

Type: boolean (optional, default: false)

Determines whether a CloudFormation output with the name of the cluster will be synthesized.


outputConfigCommand?

Type: boolean (optional, default: true)

Determines whether a CloudFormation output with the aws eks update-kubeconfig command will be synthesized.

This command will include the cluster name and, if applicable, the ARN of the masters IAM role.


role?

Type: IRole (optional, default: A role is automatically created for you)

Role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.


securityGroup?

Type: ISecurityGroup (optional, default: A security group is automatically created)

Security Group to use for Control Plane ENIs.


vpc?

Type: IVpc (optional, default: a VPC with default configuration will be created and can be accessed through cluster.vpc.)

The VPC in which to create the Cluster.


vpcSubnets?

Type: SubnetSelection[] (optional, default: All public and private subnets)

Where to place EKS Control Plane ENIs.

If you want to create public load balancers, this must include public subnets.

For example, to only select private subnets, supply the following:

vpcSubnets: [{ subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }]