# CommonClusterOptions

Options for configuring an EKS cluster.

- Source: [`aws-eks/lib/cluster.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-eks/lib/cluster.ts#L468)

## Example

```ts
// 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

- `clusterName`: string — Name for the cluster.

  **Default:** Automatically generated name

- `outputClusterName`: boolean = false — Determines whether a CloudFormation output with the name of the cluster will be synthesized.

- `outputConfigCommand`: boolean = true — Determines whether a CloudFormation output with the `aws eks update-kubeconfig` command will be synthesized.

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

  Note: If mastersRole is not specified, this property will be ignored and no config command will be emitted.

- `role`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — Role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.

  **Default:** A role is automatically created for you

- `securityGroup`: [ISecurityGroup](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.ISecurityGroup.html) — Security Group to use for Control Plane ENIs.

  **Default:** A security group is automatically created

- `version`: [KubernetesVersion](/cdk/api/v2/docs/aws-cdk-lib.aws_eks.KubernetesVersion.html) (required) — The Kubernetes version to run in the cluster.

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

  **Default:** a VPC with default configuration will be created and can be accessed through `cluster.vpc`.

- `vpcSubnets`: [SubnetSelection](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.SubnetSelection.html)[] — Where to place EKS Control Plane ENIs.

  **Default:** All public and private subnets

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

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