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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalbController(AlbControllerOptions albController) Sets the value ofClusterCommonOptions.getAlbController()bootstrapClusterCreatorAdminPermissions(Boolean bootstrapClusterCreatorAdminPermissions) Sets the value ofClusterProps.getBootstrapClusterCreatorAdminPermissions()bootstrapSelfManagedAddons(Boolean bootstrapSelfManagedAddons) Sets the value ofClusterProps.getBootstrapSelfManagedAddons()build()Builds the configured instance.clusterLogging(List<? extends ClusterLoggingTypes> clusterLogging) Sets the value ofClusterCommonOptions.getClusterLogging()clusterName(String clusterName) Sets the value ofClusterCommonOptions.getClusterName()compute(ComputeConfig compute) Sets the value ofClusterProps.getCompute()coreDnsComputeType(CoreDnsComputeType coreDnsComputeType) Sets the value ofClusterCommonOptions.getCoreDnsComputeType()defaultCapacity(Number defaultCapacity) Sets the value ofClusterProps.getDefaultCapacity()defaultCapacityInstance(InstanceType defaultCapacityInstance) Sets the value ofClusterProps.getDefaultCapacityInstance()defaultCapacityType(DefaultCapacityType defaultCapacityType) Sets the value ofClusterProps.getDefaultCapacityType()endpointAccess(EndpointAccess endpointAccess) Sets the value ofClusterCommonOptions.getEndpointAccess()Sets the value ofClusterCommonOptions.getIpFamily()kubectlProviderOptions(KubectlProviderOptions kubectlProviderOptions) Sets the value ofClusterCommonOptions.getKubectlProviderOptions()mastersRole(IRole mastersRole) Sets the value ofClusterCommonOptions.getMastersRole()outputConfigCommand(Boolean outputConfigCommand) Sets the value ofClusterProps.getOutputConfigCommand()Sets the value ofClusterCommonOptions.getPrune()remoteNodeNetworks(List<? extends RemoteNodeNetwork> remoteNodeNetworks) Sets the value ofClusterCommonOptions.getRemoteNodeNetworks()remotePodNetworks(List<? extends RemotePodNetwork> remotePodNetworks) Sets the value ofClusterCommonOptions.getRemotePodNetworks()removalPolicy(RemovalPolicy removalPolicy) Sets the value ofClusterCommonOptions.getRemovalPolicy()Sets the value ofClusterCommonOptions.getRole()secretsEncryptionKey(IKeyRef secretsEncryptionKey) Sets the value ofClusterCommonOptions.getSecretsEncryptionKey()securityGroup(ISecurityGroup securityGroup) Sets the value ofClusterCommonOptions.getSecurityGroup()serviceIpv4Cidr(String serviceIpv4Cidr) Sets the value ofClusterCommonOptions.getServiceIpv4Cidr()Sets the value ofClusterCommonOptions.getTags()version(KubernetesVersion version) Sets the value ofClusterCommonOptions.getVersion()Sets the value ofClusterCommonOptions.getVpc()vpcSubnets(List<? extends SubnetSelection> vpcSubnets) Sets the value ofClusterCommonOptions.getVpcSubnets()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
bootstrapClusterCreatorAdminPermissions
@Stability(Stable) public ClusterProps.Builder bootstrapClusterCreatorAdminPermissions(Boolean bootstrapClusterCreatorAdminPermissions) Sets the value ofClusterProps.getBootstrapClusterCreatorAdminPermissions()- 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) Sets the value ofClusterProps.getBootstrapSelfManagedAddons()- 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
Sets the value ofClusterProps.getCompute()- Parameters:
compute- Configuration for compute settings in Auto Mode. When enabled, EKS will automatically manage compute resources.- Returns:
this
-
defaultCapacity
Sets the value ofClusterProps.getDefaultCapacity()- Parameters:
defaultCapacity- Number of instances to allocate as an initial capacity for this cluster. Instance type can be configured throughdefaultCapacityInstanceType, which defaults tom5.large.Use
cluster.addAutoScalingGroupCapacityto add additional customized capacity. Set this to0is you wish to avoid the initial capacity allocation.- Returns:
this
-
defaultCapacityInstance
@Stability(Stable) public ClusterProps.Builder defaultCapacityInstance(InstanceType defaultCapacityInstance) Sets the value ofClusterProps.getDefaultCapacityInstance()- Parameters:
defaultCapacityInstance- The instance type to use for the default capacity. This will only be taken into account ifdefaultCapacityis > 0.- Returns:
this
-
defaultCapacityType
@Stability(Stable) public ClusterProps.Builder defaultCapacityType(DefaultCapacityType defaultCapacityType) Sets the value ofClusterProps.getDefaultCapacityType()- Parameters:
defaultCapacityType- The default capacity type for the cluster.- Returns:
this
-
outputConfigCommand
Sets the value ofClusterProps.getOutputConfigCommand()- Parameters:
outputConfigCommand- Determines whether a CloudFormation output with theaws eks update-kubeconfigcommand will be synthesized. This command will include the cluster name and, if applicable, the ARN of the masters IAM role.- Returns:
this
-
version
Sets the value ofClusterCommonOptions.getVersion()- Parameters:
version- The Kubernetes version to run in the cluster. This parameter is required.- Returns:
this
-
albController
Sets the value ofClusterCommonOptions.getAlbController()- Parameters:
albController- Install the AWS Load Balancer Controller onto the cluster.- Returns:
this
-
clusterLogging
@Stability(Stable) public ClusterProps.Builder clusterLogging(List<? extends ClusterLoggingTypes> clusterLogging) Sets the value ofClusterCommonOptions.getClusterLogging()- Parameters:
clusterLogging- The cluster log types which you want to enable.- Returns:
this
-
clusterName
Sets the value ofClusterCommonOptions.getClusterName()- Parameters:
clusterName- Name for the cluster.- Returns:
this
-
coreDnsComputeType
@Stability(Stable) public ClusterProps.Builder coreDnsComputeType(CoreDnsComputeType coreDnsComputeType) Sets the value ofClusterCommonOptions.getCoreDnsComputeType()- 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
Sets the value ofClusterCommonOptions.getEndpointAccess()- Parameters:
endpointAccess- Configure access to the Kubernetes API server endpoint..- Returns:
this
-
ipFamily
Sets the value ofClusterCommonOptions.getIpFamily()- 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) Sets the value ofClusterCommonOptions.getKubectlProviderOptions()- Parameters:
kubectlProviderOptions- Options for creating the kubectl provider - a lambda function that executeskubectlandhelmagainst the cluster. If defined,kubectlLayeris a required property.- Returns:
this
-
mastersRole
Sets the value ofClusterCommonOptions.getMastersRole()- Parameters:
mastersRole- An IAM role that will be added to thesystem:mastersKubernetes RBAC group.- Returns:
this
-
prune
Sets the value ofClusterCommonOptions.getPrune()- Parameters:
prune- Indicates whether Kubernetes resources added throughaddManifest()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 thekubectl applyoperation with the--pruneswitch.- Returns:
this
-
remoteNodeNetworks
@Stability(Stable) public ClusterProps.Builder remoteNodeNetworks(List<? extends RemoteNodeNetwork> remoteNodeNetworks) Sets the value ofClusterCommonOptions.getRemoteNodeNetworks()- 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) Sets the value ofClusterCommonOptions.getRemotePodNetworks()- Parameters:
remotePodNetworks- IPv4 CIDR blocks for Pods running Kubernetes webhooks on hybrid nodes.- Returns:
this
-
removalPolicy
Sets the value ofClusterCommonOptions.getRemovalPolicy()- 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
Sets the value ofClusterCommonOptions.getRole()- Parameters:
role- Role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on your behalf.- Returns:
this
-
secretsEncryptionKey
Sets the value ofClusterCommonOptions.getSecretsEncryptionKey()- Parameters:
secretsEncryptionKey- KMS secret for envelope encryption for Kubernetes secrets.- Returns:
this
-
securityGroup
Sets the value ofClusterCommonOptions.getSecurityGroup()- Parameters:
securityGroup- Security Group to use for Control Plane ENIs.- Returns:
this
-
serviceIpv4Cidr
Sets the value ofClusterCommonOptions.getServiceIpv4Cidr()- Parameters:
serviceIpv4Cidr- The CIDR block to assign Kubernetes service IP addresses from.- Returns:
this
-
tags
Sets the value ofClusterCommonOptions.getTags()- Parameters:
tags- The tags assigned to the EKS cluster.- Returns:
this
-
vpc
Sets the value ofClusterCommonOptions.getVpc()- Parameters:
vpc- The VPC in which to create the Cluster.- Returns:
this
-
vpcSubnets
@Stability(Stable) public ClusterProps.Builder vpcSubnets(List<? extends SubnetSelection> vpcSubnets) Sets the value ofClusterCommonOptions.getVpcSubnets()- 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
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<ClusterProps>- Returns:
- a new instance of
ClusterProps - Throws:
NullPointerException- if any required attribute was not provided
-