Class ClusterProps.Builder

java.lang.Object
software.amazon.awscdk.services.eks_v2.ClusterProps.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<ClusterProps>
Enclosing interface:
ClusterProps

@Stability(Stable) public static final class ClusterProps.Builder extends Object implements software.amazon.jsii.Builder<ClusterProps>
A builder for ClusterProps
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • bootstrapClusterCreatorAdminPermissions

      @Stability(Stable) public ClusterProps.Builder bootstrapClusterCreatorAdminPermissions(Boolean bootstrapClusterCreatorAdminPermissions)
      Parameters:
      bootstrapClusterCreatorAdminPermissions - Whether or not IAM principal of the cluster creator was set as a cluster admin access entry during cluster creation time. Changing this value after the cluster has been created will result in the cluster being replaced.
      Returns:
      this
    • bootstrapSelfManagedAddons

      @Stability(Stable) public ClusterProps.Builder bootstrapSelfManagedAddons(Boolean bootstrapSelfManagedAddons)
      Parameters:
      bootstrapSelfManagedAddons - If you set this value to False when creating a cluster, the default networking add-ons will not be installed. The default networking addons 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.

      Changing this value after the cluster has been created will result in the cluster being replaced.

      Returns:
      this
    • compute

      @Stability(Stable) public ClusterProps.Builder compute(ComputeConfig compute)
      Sets the value of ClusterProps.getCompute()
      Parameters:
      compute - Configuration for compute settings in Auto Mode. When enabled, EKS will automatically manage compute resources.
      Returns:
      this
    • defaultCapacity

      @Stability(Stable) public ClusterProps.Builder defaultCapacity(Number defaultCapacity)
      Parameters:
      defaultCapacity - Number of instances to allocate as an initial capacity for this cluster. Instance type can be configured through defaultCapacityInstanceType, which defaults to m5.large.

      Use cluster.addAutoScalingGroupCapacity to add additional customized capacity. Set this to 0 is you wish to avoid the initial capacity allocation.

      Returns:
      this
    • defaultCapacityInstance

      @Stability(Stable) public ClusterProps.Builder defaultCapacityInstance(InstanceType defaultCapacityInstance)
      Parameters:
      defaultCapacityInstance - The instance type to use for the default capacity. This will only be taken into account if defaultCapacity is > 0.
      Returns:
      this
    • defaultCapacityType

      @Stability(Stable) public ClusterProps.Builder defaultCapacityType(DefaultCapacityType defaultCapacityType)
      Parameters:
      defaultCapacityType - The default capacity type for the cluster.
      Returns:
      this
    • outputConfigCommand

      @Stability(Stable) public ClusterProps.Builder outputConfigCommand(Boolean outputConfigCommand)
      Parameters:
      outputConfigCommand - 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.
      Returns:
      this
    • version

      @Stability(Stable) public ClusterProps.Builder version(KubernetesVersion version)
      Parameters:
      version - The Kubernetes version to run in the cluster. This parameter is required.
      Returns:
      this
    • albController

      @Stability(Stable) public ClusterProps.Builder albController(AlbControllerOptions albController)
      Parameters:
      albController - Install the AWS Load Balancer Controller onto the cluster.
      Returns:
      this
    • clusterLogging

      @Stability(Stable) public ClusterProps.Builder clusterLogging(List<? extends ClusterLoggingTypes> clusterLogging)
      Parameters:
      clusterLogging - The cluster log types which you want to enable.
      Returns:
      this
    • clusterName

      @Stability(Stable) public ClusterProps.Builder clusterName(String clusterName)
      Parameters:
      clusterName - Name for the cluster.
      Returns:
      this
    • controlPlaneScalingTier

      @Stability(Stable) public ClusterProps.Builder controlPlaneScalingTier(ControlPlaneScalingTier controlPlaneScalingTier)
      Parameters:
      controlPlaneScalingTier - The scaling tier for the cluster's provisioned control plane. Provisioned Control Plane allows you to select a scaling tier to ensure high and predictable performance for demanding workloads such as AI training/inference, high-performance computing, or large-scale data processing.
      Returns:
      this
    • coreDnsComputeType

      @Stability(Stable) public ClusterProps.Builder coreDnsComputeType(CoreDnsComputeType coreDnsComputeType)
      Parameters:
      coreDnsComputeType - Controls the "eks.amazonaws.com/compute-type" annotation in the CoreDNS configuration on your cluster to determine which compute type to use for CoreDNS.
      Returns:
      this
    • endpointAccess

      @Stability(Stable) public ClusterProps.Builder endpointAccess(EndpointAccess endpointAccess)
      Parameters:
      endpointAccess - Configure access to the Kubernetes API server endpoint..
      Returns:
      this
    • ipFamily

      @Stability(Stable) public ClusterProps.Builder ipFamily(IpFamily ipFamily)
      Parameters:
      ipFamily - Specify which IP family is used to assign Kubernetes pod and service IP addresses.
      Returns:
      this
    • kubectlProviderOptions

      @Stability(Stable) public ClusterProps.Builder kubectlProviderOptions(KubectlProviderOptions kubectlProviderOptions)
      Parameters:
      kubectlProviderOptions - Options for creating the kubectl provider - a lambda function that executes kubectl and helm against the cluster. If defined, kubectlLayer is a required property.
      Returns:
      this
    • mastersRole

      @Stability(Stable) public ClusterProps.Builder mastersRole(IRole mastersRole)
      Parameters:
      mastersRole - An IAM role that will be added to the system:masters Kubernetes RBAC group.
      Returns:
      this
    • prune

      @Stability(Stable) public ClusterProps.Builder prune(Boolean prune)
      Parameters:
      prune - 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.
      Returns:
      this
    • remoteNodeNetworks

      @Stability(Stable) public ClusterProps.Builder remoteNodeNetworks(List<? extends RemoteNodeNetwork> remoteNodeNetworks)
      Parameters:
      remoteNodeNetworks - IPv4 CIDR blocks defining the expected address range of hybrid nodes that will join the cluster.
      Returns:
      this
    • remotePodNetworks

      @Stability(Stable) public ClusterProps.Builder remotePodNetworks(List<? extends RemotePodNetwork> remotePodNetworks)
      Parameters:
      remotePodNetworks - IPv4 CIDR blocks for Pods running Kubernetes webhooks on hybrid nodes.
      Returns:
      this
    • removalPolicy

      @Stability(Stable) public ClusterProps.Builder removalPolicy(RemovalPolicy removalPolicy)
      Parameters:
      removalPolicy - 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.

      Returns:
      this
    • role

      @Stability(Stable) public ClusterProps.Builder role(IRole role)
      Parameters:
      role - Role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.
      Returns:
      this
    • secretsEncryptionKey

      @Stability(Stable) public ClusterProps.Builder secretsEncryptionKey(IKeyRef secretsEncryptionKey)
      Parameters:
      secretsEncryptionKey - KMS secret for envelope encryption for Kubernetes secrets.
      Returns:
      this
    • securityGroup

      @Stability(Stable) public ClusterProps.Builder securityGroup(ISecurityGroup securityGroup)
      Parameters:
      securityGroup - Security Group to use for Control Plane ENIs.
      Returns:
      this
    • serviceIpv4Cidr

      @Stability(Stable) public ClusterProps.Builder serviceIpv4Cidr(String serviceIpv4Cidr)
      Parameters:
      serviceIpv4Cidr - The CIDR block to assign Kubernetes service IP addresses from.
      Returns:
      this
    • tags

      @Stability(Stable) public ClusterProps.Builder tags(Map<String,String> tags)
      Parameters:
      tags - The tags assigned to the EKS cluster.
      Returns:
      this
    • vpc

      @Stability(Stable) public ClusterProps.Builder vpc(IVpc vpc)
      Parameters:
      vpc - The VPC in which to create the Cluster.
      Returns:
      this
    • vpcSubnets

      @Stability(Stable) public ClusterProps.Builder vpcSubnets(List<? extends SubnetSelection> vpcSubnets)
      Parameters:
      vpcSubnets - Where to place EKS Control Plane ENIs. For example, to only select private subnets, supply the following:

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

      Returns:
      this
    • build

      @Stability(Stable) public ClusterProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<ClusterProps>
      Returns:
      a new instance of ClusterProps
      Throws:
      NullPointerException - if any required attribute was not provided