Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.eks.model.CreateNodegroupRequest Maven / Gradle / Ivy
Go to download
The AWS Java SDK for EKS module holds the client classes that are used for
communicating with EKS.
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.eks.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.DefaultValueTrait;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class CreateNodegroupRequest extends EksRequest implements
ToCopyableBuilder {
private static final SdkField CLUSTER_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("clusterName").getter(getter(CreateNodegroupRequest::clusterName)).setter(setter(Builder::clusterName))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("name").build()).build();
private static final SdkField NODEGROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("nodegroupName").getter(getter(CreateNodegroupRequest::nodegroupName))
.setter(setter(Builder::nodegroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("nodegroupName").build()).build();
private static final SdkField SCALING_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("scalingConfig")
.getter(getter(CreateNodegroupRequest::scalingConfig)).setter(setter(Builder::scalingConfig))
.constructor(NodegroupScalingConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("scalingConfig").build()).build();
private static final SdkField DISK_SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("diskSize").getter(getter(CreateNodegroupRequest::diskSize)).setter(setter(Builder::diskSize))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("diskSize").build()).build();
private static final SdkField> SUBNETS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("subnets")
.getter(getter(CreateNodegroupRequest::subnets))
.setter(setter(Builder::subnets))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("subnets").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> INSTANCE_TYPES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("instanceTypes")
.getter(getter(CreateNodegroupRequest::instanceTypes))
.setter(setter(Builder::instanceTypes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("instanceTypes").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField AMI_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("amiType").getter(getter(CreateNodegroupRequest::amiTypeAsString)).setter(setter(Builder::amiType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("amiType").build()).build();
private static final SdkField REMOTE_ACCESS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("remoteAccess")
.getter(getter(CreateNodegroupRequest::remoteAccess)).setter(setter(Builder::remoteAccess))
.constructor(RemoteAccessConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("remoteAccess").build()).build();
private static final SdkField NODE_ROLE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("nodeRole").getter(getter(CreateNodegroupRequest::nodeRole)).setter(setter(Builder::nodeRole))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("nodeRole").build()).build();
private static final SdkField> LABELS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("labels")
.getter(getter(CreateNodegroupRequest::labels))
.setter(setter(Builder::labels))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("labels").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField> TAINTS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("taints")
.getter(getter(CreateNodegroupRequest::taints))
.setter(setter(Builder::taints))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("taints").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Taint::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("tags")
.getter(getter(CreateNodegroupRequest::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField CLIENT_REQUEST_TOKEN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("clientRequestToken")
.getter(getter(CreateNodegroupRequest::clientRequestToken))
.setter(setter(Builder::clientRequestToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("clientRequestToken").build(),
DefaultValueTrait.idempotencyToken()).build();
private static final SdkField LAUNCH_TEMPLATE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("launchTemplate")
.getter(getter(CreateNodegroupRequest::launchTemplate)).setter(setter(Builder::launchTemplate))
.constructor(LaunchTemplateSpecification::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("launchTemplate").build()).build();
private static final SdkField UPDATE_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("updateConfig")
.getter(getter(CreateNodegroupRequest::updateConfig)).setter(setter(Builder::updateConfig))
.constructor(NodegroupUpdateConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("updateConfig").build()).build();
private static final SdkField CAPACITY_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("capacityType").getter(getter(CreateNodegroupRequest::capacityTypeAsString))
.setter(setter(Builder::capacityType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("capacityType").build()).build();
private static final SdkField VERSION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("version")
.getter(getter(CreateNodegroupRequest::version)).setter(setter(Builder::version))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("version").build()).build();
private static final SdkField RELEASE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("releaseVersion").getter(getter(CreateNodegroupRequest::releaseVersion))
.setter(setter(Builder::releaseVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("releaseVersion").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLUSTER_NAME_FIELD,
NODEGROUP_NAME_FIELD, SCALING_CONFIG_FIELD, DISK_SIZE_FIELD, SUBNETS_FIELD, INSTANCE_TYPES_FIELD, AMI_TYPE_FIELD,
REMOTE_ACCESS_FIELD, NODE_ROLE_FIELD, LABELS_FIELD, TAINTS_FIELD, TAGS_FIELD, CLIENT_REQUEST_TOKEN_FIELD,
LAUNCH_TEMPLATE_FIELD, UPDATE_CONFIG_FIELD, CAPACITY_TYPE_FIELD, VERSION_FIELD, RELEASE_VERSION_FIELD));
private final String clusterName;
private final String nodegroupName;
private final NodegroupScalingConfig scalingConfig;
private final Integer diskSize;
private final List subnets;
private final List instanceTypes;
private final String amiType;
private final RemoteAccessConfig remoteAccess;
private final String nodeRole;
private final Map labels;
private final List taints;
private final Map tags;
private final String clientRequestToken;
private final LaunchTemplateSpecification launchTemplate;
private final NodegroupUpdateConfig updateConfig;
private final String capacityType;
private final String version;
private final String releaseVersion;
private CreateNodegroupRequest(BuilderImpl builder) {
super(builder);
this.clusterName = builder.clusterName;
this.nodegroupName = builder.nodegroupName;
this.scalingConfig = builder.scalingConfig;
this.diskSize = builder.diskSize;
this.subnets = builder.subnets;
this.instanceTypes = builder.instanceTypes;
this.amiType = builder.amiType;
this.remoteAccess = builder.remoteAccess;
this.nodeRole = builder.nodeRole;
this.labels = builder.labels;
this.taints = builder.taints;
this.tags = builder.tags;
this.clientRequestToken = builder.clientRequestToken;
this.launchTemplate = builder.launchTemplate;
this.updateConfig = builder.updateConfig;
this.capacityType = builder.capacityType;
this.version = builder.version;
this.releaseVersion = builder.releaseVersion;
}
/**
*
* The name of your cluster.
*
*
* @return The name of your cluster.
*/
public final String clusterName() {
return clusterName;
}
/**
*
* The unique name to give your node group.
*
*
* @return The unique name to give your node group.
*/
public final String nodegroupName() {
return nodegroupName;
}
/**
*
* The scaling configuration details for the Auto Scaling group that is created for your node group.
*
*
* @return The scaling configuration details for the Auto Scaling group that is created for your node group.
*/
public final NodegroupScalingConfig scalingConfig() {
return scalingConfig;
}
/**
*
* The root device disk size (in GiB) for your node group instances. The default disk size is 20 GiB for Linux and
* Bottlerocket. The default disk size is 50 GiB for Windows. If you specify launchTemplate
, then don't
* specify diskSize
, or the node group deployment will fail. For more information about using launch
* templates with Amazon EKS, see Launch template support in the
* Amazon EKS User Guide .
*
*
* @return The root device disk size (in GiB) for your node group instances. The default disk size is 20 GiB for
* Linux and Bottlerocket. The default disk size is 50 GiB for Windows. If you specify
* launchTemplate
, then don't specify diskSize
, or the node group deployment will
* fail. For more information about using launch templates with Amazon EKS, see Launch template support
* in the Amazon EKS User Guide .
*/
public final Integer diskSize() {
return diskSize;
}
/**
* For responses, this returns true if the service returned a value for the Subnets property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasSubnets() {
return subnets != null && !(subnets instanceof SdkAutoConstructList);
}
/**
*
* The subnets to use for the Auto Scaling group that is created for your node group. If you specify
* launchTemplate
, then don't specify
* SubnetId
* in your launch template, or the node group deployment will fail. For more information about using launch
* templates with Amazon EKS, see Launch template support in the
* Amazon EKS User Guide .
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSubnets} method.
*
*
* @return The subnets to use for the Auto Scaling group that is created for your node group. If you specify
* launchTemplate
, then don't specify
* SubnetId
* in your launch template, or the node group deployment will fail. For more information about using launch
* templates with Amazon EKS, see Launch template support
* in the Amazon EKS User Guide .
*/
public final List subnets() {
return subnets;
}
/**
* For responses, this returns true if the service returned a value for the InstanceTypes property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasInstanceTypes() {
return instanceTypes != null && !(instanceTypes instanceof SdkAutoConstructList);
}
/**
*
* Specify the instance types for a node group. If you specify a GPU instance type, make sure to also specify an
* applicable GPU AMI type with the amiType
parameter. If you specify launchTemplate
, then
* you can specify zero or one instance type in your launch template or you can specify 0-20 instance types
* for instanceTypes
. If however, you specify an instance type in your launch template and
* specify any instanceTypes
, the node group deployment will fail. If you don't specify an instance
* type in a launch template or for instanceTypes
, then t3.medium
is used, by default. If
* you specify Spot
for capacityType
, then we recommend specifying multiple values for
* instanceTypes
. For more information, see Managed node group capacity types and Launch template support in the
* Amazon EKS User Guide .
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasInstanceTypes} method.
*
*
* @return Specify the instance types for a node group. If you specify a GPU instance type, make sure to also
* specify an applicable GPU AMI type with the amiType
parameter. If you specify
* launchTemplate
, then you can specify zero or one instance type in your launch template
* or you can specify 0-20 instance types for instanceTypes
. If however, you specify an
* instance type in your launch template and specify any instanceTypes
, the node group
* deployment will fail. If you don't specify an instance type in a launch template or for
* instanceTypes
, then t3.medium
is used, by default. If you specify
* Spot
for capacityType
, then we recommend specifying multiple values for
* instanceTypes
. For more information, see Managed node group capacity types and Launch template support
* in the Amazon EKS User Guide .
*/
public final List instanceTypes() {
return instanceTypes;
}
/**
*
* The AMI type for your node group. If you specify launchTemplate
, and your launch template uses a
* custom AMI, then don't specify amiType
, or the node group deployment will fail. If your launch
* template uses a Windows custom AMI, then add eks:kube-proxy-windows
to your Windows nodes
* rolearn
in the aws-auth
ConfigMap
. For more information about using launch
* templates with Amazon EKS, see Launch template support in the
* Amazon EKS User Guide .
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #amiType} will
* return {@link AMITypes#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #amiTypeAsString}.
*
*
* @return The AMI type for your node group. If you specify launchTemplate
, and your launch template
* uses a custom AMI, then don't specify amiType
, or the node group deployment will fail. If
* your launch template uses a Windows custom AMI, then add eks:kube-proxy-windows
to your
* Windows nodes rolearn
in the aws-auth
ConfigMap
. For more
* information about using launch templates with Amazon EKS, see Launch template support
* in the Amazon EKS User Guide .
* @see AMITypes
*/
public final AMITypes amiType() {
return AMITypes.fromValue(amiType);
}
/**
*
* The AMI type for your node group. If you specify launchTemplate
, and your launch template uses a
* custom AMI, then don't specify amiType
, or the node group deployment will fail. If your launch
* template uses a Windows custom AMI, then add eks:kube-proxy-windows
to your Windows nodes
* rolearn
in the aws-auth
ConfigMap
. For more information about using launch
* templates with Amazon EKS, see Launch template support in the
* Amazon EKS User Guide .
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #amiType} will
* return {@link AMITypes#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #amiTypeAsString}.
*
*
* @return The AMI type for your node group. If you specify launchTemplate
, and your launch template
* uses a custom AMI, then don't specify amiType
, or the node group deployment will fail. If
* your launch template uses a Windows custom AMI, then add eks:kube-proxy-windows
to your
* Windows nodes rolearn
in the aws-auth
ConfigMap
. For more
* information about using launch templates with Amazon EKS, see Launch template support
* in the Amazon EKS User Guide .
* @see AMITypes
*/
public final String amiTypeAsString() {
return amiType;
}
/**
*
* The remote access configuration to use with your node group. For Linux, the protocol is SSH. For Windows, the
* protocol is RDP. If you specify launchTemplate
, then don't specify remoteAccess
, or the
* node group deployment will fail. For more information about using launch templates with Amazon EKS, see Launch template support in the
* Amazon EKS User Guide .
*
*
* @return The remote access configuration to use with your node group. For Linux, the protocol is SSH. For Windows,
* the protocol is RDP. If you specify launchTemplate
, then don't specify
* remoteAccess
, or the node group deployment will fail. For more information about using
* launch templates with Amazon EKS, see Launch template support
* in the Amazon EKS User Guide .
*/
public final RemoteAccessConfig remoteAccess() {
return remoteAccess;
}
/**
*
* The Amazon Resource Name (ARN) of the IAM role to associate with your node group. The Amazon EKS worker node
* kubelet
daemon makes calls to Amazon Web Services APIs on your behalf. Nodes receive permissions for
* these API calls through an IAM instance profile and associated policies. Before you can launch nodes and register
* them into a cluster, you must create an IAM role for those nodes to use when they are launched. For more
* information, see Amazon EKS node
* IAM role in the Amazon EKS User Guide . If you specify launchTemplate
, then don't
* specify
* IamInstanceProfile
* in your launch template, or the node group deployment will fail. For more information about using launch
* templates with Amazon EKS, see Launch template support in the
* Amazon EKS User Guide .
*
*
* @return The Amazon Resource Name (ARN) of the IAM role to associate with your node group. The Amazon EKS worker
* node kubelet
daemon makes calls to Amazon Web Services APIs on your behalf. Nodes receive
* permissions for these API calls through an IAM instance profile and associated policies. Before you can
* launch nodes and register them into a cluster, you must create an IAM role for those nodes to use when
* they are launched. For more information, see Amazon EKS node IAM
* role in the Amazon EKS User Guide . If you specify launchTemplate
, then
* don't specify
* IamInstanceProfile
* in your launch template, or the node group deployment will fail. For more information about using launch
* templates with Amazon EKS, see Launch template support
* in the Amazon EKS User Guide .
*/
public final String nodeRole() {
return nodeRole;
}
/**
* For responses, this returns true if the service returned a value for the Labels property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasLabels() {
return labels != null && !(labels instanceof SdkAutoConstructMap);
}
/**
*
* The Kubernetes labels
to apply to the nodes in the node group when they are created.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasLabels} method.
*
*
* @return The Kubernetes labels
to apply to the nodes in the node group when they are created.
*/
public final Map labels() {
return labels;
}
/**
* For responses, this returns true if the service returned a value for the Taints property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasTaints() {
return taints != null && !(taints instanceof SdkAutoConstructList);
}
/**
*
* The Kubernetes taints to be applied to the nodes in the node group. For more information, see Node taints on
* managed node groups .
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasTaints} method.
*
*
* @return The Kubernetes taints to be applied to the nodes in the node group. For more information, see Node taints
* on managed node groups .
*/
public final List taints() {
return taints;
}
/**
* For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructMap);
}
/**
*
* Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You
* define both. Tags don't propagate to any other cluster or Amazon Web Services resources.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasTags} method.
*
*
* @return Metadata that assists with categorization and organization. Each tag consists of a key and an optional
* value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.
*/
public final Map tags() {
return tags;
}
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*
*
* @return A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*/
public final String clientRequestToken() {
return clientRequestToken;
}
/**
*
* An object representing a node group's launch template specification. If specified, then do not specify
* instanceTypes
, diskSize
, or remoteAccess
and make sure that the launch
* template meets the requirements in launchTemplateSpecification
.
*
*
* @return An object representing a node group's launch template specification. If specified, then do not specify
* instanceTypes
, diskSize
, or remoteAccess
and make sure that the
* launch template meets the requirements in launchTemplateSpecification
.
*/
public final LaunchTemplateSpecification launchTemplate() {
return launchTemplate;
}
/**
*
* The node group update configuration.
*
*
* @return The node group update configuration.
*/
public final NodegroupUpdateConfig updateConfig() {
return updateConfig;
}
/**
*
* The capacity type for your node group.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #capacityType} will
* return {@link CapacityTypes#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #capacityTypeAsString}.
*
*
* @return The capacity type for your node group.
* @see CapacityTypes
*/
public final CapacityTypes capacityType() {
return CapacityTypes.fromValue(capacityType);
}
/**
*
* The capacity type for your node group.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #capacityType} will
* return {@link CapacityTypes#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #capacityTypeAsString}.
*
*
* @return The capacity type for your node group.
* @see CapacityTypes
*/
public final String capacityTypeAsString() {
return capacityType;
}
/**
*
* The Kubernetes version to use for your managed nodes. By default, the Kubernetes version of the cluster is used,
* and this is the only accepted specified value. If you specify launchTemplate
, and your launch
* template uses a custom AMI, then don't specify version
, or the node group deployment will fail. For
* more information about using launch templates with Amazon EKS, see Launch template support in the
* Amazon EKS User Guide .
*
*
* @return The Kubernetes version to use for your managed nodes. By default, the Kubernetes version of the cluster
* is used, and this is the only accepted specified value. If you specify launchTemplate
, and
* your launch template uses a custom AMI, then don't specify version
, or the node group
* deployment will fail. For more information about using launch templates with Amazon EKS, see Launch template support
* in the Amazon EKS User Guide .
*/
public final String version() {
return version;
}
/**
*
* The AMI version of the Amazon EKS optimized AMI to use with your node group. By default, the latest available AMI
* version for the node group's current Kubernetes version is used. For information about Linux versions, see Amazon EKS optimized Amazon
* Linux AMI versions in the Amazon EKS User Guide . Amazon EKS managed node groups support the November
* 2022 and later releases of the Windows AMIs. For information about Windows versions, see Amazon EKS optimized
* Windows AMI versions in the Amazon EKS User Guide .
*
*
* If you specify launchTemplate
, and your launch template uses a custom AMI, then don't specify
* releaseVersion
, or the node group deployment will fail. For more information about using launch
* templates with Amazon EKS, see Launch template support in the
* Amazon EKS User Guide .
*
*
* @return The AMI version of the Amazon EKS optimized AMI to use with your node group. By default, the latest
* available AMI version for the node group's current Kubernetes version is used. For information about
* Linux versions, see Amazon EKS optimized
* Amazon Linux AMI versions in the Amazon EKS User Guide . Amazon EKS managed node groups support
* the November 2022 and later releases of the Windows AMIs. For information about Windows versions, see Amazon EKS
* optimized Windows AMI versions in the Amazon EKS User Guide .
*
* If you specify launchTemplate
, and your launch template uses a custom AMI, then don't
* specify releaseVersion
, or the node group deployment will fail. For more information about
* using launch templates with Amazon EKS, see Launch template support
* in the Amazon EKS User Guide .
*/
public final String releaseVersion() {
return releaseVersion;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(clusterName());
hashCode = 31 * hashCode + Objects.hashCode(nodegroupName());
hashCode = 31 * hashCode + Objects.hashCode(scalingConfig());
hashCode = 31 * hashCode + Objects.hashCode(diskSize());
hashCode = 31 * hashCode + Objects.hashCode(hasSubnets() ? subnets() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasInstanceTypes() ? instanceTypes() : null);
hashCode = 31 * hashCode + Objects.hashCode(amiTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(remoteAccess());
hashCode = 31 * hashCode + Objects.hashCode(nodeRole());
hashCode = 31 * hashCode + Objects.hashCode(hasLabels() ? labels() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasTaints() ? taints() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
hashCode = 31 * hashCode + Objects.hashCode(clientRequestToken());
hashCode = 31 * hashCode + Objects.hashCode(launchTemplate());
hashCode = 31 * hashCode + Objects.hashCode(updateConfig());
hashCode = 31 * hashCode + Objects.hashCode(capacityTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(version());
hashCode = 31 * hashCode + Objects.hashCode(releaseVersion());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof CreateNodegroupRequest)) {
return false;
}
CreateNodegroupRequest other = (CreateNodegroupRequest) obj;
return Objects.equals(clusterName(), other.clusterName()) && Objects.equals(nodegroupName(), other.nodegroupName())
&& Objects.equals(scalingConfig(), other.scalingConfig()) && Objects.equals(diskSize(), other.diskSize())
&& hasSubnets() == other.hasSubnets() && Objects.equals(subnets(), other.subnets())
&& hasInstanceTypes() == other.hasInstanceTypes() && Objects.equals(instanceTypes(), other.instanceTypes())
&& Objects.equals(amiTypeAsString(), other.amiTypeAsString())
&& Objects.equals(remoteAccess(), other.remoteAccess()) && Objects.equals(nodeRole(), other.nodeRole())
&& hasLabels() == other.hasLabels() && Objects.equals(labels(), other.labels())
&& hasTaints() == other.hasTaints() && Objects.equals(taints(), other.taints()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags()) && Objects.equals(clientRequestToken(), other.clientRequestToken())
&& Objects.equals(launchTemplate(), other.launchTemplate())
&& Objects.equals(updateConfig(), other.updateConfig())
&& Objects.equals(capacityTypeAsString(), other.capacityTypeAsString())
&& Objects.equals(version(), other.version()) && Objects.equals(releaseVersion(), other.releaseVersion());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("CreateNodegroupRequest").add("ClusterName", clusterName()).add("NodegroupName", nodegroupName())
.add("ScalingConfig", scalingConfig()).add("DiskSize", diskSize())
.add("Subnets", hasSubnets() ? subnets() : null)
.add("InstanceTypes", hasInstanceTypes() ? instanceTypes() : null).add("AmiType", amiTypeAsString())
.add("RemoteAccess", remoteAccess()).add("NodeRole", nodeRole()).add("Labels", hasLabels() ? labels() : null)
.add("Taints", hasTaints() ? taints() : null).add("Tags", hasTags() ? tags() : null)
.add("ClientRequestToken", clientRequestToken()).add("LaunchTemplate", launchTemplate())
.add("UpdateConfig", updateConfig()).add("CapacityType", capacityTypeAsString()).add("Version", version())
.add("ReleaseVersion", releaseVersion()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "clusterName":
return Optional.ofNullable(clazz.cast(clusterName()));
case "nodegroupName":
return Optional.ofNullable(clazz.cast(nodegroupName()));
case "scalingConfig":
return Optional.ofNullable(clazz.cast(scalingConfig()));
case "diskSize":
return Optional.ofNullable(clazz.cast(diskSize()));
case "subnets":
return Optional.ofNullable(clazz.cast(subnets()));
case "instanceTypes":
return Optional.ofNullable(clazz.cast(instanceTypes()));
case "amiType":
return Optional.ofNullable(clazz.cast(amiTypeAsString()));
case "remoteAccess":
return Optional.ofNullable(clazz.cast(remoteAccess()));
case "nodeRole":
return Optional.ofNullable(clazz.cast(nodeRole()));
case "labels":
return Optional.ofNullable(clazz.cast(labels()));
case "taints":
return Optional.ofNullable(clazz.cast(taints()));
case "tags":
return Optional.ofNullable(clazz.cast(tags()));
case "clientRequestToken":
return Optional.ofNullable(clazz.cast(clientRequestToken()));
case "launchTemplate":
return Optional.ofNullable(clazz.cast(launchTemplate()));
case "updateConfig":
return Optional.ofNullable(clazz.cast(updateConfig()));
case "capacityType":
return Optional.ofNullable(clazz.cast(capacityTypeAsString()));
case "version":
return Optional.ofNullable(clazz.cast(version()));
case "releaseVersion":
return Optional.ofNullable(clazz.cast(releaseVersion()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((CreateNodegroupRequest) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends EksRequest.Builder, SdkPojo, CopyableBuilder {
/**
*
* The name of your cluster.
*
*
* @param clusterName
* The name of your cluster.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder clusterName(String clusterName);
/**
*
* The unique name to give your node group.
*
*
* @param nodegroupName
* The unique name to give your node group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder nodegroupName(String nodegroupName);
/**
*
* The scaling configuration details for the Auto Scaling group that is created for your node group.
*
*
* @param scalingConfig
* The scaling configuration details for the Auto Scaling group that is created for your node group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder scalingConfig(NodegroupScalingConfig scalingConfig);
/**
*
* The scaling configuration details for the Auto Scaling group that is created for your node group.
*
* This is a convenience method that creates an instance of the {@link NodegroupScalingConfig.Builder} avoiding
* the need to create one manually via {@link NodegroupScalingConfig#builder()}.
*
*
* When the {@link Consumer} completes, {@link NodegroupScalingConfig.Builder#build()} is called immediately and
* its result is passed to {@link #scalingConfig(NodegroupScalingConfig)}.
*
* @param scalingConfig
* a consumer that will call methods on {@link NodegroupScalingConfig.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #scalingConfig(NodegroupScalingConfig)
*/
default Builder scalingConfig(Consumer scalingConfig) {
return scalingConfig(NodegroupScalingConfig.builder().applyMutation(scalingConfig).build());
}
/**
*
* The root device disk size (in GiB) for your node group instances. The default disk size is 20 GiB for Linux
* and Bottlerocket. The default disk size is 50 GiB for Windows. If you specify launchTemplate
,
* then don't specify diskSize
, or the node group deployment will fail. For more information about
* using launch templates with Amazon EKS, see Launch template support in
* the Amazon EKS User Guide .
*
*
* @param diskSize
* The root device disk size (in GiB) for your node group instances. The default disk size is 20 GiB for
* Linux and Bottlerocket. The default disk size is 50 GiB for Windows. If you specify
* launchTemplate
, then don't specify diskSize
, or the node group deployment
* will fail. For more information about using launch templates with Amazon EKS, see Launch template
* support in the Amazon EKS User Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder diskSize(Integer diskSize);
/**
*
* The subnets to use for the Auto Scaling group that is created for your node group. If you specify
* launchTemplate
, then don't specify
* SubnetId
* in your launch template, or the node group deployment will fail. For more information about using launch
* templates with Amazon EKS, see Launch template support in
* the Amazon EKS User Guide .
*
*
* @param subnets
* The subnets to use for the Auto Scaling group that is created for your node group. If you specify
* launchTemplate
, then don't specify
* SubnetId
* in your launch template, or the node group deployment will fail. For more information about using
* launch templates with Amazon EKS, see Launch template
* support in the Amazon EKS User Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder subnets(Collection subnets);
/**
*
* The subnets to use for the Auto Scaling group that is created for your node group. If you specify
* launchTemplate
, then don't specify
* SubnetId
* in your launch template, or the node group deployment will fail. For more information about using launch
* templates with Amazon EKS, see Launch template support in
* the Amazon EKS User Guide .
*
*
* @param subnets
* The subnets to use for the Auto Scaling group that is created for your node group. If you specify
* launchTemplate
, then don't specify
* SubnetId
* in your launch template, or the node group deployment will fail. For more information about using
* launch templates with Amazon EKS, see Launch template
* support in the Amazon EKS User Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder subnets(String... subnets);
/**
*
* Specify the instance types for a node group. If you specify a GPU instance type, make sure to also specify an
* applicable GPU AMI type with the amiType
parameter. If you specify launchTemplate
,
* then you can specify zero or one instance type in your launch template or you can specify 0-20
* instance types for instanceTypes
. If however, you specify an instance type in your launch
* template and specify any instanceTypes
, the node group deployment will fail. If you don't
* specify an instance type in a launch template or for instanceTypes
, then t3.medium
* is used, by default. If you specify Spot
for capacityType
, then we recommend
* specifying multiple values for instanceTypes
. For more information, see Managed node group capacity types and Launch template support in
* the Amazon EKS User Guide .
*
*
* @param instanceTypes
* Specify the instance types for a node group. If you specify a GPU instance type, make sure to also
* specify an applicable GPU AMI type with the amiType
parameter. If you specify
* launchTemplate
, then you can specify zero or one instance type in your launch template
* or you can specify 0-20 instance types for instanceTypes
. If however, you specify
* an instance type in your launch template and specify any instanceTypes
, the node
* group deployment will fail. If you don't specify an instance type in a launch template or for
* instanceTypes
, then t3.medium
is used, by default. If you specify
* Spot
for capacityType
, then we recommend specifying multiple values for
* instanceTypes
. For more information, see Managed node group capacity types and Launch template
* support in the Amazon EKS User Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder instanceTypes(Collection instanceTypes);
/**
*
* Specify the instance types for a node group. If you specify a GPU instance type, make sure to also specify an
* applicable GPU AMI type with the amiType
parameter. If you specify launchTemplate
,
* then you can specify zero or one instance type in your launch template or you can specify 0-20
* instance types for instanceTypes
. If however, you specify an instance type in your launch
* template and specify any instanceTypes
, the node group deployment will fail. If you don't
* specify an instance type in a launch template or for instanceTypes
, then t3.medium
* is used, by default. If you specify Spot
for capacityType
, then we recommend
* specifying multiple values for instanceTypes
. For more information, see Managed node group capacity types and Launch template support in
* the Amazon EKS User Guide .
*
*
* @param instanceTypes
* Specify the instance types for a node group. If you specify a GPU instance type, make sure to also
* specify an applicable GPU AMI type with the amiType
parameter. If you specify
* launchTemplate
, then you can specify zero or one instance type in your launch template
* or you can specify 0-20 instance types for instanceTypes
. If however, you specify
* an instance type in your launch template and specify any instanceTypes
, the node
* group deployment will fail. If you don't specify an instance type in a launch template or for
* instanceTypes
, then t3.medium
is used, by default. If you specify
* Spot
for capacityType
, then we recommend specifying multiple values for
* instanceTypes
. For more information, see Managed node group capacity types and Launch template
* support in the Amazon EKS User Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder instanceTypes(String... instanceTypes);
/**
*
* The AMI type for your node group. If you specify launchTemplate
, and your launch template uses a
* custom AMI, then don't specify amiType
, or the node group deployment will fail. If your launch
* template uses a Windows custom AMI, then add eks:kube-proxy-windows
to your Windows nodes
* rolearn
in the aws-auth
ConfigMap
. For more information about using
* launch templates with Amazon EKS, see Launch template support in
* the Amazon EKS User Guide .
*
*
* @param amiType
* The AMI type for your node group. If you specify launchTemplate
, and your launch template
* uses a custom AMI, then don't specify amiType
, or the node group deployment will fail. If
* your launch template uses a Windows custom AMI, then add eks:kube-proxy-windows
to your
* Windows nodes rolearn
in the aws-auth
ConfigMap
. For more
* information about using launch templates with Amazon EKS, see Launch template
* support in the Amazon EKS User Guide .
* @see AMITypes
* @return Returns a reference to this object so that method calls can be chained together.
* @see AMITypes
*/
Builder amiType(String amiType);
/**
*
* The AMI type for your node group. If you specify launchTemplate
, and your launch template uses a
* custom AMI, then don't specify amiType
, or the node group deployment will fail. If your launch
* template uses a Windows custom AMI, then add eks:kube-proxy-windows
to your Windows nodes
* rolearn
in the aws-auth
ConfigMap
. For more information about using
* launch templates with Amazon EKS, see Launch template support in
* the Amazon EKS User Guide .
*
*
* @param amiType
* The AMI type for your node group. If you specify launchTemplate
, and your launch template
* uses a custom AMI, then don't specify amiType
, or the node group deployment will fail. If
* your launch template uses a Windows custom AMI, then add eks:kube-proxy-windows
to your
* Windows nodes rolearn
in the aws-auth
ConfigMap
. For more
* information about using launch templates with Amazon EKS, see Launch template
* support in the Amazon EKS User Guide .
* @see AMITypes
* @return Returns a reference to this object so that method calls can be chained together.
* @see AMITypes
*/
Builder amiType(AMITypes amiType);
/**
*
* The remote access configuration to use with your node group. For Linux, the protocol is SSH. For Windows, the
* protocol is RDP. If you specify launchTemplate
, then don't specify remoteAccess
, or
* the node group deployment will fail. For more information about using launch templates with Amazon EKS, see
* Launch template support
* in the Amazon EKS User Guide .
*
*
* @param remoteAccess
* The remote access configuration to use with your node group. For Linux, the protocol is SSH. For
* Windows, the protocol is RDP. If you specify launchTemplate
, then don't specify
* remoteAccess
, or the node group deployment will fail. For more information about using
* launch templates with Amazon EKS, see Launch template
* support in the Amazon EKS User Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder remoteAccess(RemoteAccessConfig remoteAccess);
/**
*
* The remote access configuration to use with your node group. For Linux, the protocol is SSH. For Windows, the
* protocol is RDP. If you specify launchTemplate
, then don't specify remoteAccess
, or
* the node group deployment will fail. For more information about using launch templates with Amazon EKS, see
* Launch template support
* in the Amazon EKS User Guide .
*
* This is a convenience method that creates an instance of the {@link RemoteAccessConfig.Builder} avoiding the
* need to create one manually via {@link RemoteAccessConfig#builder()}.
*
*
* When the {@link Consumer} completes, {@link RemoteAccessConfig.Builder#build()} is called immediately and its
* result is passed to {@link #remoteAccess(RemoteAccessConfig)}.
*
* @param remoteAccess
* a consumer that will call methods on {@link RemoteAccessConfig.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #remoteAccess(RemoteAccessConfig)
*/
default Builder remoteAccess(Consumer remoteAccess) {
return remoteAccess(RemoteAccessConfig.builder().applyMutation(remoteAccess).build());
}
/**
*
* The Amazon Resource Name (ARN) of the IAM role to associate with your node group. The Amazon EKS worker node
* kubelet
daemon makes calls to Amazon Web Services APIs on your behalf. Nodes receive permissions
* for these API calls through an IAM instance profile and associated policies. Before you can launch nodes and
* register them into a cluster, you must create an IAM role for those nodes to use when they are launched. For
* more information, see Amazon
* EKS node IAM role in the Amazon EKS User Guide . If you specify
* launchTemplate
, then don't specify
* IamInstanceProfile
* in your launch template, or the node group deployment will fail. For more information about using launch
* templates with Amazon EKS, see Launch template support in
* the Amazon EKS User Guide .
*
*
* @param nodeRole
* The Amazon Resource Name (ARN) of the IAM role to associate with your node group. The Amazon EKS
* worker node kubelet
daemon makes calls to Amazon Web Services APIs on your behalf. Nodes
* receive permissions for these API calls through an IAM instance profile and associated policies.
* Before you can launch nodes and register them into a cluster, you must create an IAM role for those
* nodes to use when they are launched. For more information, see Amazon EKS node IAM
* role in the Amazon EKS User Guide . If you specify launchTemplate
,
* then don't specify
* IamInstanceProfile
* in your launch template, or the node group deployment will fail. For more information about using
* launch templates with Amazon EKS, see Launch template
* support in the Amazon EKS User Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder nodeRole(String nodeRole);
/**
*
* The Kubernetes labels
to apply to the nodes in the node group when they are created.
*
*
* @param labels
* The Kubernetes labels
to apply to the nodes in the node group when they are created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder labels(Map labels);
/**
*
* The Kubernetes taints to be applied to the nodes in the node group. For more information, see Node taints on
* managed node groups .
*
*
* @param taints
* The Kubernetes taints to be applied to the nodes in the node group. For more information, see Node
* taints on managed node groups .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder taints(Collection taints);
/**
*
* The Kubernetes taints to be applied to the nodes in the node group. For more information, see Node taints on
* managed node groups .
*
*
* @param taints
* The Kubernetes taints to be applied to the nodes in the node group. For more information, see Node
* taints on managed node groups .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder taints(Taint... taints);
/**
*
* The Kubernetes taints to be applied to the nodes in the node group. For more information, see Node taints on
* managed node groups .
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.eks.model.Taint.Builder} avoiding the need to create one manually via
* {@link software.amazon.awssdk.services.eks.model.Taint#builder()}.
*
*
* When the {@link Consumer} completes, {@link software.amazon.awssdk.services.eks.model.Taint.Builder#build()}
* is called immediately and its result is passed to {@link #taints(List)}.
*
* @param taints
* a consumer that will call methods on {@link software.amazon.awssdk.services.eks.model.Taint.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #taints(java.util.Collection)
*/
Builder taints(Consumer... taints);
/**
*
* Metadata that assists with categorization and organization. Each tag consists of a key and an optional value.
* You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.
*
*
* @param tags
* Metadata that assists with categorization and organization. Each tag consists of a key and an optional
* value. You define both. Tags don't propagate to any other cluster or Amazon Web Services resources.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
/**
*
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
*
*
* @param clientRequestToken
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder clientRequestToken(String clientRequestToken);
/**
*
* An object representing a node group's launch template specification. If specified, then do not specify
* instanceTypes
, diskSize
, or remoteAccess
and make sure that the launch
* template meets the requirements in launchTemplateSpecification
.
*
*
* @param launchTemplate
* An object representing a node group's launch template specification. If specified, then do not specify
* instanceTypes
, diskSize
, or remoteAccess
and make sure that the
* launch template meets the requirements in launchTemplateSpecification
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder launchTemplate(LaunchTemplateSpecification launchTemplate);
/**
*
* An object representing a node group's launch template specification. If specified, then do not specify
* instanceTypes
, diskSize
, or remoteAccess
and make sure that the launch
* template meets the requirements in launchTemplateSpecification
.
*
* This is a convenience method that creates an instance of the {@link LaunchTemplateSpecification.Builder}
* avoiding the need to create one manually via {@link LaunchTemplateSpecification#builder()}.
*
*
* When the {@link Consumer} completes, {@link LaunchTemplateSpecification.Builder#build()} is called
* immediately and its result is passed to {@link #launchTemplate(LaunchTemplateSpecification)}.
*
* @param launchTemplate
* a consumer that will call methods on {@link LaunchTemplateSpecification.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #launchTemplate(LaunchTemplateSpecification)
*/
default Builder launchTemplate(Consumer launchTemplate) {
return launchTemplate(LaunchTemplateSpecification.builder().applyMutation(launchTemplate).build());
}
/**
*
* The node group update configuration.
*
*
* @param updateConfig
* The node group update configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder updateConfig(NodegroupUpdateConfig updateConfig);
/**
*
* The node group update configuration.
*
* This is a convenience method that creates an instance of the {@link NodegroupUpdateConfig.Builder} avoiding
* the need to create one manually via {@link NodegroupUpdateConfig#builder()}.
*
*
* When the {@link Consumer} completes, {@link NodegroupUpdateConfig.Builder#build()} is called immediately and
* its result is passed to {@link #updateConfig(NodegroupUpdateConfig)}.
*
* @param updateConfig
* a consumer that will call methods on {@link NodegroupUpdateConfig.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #updateConfig(NodegroupUpdateConfig)
*/
default Builder updateConfig(Consumer updateConfig) {
return updateConfig(NodegroupUpdateConfig.builder().applyMutation(updateConfig).build());
}
/**
*
* The capacity type for your node group.
*
*
* @param capacityType
* The capacity type for your node group.
* @see CapacityTypes
* @return Returns a reference to this object so that method calls can be chained together.
* @see CapacityTypes
*/
Builder capacityType(String capacityType);
/**
*
* The capacity type for your node group.
*
*
* @param capacityType
* The capacity type for your node group.
* @see CapacityTypes
* @return Returns a reference to this object so that method calls can be chained together.
* @see CapacityTypes
*/
Builder capacityType(CapacityTypes capacityType);
/**
*
* The Kubernetes version to use for your managed nodes. By default, the Kubernetes version of the cluster is
* used, and this is the only accepted specified value. If you specify launchTemplate
, and your
* launch template uses a custom AMI, then don't specify version
, or the node group deployment will
* fail. For more information about using launch templates with Amazon EKS, see Launch template support in
* the Amazon EKS User Guide .
*
*
* @param version
* The Kubernetes version to use for your managed nodes. By default, the Kubernetes version of the
* cluster is used, and this is the only accepted specified value. If you specify
* launchTemplate
, and your launch template uses a custom AMI, then don't specify
* version
, or the node group deployment will fail. For more information about using launch
* templates with Amazon EKS, see Launch template
* support in the Amazon EKS User Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder version(String version);
/**
*
* The AMI version of the Amazon EKS optimized AMI to use with your node group. By default, the latest available
* AMI version for the node group's current Kubernetes version is used. For information about Linux versions,
* see Amazon EKS
* optimized Amazon Linux AMI versions in the Amazon EKS User Guide . Amazon EKS managed node groups
* support the November 2022 and later releases of the Windows AMIs. For information about Windows versions, see
* Amazon EKS optimized
* Windows AMI versions in the Amazon EKS User Guide .
*
*
* If you specify launchTemplate
, and your launch template uses a custom AMI, then don't specify
* releaseVersion
, or the node group deployment will fail. For more information about using launch
* templates with Amazon EKS, see Launch template support in
* the Amazon EKS User Guide .
*
*
* @param releaseVersion
* The AMI version of the Amazon EKS optimized AMI to use with your node group. By default, the latest
* available AMI version for the node group's current Kubernetes version is used. For information about
* Linux versions, see Amazon EKS
* optimized Amazon Linux AMI versions in the Amazon EKS User Guide . Amazon EKS managed node
* groups support the November 2022 and later releases of the Windows AMIs. For information about Windows
* versions, see Amazon EKS
* optimized Windows AMI versions in the Amazon EKS User Guide .
*
* If you specify launchTemplate
, and your launch template uses a custom AMI, then don't
* specify releaseVersion
, or the node group deployment will fail. For more information
* about using launch templates with Amazon EKS, see Launch template
* support in the Amazon EKS User Guide .
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder releaseVersion(String releaseVersion);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends EksRequest.BuilderImpl implements Builder {
private String clusterName;
private String nodegroupName;
private NodegroupScalingConfig scalingConfig;
private Integer diskSize;
private List subnets = DefaultSdkAutoConstructList.getInstance();
private List instanceTypes = DefaultSdkAutoConstructList.getInstance();
private String amiType;
private RemoteAccessConfig remoteAccess;
private String nodeRole;
private Map labels = DefaultSdkAutoConstructMap.getInstance();
private List taints = DefaultSdkAutoConstructList.getInstance();
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private String clientRequestToken;
private LaunchTemplateSpecification launchTemplate;
private NodegroupUpdateConfig updateConfig;
private String capacityType;
private String version;
private String releaseVersion;
private BuilderImpl() {
}
private BuilderImpl(CreateNodegroupRequest model) {
super(model);
clusterName(model.clusterName);
nodegroupName(model.nodegroupName);
scalingConfig(model.scalingConfig);
diskSize(model.diskSize);
subnets(model.subnets);
instanceTypes(model.instanceTypes);
amiType(model.amiType);
remoteAccess(model.remoteAccess);
nodeRole(model.nodeRole);
labels(model.labels);
taints(model.taints);
tags(model.tags);
clientRequestToken(model.clientRequestToken);
launchTemplate(model.launchTemplate);
updateConfig(model.updateConfig);
capacityType(model.capacityType);
version(model.version);
releaseVersion(model.releaseVersion);
}
public final String getClusterName() {
return clusterName;
}
public final void setClusterName(String clusterName) {
this.clusterName = clusterName;
}
@Override
public final Builder clusterName(String clusterName) {
this.clusterName = clusterName;
return this;
}
public final String getNodegroupName() {
return nodegroupName;
}
public final void setNodegroupName(String nodegroupName) {
this.nodegroupName = nodegroupName;
}
@Override
public final Builder nodegroupName(String nodegroupName) {
this.nodegroupName = nodegroupName;
return this;
}
public final NodegroupScalingConfig.Builder getScalingConfig() {
return scalingConfig != null ? scalingConfig.toBuilder() : null;
}
public final void setScalingConfig(NodegroupScalingConfig.BuilderImpl scalingConfig) {
this.scalingConfig = scalingConfig != null ? scalingConfig.build() : null;
}
@Override
public final Builder scalingConfig(NodegroupScalingConfig scalingConfig) {
this.scalingConfig = scalingConfig;
return this;
}
public final Integer getDiskSize() {
return diskSize;
}
public final void setDiskSize(Integer diskSize) {
this.diskSize = diskSize;
}
@Override
public final Builder diskSize(Integer diskSize) {
this.diskSize = diskSize;
return this;
}
public final Collection getSubnets() {
if (subnets instanceof SdkAutoConstructList) {
return null;
}
return subnets;
}
public final void setSubnets(Collection subnets) {
this.subnets = StringListCopier.copy(subnets);
}
@Override
public final Builder subnets(Collection subnets) {
this.subnets = StringListCopier.copy(subnets);
return this;
}
@Override
@SafeVarargs
public final Builder subnets(String... subnets) {
subnets(Arrays.asList(subnets));
return this;
}
public final Collection getInstanceTypes() {
if (instanceTypes instanceof SdkAutoConstructList) {
return null;
}
return instanceTypes;
}
public final void setInstanceTypes(Collection instanceTypes) {
this.instanceTypes = StringListCopier.copy(instanceTypes);
}
@Override
public final Builder instanceTypes(Collection instanceTypes) {
this.instanceTypes = StringListCopier.copy(instanceTypes);
return this;
}
@Override
@SafeVarargs
public final Builder instanceTypes(String... instanceTypes) {
instanceTypes(Arrays.asList(instanceTypes));
return this;
}
public final String getAmiType() {
return amiType;
}
public final void setAmiType(String amiType) {
this.amiType = amiType;
}
@Override
public final Builder amiType(String amiType) {
this.amiType = amiType;
return this;
}
@Override
public final Builder amiType(AMITypes amiType) {
this.amiType(amiType == null ? null : amiType.toString());
return this;
}
public final RemoteAccessConfig.Builder getRemoteAccess() {
return remoteAccess != null ? remoteAccess.toBuilder() : null;
}
public final void setRemoteAccess(RemoteAccessConfig.BuilderImpl remoteAccess) {
this.remoteAccess = remoteAccess != null ? remoteAccess.build() : null;
}
@Override
public final Builder remoteAccess(RemoteAccessConfig remoteAccess) {
this.remoteAccess = remoteAccess;
return this;
}
public final String getNodeRole() {
return nodeRole;
}
public final void setNodeRole(String nodeRole) {
this.nodeRole = nodeRole;
}
@Override
public final Builder nodeRole(String nodeRole) {
this.nodeRole = nodeRole;
return this;
}
public final Map getLabels() {
if (labels instanceof SdkAutoConstructMap) {
return null;
}
return labels;
}
public final void setLabels(Map labels) {
this.labels = _labelsMapCopier.copy(labels);
}
@Override
public final Builder labels(Map labels) {
this.labels = _labelsMapCopier.copy(labels);
return this;
}
public final List getTaints() {
List result = _taintsListCopier.copyToBuilder(this.taints);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setTaints(Collection taints) {
this.taints = _taintsListCopier.copyFromBuilder(taints);
}
@Override
public final Builder taints(Collection taints) {
this.taints = _taintsListCopier.copy(taints);
return this;
}
@Override
@SafeVarargs
public final Builder taints(Taint... taints) {
taints(Arrays.asList(taints));
return this;
}
@Override
@SafeVarargs
public final Builder taints(Consumer... taints) {
taints(Stream.of(taints).map(c -> Taint.builder().applyMutation(c).build()).collect(Collectors.toList()));
return this;
}
public final Map getTags() {
if (tags instanceof SdkAutoConstructMap) {
return null;
}
return tags;
}
public final void setTags(Map tags) {
this.tags = TagMapCopier.copy(tags);
}
@Override
public final Builder tags(Map tags) {
this.tags = TagMapCopier.copy(tags);
return this;
}
public final String getClientRequestToken() {
return clientRequestToken;
}
public final void setClientRequestToken(String clientRequestToken) {
this.clientRequestToken = clientRequestToken;
}
@Override
public final Builder clientRequestToken(String clientRequestToken) {
this.clientRequestToken = clientRequestToken;
return this;
}
public final LaunchTemplateSpecification.Builder getLaunchTemplate() {
return launchTemplate != null ? launchTemplate.toBuilder() : null;
}
public final void setLaunchTemplate(LaunchTemplateSpecification.BuilderImpl launchTemplate) {
this.launchTemplate = launchTemplate != null ? launchTemplate.build() : null;
}
@Override
public final Builder launchTemplate(LaunchTemplateSpecification launchTemplate) {
this.launchTemplate = launchTemplate;
return this;
}
public final NodegroupUpdateConfig.Builder getUpdateConfig() {
return updateConfig != null ? updateConfig.toBuilder() : null;
}
public final void setUpdateConfig(NodegroupUpdateConfig.BuilderImpl updateConfig) {
this.updateConfig = updateConfig != null ? updateConfig.build() : null;
}
@Override
public final Builder updateConfig(NodegroupUpdateConfig updateConfig) {
this.updateConfig = updateConfig;
return this;
}
public final String getCapacityType() {
return capacityType;
}
public final void setCapacityType(String capacityType) {
this.capacityType = capacityType;
}
@Override
public final Builder capacityType(String capacityType) {
this.capacityType = capacityType;
return this;
}
@Override
public final Builder capacityType(CapacityTypes capacityType) {
this.capacityType(capacityType == null ? null : capacityType.toString());
return this;
}
public final String getVersion() {
return version;
}
public final void setVersion(String version) {
this.version = version;
}
@Override
public final Builder version(String version) {
this.version = version;
return this;
}
public final String getReleaseVersion() {
return releaseVersion;
}
public final void setReleaseVersion(String releaseVersion) {
this.releaseVersion = releaseVersion;
}
@Override
public final Builder releaseVersion(String releaseVersion) {
this.releaseVersion = releaseVersion;
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public CreateNodegroupRequest build() {
return new CreateNodegroupRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}