Interface ClusterCommonOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
ClusterProps, FargateClusterProps
All Known Implementing Classes:
ClusterCommonOptions.Jsii$Proxy, ClusterProps.Jsii$Proxy, FargateClusterProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.126.0 (build 206d44b)", date="2026-02-23T18:58:18.910Z") @Stability(Stable) public interface ClusterCommonOptions extends software.amazon.jsii.JsiiSerializable
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 software.amazon.awscdk.*;
 import software.amazon.awscdk.services.ec2.*;
 import software.amazon.awscdk.services.eks_v2.*;
 import software.amazon.awscdk.services.iam.*;
 import software.amazon.awscdk.services.lambda.*;
 import software.amazon.awscdk.interfaces.kms.*;
 Object additionalHelmChartValues;
 AlbControllerVersion albControllerVersion;
 EndpointAccess endpointAccess;
 IKeyRef keyRef;
 KubernetesVersion kubernetesVersion;
 LayerVersion layerVersion;
 Object policy;
 Role role;
 SecurityGroup securityGroup;
 Size size;
 Subnet subnet;
 SubnetFilter subnetFilter;
 Vpc vpc;
 ClusterCommonOptions clusterCommonOptions = ClusterCommonOptions.builder()
         .version(kubernetesVersion)
         // the properties below are optional
         .albController(AlbControllerOptions.builder()
                 .version(albControllerVersion)
                 // the properties below are optional
                 .additionalHelmChartValues(Map.of(
                         "additionalHelmChartValuesKey", additionalHelmChartValues))
                 .overwriteServiceAccount(false)
                 .policy(policy)
                 .removalPolicy(RemovalPolicy.DESTROY)
                 .repository("repository")
                 .build())
         .clusterLogging(List.of(ClusterLoggingTypes.API))
         .clusterName("clusterName")
         .coreDnsComputeType(CoreDnsComputeType.EC2)
         .endpointAccess(endpointAccess)
         .ipFamily(IpFamily.IP_V4)
         .kubectlProviderOptions(KubectlProviderOptions.builder()
                 .kubectlLayer(layerVersion)
                 // the properties below are optional
                 .awscliLayer(layerVersion)
                 .environment(Map.of(
                         "environmentKey", "environment"))
                 .memory(size)
                 .privateSubnets(List.of(subnet))
                 .removalPolicy(RemovalPolicy.DESTROY)
                 .role(role)
                 .securityGroup(securityGroup)
                 .build())
         .mastersRole(role)
         .prune(false)
         .remoteNodeNetworks(List.of(RemoteNodeNetwork.builder()
                 .cidrs(List.of("cidrs"))
                 .build()))
         .remotePodNetworks(List.of(RemotePodNetwork.builder()
                 .cidrs(List.of("cidrs"))
                 .build()))
         .removalPolicy(RemovalPolicy.DESTROY)
         .role(role)
         .secretsEncryptionKey(keyRef)
         .securityGroup(securityGroup)
         .serviceIpv4Cidr("serviceIpv4Cidr")
         .tags(Map.of(
                 "tagsKey", "tags"))
         .vpc(vpc)
         .vpcSubnets(List.of(SubnetSelection.builder()
                 .availabilityZones(List.of("availabilityZones"))
                 .onePerAz(false)
                 .subnetFilters(List.of(subnetFilter))
                 .subnetGroupName("subnetGroupName")
                 .subnets(List.of(subnet))
                 .subnetType(SubnetType.PRIVATE_ISOLATED)
                 .build()))
         .build();
 
  • Method Details

    • getVersion

      @Stability(Stable) @NotNull KubernetesVersion getVersion()
      The Kubernetes version to run in the cluster.
    • getAlbController

      @Stability(Stable) @Nullable default AlbControllerOptions getAlbController()
      Install the AWS Load Balancer Controller onto the cluster.

      Default: - The controller is not installed.

      See Also:
    • getClusterLogging

      @Stability(Stable) @Nullable default List<ClusterLoggingTypes> getClusterLogging()
      The cluster log types which you want to enable.

      Default: - none

    • getClusterName

      @Stability(Stable) @Nullable default String getClusterName()
      Name for the cluster.

      Default: - Automatically generated name

    • getCoreDnsComputeType

      @Stability(Stable) @Nullable default CoreDnsComputeType getCoreDnsComputeType()
      Controls the "eks.amazonaws.com/compute-type" annotation in the CoreDNS configuration on your cluster to determine which compute type to use for CoreDNS.

      Default: CoreDnsComputeType.EC2 (for `FargateCluster` the default is FARGATE)

    • getEndpointAccess

      @Stability(Stable) @Nullable default EndpointAccess getEndpointAccess()
      Configure access to the Kubernetes API server endpoint..

      Default: EndpointAccess.PUBLIC_AND_PRIVATE

      See Also:
    • getIpFamily

      @Stability(Stable) @Nullable default IpFamily getIpFamily()
      Specify which IP family is used to assign Kubernetes pod and service IP addresses.

      Default: IpFamily.IP_V4

      See Also:
    • getKubectlProviderOptions

      @Stability(Stable) @Nullable default KubectlProviderOptions getKubectlProviderOptions()
      Options for creating the kubectl provider - a lambda function that executes kubectl and helm against the cluster.

      If defined, kubectlLayer is a required property.

      Default: - kubectl provider will not be created

    • getMastersRole

      @Stability(Stable) @Nullable default IRole getMastersRole()
      An IAM role that will be added to the system:masters Kubernetes RBAC group.

      Default: - no masters role.

      See Also:
    • getPrune

      @Stability(Stable) @Nullable default Boolean getPrune()
      Indicates whether Kubernetes resources added through addManifest() 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.

      Default: true

    • getRemoteNodeNetworks

      @Stability(Stable) @Nullable default List<RemoteNodeNetwork> getRemoteNodeNetworks()
      IPv4 CIDR blocks defining the expected address range of hybrid nodes that will join the cluster.

      Default: - none

    • getRemotePodNetworks

      @Stability(Stable) @Nullable default List<RemotePodNetwork> getRemotePodNetworks()
      IPv4 CIDR blocks for Pods running Kubernetes webhooks on hybrid nodes.

      Default: - none

    • getRemovalPolicy

      @Stability(Stable) @Nullable default RemovalPolicy getRemovalPolicy()
      The removal policy applied to all CloudFormation resources created by this construct when they are no longer managed by CloudFormation.

      This can happen in one of three situations:

      • The resource is removed from the template, so CloudFormation stops managing it;
      • A change to the resource is made that requires it to be replaced, so CloudFormation stops managing it;
      • The stack is deleted, so CloudFormation stops managing all resources in it.

      This affects the EKS cluster itself, associated IAM roles, node groups, security groups, VPC and any other CloudFormation resources managed by this construct.

      Default: - Resources will be deleted.

    • getRole

      @Stability(Stable) @Nullable default IRole getRole()
      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

    • getSecretsEncryptionKey

      @Stability(Stable) @Nullable default IKeyRef getSecretsEncryptionKey()
      KMS secret for envelope encryption for Kubernetes secrets.

      Default: - By default, Kubernetes stores all secret object data within etcd and all etcd volumes used by Amazon EKS are encrypted at the disk-level using AWS-Managed encryption keys.

    • getSecurityGroup

      @Stability(Stable) @Nullable default ISecurityGroup getSecurityGroup()
      Security Group to use for Control Plane ENIs.

      Default: - A security group is automatically created

    • getServiceIpv4Cidr

      @Stability(Stable) @Nullable default String getServiceIpv4Cidr()
      The CIDR block to assign Kubernetes service IP addresses from.

      Default: - Kubernetes assigns addresses from either the 10.100.0.0/16 or 172.20.0.0/16 CIDR blocks

      See Also:
    • getTags

      @Stability(Stable) @Nullable default Map<String,String> getTags()
      The tags assigned to the EKS cluster.

      Default: - none

    • getVpc

      @Stability(Stable) @Nullable default IVpc getVpc()
      The VPC in which to create the Cluster.

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

    • getVpcSubnets

      @Stability(Stable) @Nullable default List<SubnetSelection> getVpcSubnets()
      Where to place EKS Control Plane ENIs.

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

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

      Default: - All public and private subnets

    • builder

      @Stability(Stable) static ClusterCommonOptions.Builder builder()
      Returns:
      a ClusterCommonOptions.Builder of ClusterCommonOptions