All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.eks.model.CreateClusterRequest Maven / Gradle / Ivy

/*
 * 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 CreateClusterRequest extends EksRequest implements
        ToCopyableBuilder {
    private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
            .getter(getter(CreateClusterRequest::name)).setter(setter(Builder::name))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();

    private static final SdkField VERSION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("version")
            .getter(getter(CreateClusterRequest::version)).setter(setter(Builder::version))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("version").build()).build();

    private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("roleArn").getter(getter(CreateClusterRequest::roleArn)).setter(setter(Builder::roleArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("roleArn").build()).build();

    private static final SdkField RESOURCES_VPC_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("resourcesVpcConfig")
            .getter(getter(CreateClusterRequest::resourcesVpcConfig)).setter(setter(Builder::resourcesVpcConfig))
            .constructor(VpcConfigRequest::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("resourcesVpcConfig").build())
            .build();

    private static final SdkField KUBERNETES_NETWORK_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("kubernetesNetworkConfig")
            .getter(getter(CreateClusterRequest::kubernetesNetworkConfig)).setter(setter(Builder::kubernetesNetworkConfig))
            .constructor(KubernetesNetworkConfigRequest::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kubernetesNetworkConfig").build())
            .build();

    private static final SdkField LOGGING_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("logging").getter(getter(CreateClusterRequest::logging)).setter(setter(Builder::logging))
            .constructor(Logging::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("logging").build()).build();

    private static final SdkField CLIENT_REQUEST_TOKEN_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("clientRequestToken")
            .getter(getter(CreateClusterRequest::clientRequestToken))
            .setter(setter(Builder::clientRequestToken))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("clientRequestToken").build(),
                    DefaultValueTrait.idempotencyToken()).build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("tags")
            .getter(getter(CreateClusterRequest::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> ENCRYPTION_CONFIG_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("encryptionConfig")
            .getter(getter(CreateClusterRequest::encryptionConfig))
            .setter(setter(Builder::encryptionConfig))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("encryptionConfig").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(EncryptionConfig::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField OUTPOST_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("outpostConfig")
            .getter(getter(CreateClusterRequest::outpostConfig)).setter(setter(Builder::outpostConfig))
            .constructor(OutpostConfigRequest::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("outpostConfig").build()).build();

    private static final SdkField ACCESS_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("accessConfig")
            .getter(getter(CreateClusterRequest::accessConfig)).setter(setter(Builder::accessConfig))
            .constructor(CreateAccessConfigRequest::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("accessConfig").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, VERSION_FIELD,
            ROLE_ARN_FIELD, RESOURCES_VPC_CONFIG_FIELD, KUBERNETES_NETWORK_CONFIG_FIELD, LOGGING_FIELD,
            CLIENT_REQUEST_TOKEN_FIELD, TAGS_FIELD, ENCRYPTION_CONFIG_FIELD, OUTPOST_CONFIG_FIELD, ACCESS_CONFIG_FIELD));

    private final String name;

    private final String version;

    private final String roleArn;

    private final VpcConfigRequest resourcesVpcConfig;

    private final KubernetesNetworkConfigRequest kubernetesNetworkConfig;

    private final Logging logging;

    private final String clientRequestToken;

    private final Map tags;

    private final List encryptionConfig;

    private final OutpostConfigRequest outpostConfig;

    private final CreateAccessConfigRequest accessConfig;

    private CreateClusterRequest(BuilderImpl builder) {
        super(builder);
        this.name = builder.name;
        this.version = builder.version;
        this.roleArn = builder.roleArn;
        this.resourcesVpcConfig = builder.resourcesVpcConfig;
        this.kubernetesNetworkConfig = builder.kubernetesNetworkConfig;
        this.logging = builder.logging;
        this.clientRequestToken = builder.clientRequestToken;
        this.tags = builder.tags;
        this.encryptionConfig = builder.encryptionConfig;
        this.outpostConfig = builder.outpostConfig;
        this.accessConfig = builder.accessConfig;
    }

    /**
     * 

* The unique name to give to your cluster. *

* * @return The unique name to give to your cluster. */ public final String name() { return name; } /** *

* The desired Kubernetes version for your cluster. If you don't specify a value here, the default version available * in Amazon EKS is used. *

* *

* The default version might not be the latest version available. *

*
* * @return The desired Kubernetes version for your cluster. If you don't specify a value here, the default version * available in Amazon EKS is used.

*

* The default version might not be the latest version available. *

*/ public final String version() { return version; } /** *

* The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make * calls to Amazon Web Services API operations on your behalf. For more information, see Amazon EKS Service IAM Role in * the Amazon EKS User Guide . *

* * @return The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane * to make calls to Amazon Web Services API operations on your behalf. For more information, see Amazon EKS Service IAM * Role in the Amazon EKS User Guide . */ public final String roleArn() { return roleArn; } /** *

* The VPC configuration that's used by the cluster control plane. Amazon EKS VPC resources have specific * requirements to work properly with Kubernetes. For more information, see Cluster VPC Considerations and Cluster Security Group * Considerations in the Amazon EKS User Guide. You must specify at least two subnets. You can specify up * to five security groups. However, we recommend that you use a dedicated security group for your cluster control * plane. *

* * @return The VPC configuration that's used by the cluster control plane. Amazon EKS VPC resources have specific * requirements to work properly with Kubernetes. For more information, see Cluster VPC Considerations * and Cluster Security Group * Considerations in the Amazon EKS User Guide. You must specify at least two subnets. You can * specify up to five security groups. However, we recommend that you use a dedicated security group for * your cluster control plane. */ public final VpcConfigRequest resourcesVpcConfig() { return resourcesVpcConfig; } /** *

* The Kubernetes network configuration for the cluster. *

* * @return The Kubernetes network configuration for the cluster. */ public final KubernetesNetworkConfigRequest kubernetesNetworkConfig() { return kubernetesNetworkConfig; } /** *

* Enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs. By default, * cluster control plane logs aren't exported to CloudWatch Logs. For more information, see Amazon EKS Cluster control plane * logs in the Amazon EKS User Guide . *

* *

* CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For * more information, see CloudWatch Pricing. *

*
* * @return Enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs. By * default, cluster control plane logs aren't exported to CloudWatch Logs. For more information, see Amazon EKS Cluster * control plane logs in the Amazon EKS User Guide .

*

* CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. * For more information, see CloudWatch Pricing. *

*/ public final Logging logging() { return logging; } /** *

* 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; } /** * 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; } /** * For responses, this returns true if the service returned a value for the EncryptionConfig 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 hasEncryptionConfig() { return encryptionConfig != null && !(encryptionConfig instanceof SdkAutoConstructList); } /** *

* The encryption configuration for the cluster. *

*

* 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 #hasEncryptionConfig} method. *

* * @return The encryption configuration for the cluster. */ public final List encryptionConfig() { return encryptionConfig; } /** *

* An object representing the configuration of your local Amazon EKS cluster on an Amazon Web Services Outpost. * Before creating a local cluster on an Outpost, review Local clusters * for Amazon EKS on Amazon Web Services Outposts in the Amazon EKS User Guide. This object isn't * available for creating Amazon EKS clusters on the Amazon Web Services cloud. *

* * @return An object representing the configuration of your local Amazon EKS cluster on an Amazon Web Services * Outpost. Before creating a local cluster on an Outpost, review Local * clusters for Amazon EKS on Amazon Web Services Outposts in the Amazon EKS User Guide. This * object isn't available for creating Amazon EKS clusters on the Amazon Web Services cloud. */ public final OutpostConfigRequest outpostConfig() { return outpostConfig; } /** *

* The access configuration for the cluster. *

* * @return The access configuration for the cluster. */ public final CreateAccessConfigRequest accessConfig() { return accessConfig; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(version()); hashCode = 31 * hashCode + Objects.hashCode(roleArn()); hashCode = 31 * hashCode + Objects.hashCode(resourcesVpcConfig()); hashCode = 31 * hashCode + Objects.hashCode(kubernetesNetworkConfig()); hashCode = 31 * hashCode + Objects.hashCode(logging()); hashCode = 31 * hashCode + Objects.hashCode(clientRequestToken()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(hasEncryptionConfig() ? encryptionConfig() : null); hashCode = 31 * hashCode + Objects.hashCode(outpostConfig()); hashCode = 31 * hashCode + Objects.hashCode(accessConfig()); 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 CreateClusterRequest)) { return false; } CreateClusterRequest other = (CreateClusterRequest) obj; return Objects.equals(name(), other.name()) && Objects.equals(version(), other.version()) && Objects.equals(roleArn(), other.roleArn()) && Objects.equals(resourcesVpcConfig(), other.resourcesVpcConfig()) && Objects.equals(kubernetesNetworkConfig(), other.kubernetesNetworkConfig()) && Objects.equals(logging(), other.logging()) && Objects.equals(clientRequestToken(), other.clientRequestToken()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && hasEncryptionConfig() == other.hasEncryptionConfig() && Objects.equals(encryptionConfig(), other.encryptionConfig()) && Objects.equals(outpostConfig(), other.outpostConfig()) && Objects.equals(accessConfig(), other.accessConfig()); } /** * 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("CreateClusterRequest").add("Name", name()).add("Version", version()).add("RoleArn", roleArn()) .add("ResourcesVpcConfig", resourcesVpcConfig()).add("KubernetesNetworkConfig", kubernetesNetworkConfig()) .add("Logging", logging()).add("ClientRequestToken", clientRequestToken()).add("Tags", hasTags() ? tags() : null) .add("EncryptionConfig", hasEncryptionConfig() ? encryptionConfig() : null).add("OutpostConfig", outpostConfig()) .add("AccessConfig", accessConfig()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "name": return Optional.ofNullable(clazz.cast(name())); case "version": return Optional.ofNullable(clazz.cast(version())); case "roleArn": return Optional.ofNullable(clazz.cast(roleArn())); case "resourcesVpcConfig": return Optional.ofNullable(clazz.cast(resourcesVpcConfig())); case "kubernetesNetworkConfig": return Optional.ofNullable(clazz.cast(kubernetesNetworkConfig())); case "logging": return Optional.ofNullable(clazz.cast(logging())); case "clientRequestToken": return Optional.ofNullable(clazz.cast(clientRequestToken())); case "tags": return Optional.ofNullable(clazz.cast(tags())); case "encryptionConfig": return Optional.ofNullable(clazz.cast(encryptionConfig())); case "outpostConfig": return Optional.ofNullable(clazz.cast(outpostConfig())); case "accessConfig": return Optional.ofNullable(clazz.cast(accessConfig())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateClusterRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends EksRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The unique name to give to your cluster. *

* * @param name * The unique name to give to your cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* The desired Kubernetes version for your cluster. If you don't specify a value here, the default version * available in Amazon EKS is used. *

* *

* The default version might not be the latest version available. *

*
* * @param version * The desired Kubernetes version for your cluster. If you don't specify a value here, the default * version available in Amazon EKS is used.

*

* The default version might not be the latest version available. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder version(String version); /** *

* The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to * make calls to Amazon Web Services API operations on your behalf. For more information, see Amazon EKS Service IAM Role * in the Amazon EKS User Guide . *

* * @param roleArn * The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control * plane to make calls to Amazon Web Services API operations on your behalf. For more information, see Amazon EKS Service IAM * Role in the Amazon EKS User Guide . * @return Returns a reference to this object so that method calls can be chained together. */ Builder roleArn(String roleArn); /** *

* The VPC configuration that's used by the cluster control plane. Amazon EKS VPC resources have specific * requirements to work properly with Kubernetes. For more information, see Cluster VPC Considerations and * Cluster Security Group * Considerations in the Amazon EKS User Guide. You must specify at least two subnets. You can * specify up to five security groups. However, we recommend that you use a dedicated security group for your * cluster control plane. *

* * @param resourcesVpcConfig * The VPC configuration that's used by the cluster control plane. Amazon EKS VPC resources have specific * requirements to work properly with Kubernetes. For more information, see Cluster VPC * Considerations and Cluster Security Group * Considerations in the Amazon EKS User Guide. You must specify at least two subnets. You can * specify up to five security groups. However, we recommend that you use a dedicated security group for * your cluster control plane. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resourcesVpcConfig(VpcConfigRequest resourcesVpcConfig); /** *

* The VPC configuration that's used by the cluster control plane. Amazon EKS VPC resources have specific * requirements to work properly with Kubernetes. For more information, see Cluster VPC Considerations and * Cluster Security Group * Considerations in the Amazon EKS User Guide. You must specify at least two subnets. You can * specify up to five security groups. However, we recommend that you use a dedicated security group for your * cluster control plane. *

* This is a convenience method that creates an instance of the {@link VpcConfigRequest.Builder} avoiding the * need to create one manually via {@link VpcConfigRequest#builder()}. * *

* When the {@link Consumer} completes, {@link VpcConfigRequest.Builder#build()} is called immediately and its * result is passed to {@link #resourcesVpcConfig(VpcConfigRequest)}. * * @param resourcesVpcConfig * a consumer that will call methods on {@link VpcConfigRequest.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #resourcesVpcConfig(VpcConfigRequest) */ default Builder resourcesVpcConfig(Consumer resourcesVpcConfig) { return resourcesVpcConfig(VpcConfigRequest.builder().applyMutation(resourcesVpcConfig).build()); } /** *

* The Kubernetes network configuration for the cluster. *

* * @param kubernetesNetworkConfig * The Kubernetes network configuration for the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kubernetesNetworkConfig(KubernetesNetworkConfigRequest kubernetesNetworkConfig); /** *

* The Kubernetes network configuration for the cluster. *

* This is a convenience method that creates an instance of the {@link KubernetesNetworkConfigRequest.Builder} * avoiding the need to create one manually via {@link KubernetesNetworkConfigRequest#builder()}. * *

* When the {@link Consumer} completes, {@link KubernetesNetworkConfigRequest.Builder#build()} is called * immediately and its result is passed to {@link #kubernetesNetworkConfig(KubernetesNetworkConfigRequest)}. * * @param kubernetesNetworkConfig * a consumer that will call methods on {@link KubernetesNetworkConfigRequest.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #kubernetesNetworkConfig(KubernetesNetworkConfigRequest) */ default Builder kubernetesNetworkConfig(Consumer kubernetesNetworkConfig) { return kubernetesNetworkConfig(KubernetesNetworkConfigRequest.builder().applyMutation(kubernetesNetworkConfig) .build()); } /** *

* Enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs. By * default, cluster control plane logs aren't exported to CloudWatch Logs. For more information, see Amazon EKS Cluster control * plane logs in the Amazon EKS User Guide . *

* *

* CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For * more information, see CloudWatch Pricing. *

*
* * @param logging * Enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs. By * default, cluster control plane logs aren't exported to CloudWatch Logs. For more information, see Amazon EKS Cluster * control plane logs in the Amazon EKS User Guide .

*

* CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane * logs. For more information, see CloudWatch * Pricing. *

* @return Returns a reference to this object so that method calls can be chained together. */ Builder logging(Logging logging); /** *

* Enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs. By * default, cluster control plane logs aren't exported to CloudWatch Logs. For more information, see Amazon EKS Cluster control * plane logs in the Amazon EKS User Guide . *

* *

* CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For * more information, see CloudWatch Pricing. *

*
This is a convenience method that creates an instance of the {@link Logging.Builder} avoiding the * need to create one manually via {@link Logging#builder()}. * *

* When the {@link Consumer} completes, {@link Logging.Builder#build()} is called immediately and its result is * passed to {@link #logging(Logging)}. * * @param logging * a consumer that will call methods on {@link Logging.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #logging(Logging) */ default Builder logging(Consumer logging) { return logging(Logging.builder().applyMutation(logging).build()); } /** *

* 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); /** *

* 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); /** *

* The encryption configuration for the cluster. *

* * @param encryptionConfig * The encryption configuration for the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder encryptionConfig(Collection encryptionConfig); /** *

* The encryption configuration for the cluster. *

* * @param encryptionConfig * The encryption configuration for the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder encryptionConfig(EncryptionConfig... encryptionConfig); /** *

* The encryption configuration for the cluster. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.eks.model.EncryptionConfig.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.eks.model.EncryptionConfig#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.eks.model.EncryptionConfig.Builder#build()} is called immediately and * its result is passed to {@link #encryptionConfig(List)}. * * @param encryptionConfig * a consumer that will call methods on * {@link software.amazon.awssdk.services.eks.model.EncryptionConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #encryptionConfig(java.util.Collection) */ Builder encryptionConfig(Consumer... encryptionConfig); /** *

* An object representing the configuration of your local Amazon EKS cluster on an Amazon Web Services Outpost. * Before creating a local cluster on an Outpost, review Local * clusters for Amazon EKS on Amazon Web Services Outposts in the Amazon EKS User Guide. This object * isn't available for creating Amazon EKS clusters on the Amazon Web Services cloud. *

* * @param outpostConfig * An object representing the configuration of your local Amazon EKS cluster on an Amazon Web Services * Outpost. Before creating a local cluster on an Outpost, review Local * clusters for Amazon EKS on Amazon Web Services Outposts in the Amazon EKS User Guide. This * object isn't available for creating Amazon EKS clusters on the Amazon Web Services cloud. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outpostConfig(OutpostConfigRequest outpostConfig); /** *

* An object representing the configuration of your local Amazon EKS cluster on an Amazon Web Services Outpost. * Before creating a local cluster on an Outpost, review Local * clusters for Amazon EKS on Amazon Web Services Outposts in the Amazon EKS User Guide. This object * isn't available for creating Amazon EKS clusters on the Amazon Web Services cloud. *

* This is a convenience method that creates an instance of the {@link OutpostConfigRequest.Builder} avoiding * the need to create one manually via {@link OutpostConfigRequest#builder()}. * *

* When the {@link Consumer} completes, {@link OutpostConfigRequest.Builder#build()} is called immediately and * its result is passed to {@link #outpostConfig(OutpostConfigRequest)}. * * @param outpostConfig * a consumer that will call methods on {@link OutpostConfigRequest.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #outpostConfig(OutpostConfigRequest) */ default Builder outpostConfig(Consumer outpostConfig) { return outpostConfig(OutpostConfigRequest.builder().applyMutation(outpostConfig).build()); } /** *

* The access configuration for the cluster. *

* * @param accessConfig * The access configuration for the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder accessConfig(CreateAccessConfigRequest accessConfig); /** *

* The access configuration for the cluster. *

* This is a convenience method that creates an instance of the {@link CreateAccessConfigRequest.Builder} * avoiding the need to create one manually via {@link CreateAccessConfigRequest#builder()}. * *

* When the {@link Consumer} completes, {@link CreateAccessConfigRequest.Builder#build()} is called immediately * and its result is passed to {@link #accessConfig(CreateAccessConfigRequest)}. * * @param accessConfig * a consumer that will call methods on {@link CreateAccessConfigRequest.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #accessConfig(CreateAccessConfigRequest) */ default Builder accessConfig(Consumer accessConfig) { return accessConfig(CreateAccessConfigRequest.builder().applyMutation(accessConfig).build()); } @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends EksRequest.BuilderImpl implements Builder { private String name; private String version; private String roleArn; private VpcConfigRequest resourcesVpcConfig; private KubernetesNetworkConfigRequest kubernetesNetworkConfig; private Logging logging; private String clientRequestToken; private Map tags = DefaultSdkAutoConstructMap.getInstance(); private List encryptionConfig = DefaultSdkAutoConstructList.getInstance(); private OutpostConfigRequest outpostConfig; private CreateAccessConfigRequest accessConfig; private BuilderImpl() { } private BuilderImpl(CreateClusterRequest model) { super(model); name(model.name); version(model.version); roleArn(model.roleArn); resourcesVpcConfig(model.resourcesVpcConfig); kubernetesNetworkConfig(model.kubernetesNetworkConfig); logging(model.logging); clientRequestToken(model.clientRequestToken); tags(model.tags); encryptionConfig(model.encryptionConfig); outpostConfig(model.outpostConfig); accessConfig(model.accessConfig); } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; 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 getRoleArn() { return roleArn; } public final void setRoleArn(String roleArn) { this.roleArn = roleArn; } @Override public final Builder roleArn(String roleArn) { this.roleArn = roleArn; return this; } public final VpcConfigRequest.Builder getResourcesVpcConfig() { return resourcesVpcConfig != null ? resourcesVpcConfig.toBuilder() : null; } public final void setResourcesVpcConfig(VpcConfigRequest.BuilderImpl resourcesVpcConfig) { this.resourcesVpcConfig = resourcesVpcConfig != null ? resourcesVpcConfig.build() : null; } @Override public final Builder resourcesVpcConfig(VpcConfigRequest resourcesVpcConfig) { this.resourcesVpcConfig = resourcesVpcConfig; return this; } public final KubernetesNetworkConfigRequest.Builder getKubernetesNetworkConfig() { return kubernetesNetworkConfig != null ? kubernetesNetworkConfig.toBuilder() : null; } public final void setKubernetesNetworkConfig(KubernetesNetworkConfigRequest.BuilderImpl kubernetesNetworkConfig) { this.kubernetesNetworkConfig = kubernetesNetworkConfig != null ? kubernetesNetworkConfig.build() : null; } @Override public final Builder kubernetesNetworkConfig(KubernetesNetworkConfigRequest kubernetesNetworkConfig) { this.kubernetesNetworkConfig = kubernetesNetworkConfig; return this; } public final Logging.Builder getLogging() { return logging != null ? logging.toBuilder() : null; } public final void setLogging(Logging.BuilderImpl logging) { this.logging = logging != null ? logging.build() : null; } @Override public final Builder logging(Logging logging) { this.logging = logging; 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 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 List getEncryptionConfig() { List result = EncryptionConfigListCopier.copyToBuilder(this.encryptionConfig); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setEncryptionConfig(Collection encryptionConfig) { this.encryptionConfig = EncryptionConfigListCopier.copyFromBuilder(encryptionConfig); } @Override public final Builder encryptionConfig(Collection encryptionConfig) { this.encryptionConfig = EncryptionConfigListCopier.copy(encryptionConfig); return this; } @Override @SafeVarargs public final Builder encryptionConfig(EncryptionConfig... encryptionConfig) { encryptionConfig(Arrays.asList(encryptionConfig)); return this; } @Override @SafeVarargs public final Builder encryptionConfig(Consumer... encryptionConfig) { encryptionConfig(Stream.of(encryptionConfig).map(c -> EncryptionConfig.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final OutpostConfigRequest.Builder getOutpostConfig() { return outpostConfig != null ? outpostConfig.toBuilder() : null; } public final void setOutpostConfig(OutpostConfigRequest.BuilderImpl outpostConfig) { this.outpostConfig = outpostConfig != null ? outpostConfig.build() : null; } @Override public final Builder outpostConfig(OutpostConfigRequest outpostConfig) { this.outpostConfig = outpostConfig; return this; } public final CreateAccessConfigRequest.Builder getAccessConfig() { return accessConfig != null ? accessConfig.toBuilder() : null; } public final void setAccessConfig(CreateAccessConfigRequest.BuilderImpl accessConfig) { this.accessConfig = accessConfig != null ? accessConfig.build() : null; } @Override public final Builder accessConfig(CreateAccessConfigRequest accessConfig) { this.accessConfig = accessConfig; 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 CreateClusterRequest build() { return new CreateClusterRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy