Class ClusterProps.Builder
java.lang.Object
software.amazon.awscdk.services.eks.v2.alpha.ClusterProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<ClusterProps>
- Enclosing interface:
ClusterProps
@Stability(Experimental)
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()
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()
Sets the value ofClusterCommonOptions.getRole()
secretsEncryptionKey
(IKey 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(Experimental) 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
-
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.addAutoScalingGroupCapacity
to add additional customized capacity. Set this to0
is you wish to avoid the initial capacity allocation.- Returns:
this
-
defaultCapacityInstance
@Stability(Experimental) 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 ifdefaultCapacity
is > 0.- Returns:
this
-
defaultCapacityType
@Stability(Experimental) public ClusterProps.Builder defaultCapacityType(DefaultCapacityType defaultCapacityType) Sets the value ofClusterProps.getDefaultCapacityType()
- Parameters:
defaultCapacityType
- The default capacity type for the cluster.- Returns:
this
-
outputConfigCommand
@Stability(Experimental) public ClusterProps.Builder outputConfigCommand(Boolean outputConfigCommand) Sets the value ofClusterProps.getOutputConfigCommand()
- Parameters:
outputConfigCommand
- Determines whether a CloudFormation output with theaws 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
Sets the value ofClusterCommonOptions.getVersion()
- Parameters:
version
- The Kubernetes version to run in the cluster. This parameter is required.- Returns:
this
-
albController
@Stability(Experimental) public ClusterProps.Builder albController(AlbControllerOptions albController) Sets the value ofClusterCommonOptions.getAlbController()
- Parameters:
albController
- Install the AWS Load Balancer Controller onto the cluster.- Returns:
this
-
clusterLogging
@Stability(Experimental) 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(Experimental) 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(Experimental) public ClusterProps.Builder kubectlProviderOptions(KubectlProviderOptions kubectlProviderOptions) Sets the value ofClusterCommonOptions.getKubectlProviderOptions()
- Parameters:
kubectlProviderOptions
- Options for creating the kubectl provider - a lambda function that executeskubectl
andhelm
against the cluster. If defined,kubectlLayer
is a required property.If not defined, kubectl provider will not be created by default.
- Returns:
this
-
mastersRole
Sets the value ofClusterCommonOptions.getMastersRole()
- Parameters:
mastersRole
- An IAM role that will be added to thesystem:masters
Kubernetes 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 apply
operation with the--prune
switch.- 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
@Stability(Experimental) public ClusterProps.Builder secretsEncryptionKey(IKey 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(Experimental) 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:
build
in interfacesoftware.amazon.jsii.Builder<ClusterProps>
- Returns:
- a new instance of
ClusterProps
- Throws:
NullPointerException
- if any required attribute was not provided
-