/* * Copyright 2018-2023 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 com.amazonaws.services.batch.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Provides information used to select Amazon Machine Images (AMIs) for instances in the compute environment. If
* Ec2Configuration
isn't specified, the default is ECS_AL2
(Amazon Linux 2).
*
* This object isn't applicable to jobs that are running on Fargate resources. *
*
* The image type to match with the instance type to select an AMI. The supported values are different for
* ECS
and EKS
resources.
*
* If the imageIdOverride
parameter isn't specified, then a recent Amazon
* ECS-optimized Amazon Linux 2 AMI (ECS_AL2
) is used. If a new image type is specified in an
* update, but neither an imageId
nor a imageIdOverride
parameter is specified, then the
* latest Amazon ECS optimized AMI for that image type that's supported by Batch is used.
*
* Amazon Linux * 2: Default for all non-GPU instance families. *
*
* Amazon Linux
* 2 (GPU): Default for all GPU instance families (for example P4
and G4
) and can be
* used for all non Amazon Web Services Graviton-based instance types.
*
* Amazon * Linux. Amazon Linux has reached the end-of-life of standard support. For more information, see Amazon Linux AMI. *
*
* If the imageIdOverride
parameter isn't specified, then a recent Amazon EKS-optimized Amazon Linux
* AMI (EKS_AL2
) is used. If a new image type is specified in an update, but neither an
* imageId
nor a imageIdOverride
parameter is specified, then the latest Amazon EKS
* optimized AMI for that image type that Batch supports is used.
*
* Amazon Linux 2: Default for * all non-GPU instance families. *
*
* Amazon Linux 2
* (accelerated): Default for all GPU instance families (for example, P4
and G4
) and
* can be used for all non Amazon Web Services Graviton-based instance types.
*
* The AMI ID used for instances launched in the compute environment that match the image type. This setting
* overrides the imageId
set in the computeResource
object.
*
* The AMI that you choose for a compute environment must match the architecture of the instance types that you * intend to use for that compute environment. For example, if your compute environment uses A1 instance types, the * compute resource AMI that you choose must support ARM instances. Amazon ECS vends both x86 and ARM versions of * the Amazon ECS-optimized Amazon Linux 2 AMI. For more information, see Amazon ECS-optimized Amazon Linux 2 AMI in the Amazon Elastic Container Service Developer Guide. *
** The Kubernetes version for the compute environment. If you don't specify a value, the latest version that Batch * supports is used. *
*/ private String imageKubernetesVersion; /** *
* The image type to match with the instance type to select an AMI. The supported values are different for
* ECS
and EKS
resources.
*
* If the imageIdOverride
parameter isn't specified, then a recent Amazon
* ECS-optimized Amazon Linux 2 AMI (ECS_AL2
) is used. If a new image type is specified in an
* update, but neither an imageId
nor a imageIdOverride
parameter is specified, then the
* latest Amazon ECS optimized AMI for that image type that's supported by Batch is used.
*
* Amazon Linux * 2: Default for all non-GPU instance families. *
*
* Amazon Linux
* 2 (GPU): Default for all GPU instance families (for example P4
and G4
) and can be
* used for all non Amazon Web Services Graviton-based instance types.
*
* Amazon * Linux. Amazon Linux has reached the end-of-life of standard support. For more information, see Amazon Linux AMI. *
*
* If the imageIdOverride
parameter isn't specified, then a recent Amazon EKS-optimized Amazon Linux
* AMI (EKS_AL2
) is used. If a new image type is specified in an update, but neither an
* imageId
nor a imageIdOverride
parameter is specified, then the latest Amazon EKS
* optimized AMI for that image type that Batch supports is used.
*
* Amazon Linux 2: Default for * all non-GPU instance families. *
*
* Amazon Linux 2
* (accelerated): Default for all GPU instance families (for example, P4
and G4
) and
* can be used for all non Amazon Web Services Graviton-based instance types.
*
ECS
and EKS
resources.
*
* If the imageIdOverride
parameter isn't specified, then a recent Amazon
* ECS-optimized Amazon Linux 2 AMI (ECS_AL2
) is used. If a new image type is specified in
* an update, but neither an imageId
nor a imageIdOverride
parameter is specified,
* then the latest Amazon ECS optimized AMI for that image type that's supported by Batch is used.
*
* Amazon * Linux 2: Default for all non-GPU instance families. *
*
* Amazon
* Linux 2 (GPU): Default for all GPU instance families (for example P4
and G4
)
* and can be used for all non Amazon Web Services Graviton-based instance types.
*
* Amazon * Linux. Amazon Linux has reached the end-of-life of standard support. For more information, see Amazon Linux AMI. *
*
* If the imageIdOverride
parameter isn't specified, then a recent Amazon EKS-optimized Amazon
* Linux AMI (EKS_AL2
) is used. If a new image type is specified in an update, but neither
* an imageId
nor a imageIdOverride
parameter is specified, then the latest Amazon
* EKS optimized AMI for that image type that Batch supports is used.
*
* Amazon Linux 2: * Default for all non-GPU instance families. *
*
* Amazon Linux 2
* (accelerated): Default for all GPU instance families (for example, P4
and G4
* ) and can be used for all non Amazon Web Services Graviton-based instance types.
*
* The image type to match with the instance type to select an AMI. The supported values are different for
* ECS
and EKS
resources.
*
* If the imageIdOverride
parameter isn't specified, then a recent Amazon
* ECS-optimized Amazon Linux 2 AMI (ECS_AL2
) is used. If a new image type is specified in an
* update, but neither an imageId
nor a imageIdOverride
parameter is specified, then the
* latest Amazon ECS optimized AMI for that image type that's supported by Batch is used.
*
* Amazon Linux * 2: Default for all non-GPU instance families. *
*
* Amazon Linux
* 2 (GPU): Default for all GPU instance families (for example P4
and G4
) and can be
* used for all non Amazon Web Services Graviton-based instance types.
*
* Amazon * Linux. Amazon Linux has reached the end-of-life of standard support. For more information, see Amazon Linux AMI. *
*
* If the imageIdOverride
parameter isn't specified, then a recent Amazon EKS-optimized Amazon Linux
* AMI (EKS_AL2
) is used. If a new image type is specified in an update, but neither an
* imageId
nor a imageIdOverride
parameter is specified, then the latest Amazon EKS
* optimized AMI for that image type that Batch supports is used.
*
* Amazon Linux 2: Default for * all non-GPU instance families. *
*
* Amazon Linux 2
* (accelerated): Default for all GPU instance families (for example, P4
and G4
) and
* can be used for all non Amazon Web Services Graviton-based instance types.
*
ECS
and EKS
resources.
*
* If the imageIdOverride
parameter isn't specified, then a recent Amazon
* ECS-optimized Amazon Linux 2 AMI (ECS_AL2
) is used. If a new image type is specified in
* an update, but neither an imageId
nor a imageIdOverride
parameter is specified,
* then the latest Amazon ECS optimized AMI for that image type that's supported by Batch is used.
*
* Amazon * Linux 2: Default for all non-GPU instance families. *
*
* Amazon
* Linux 2 (GPU): Default for all GPU instance families (for example P4
and G4
* ) and can be used for all non Amazon Web Services Graviton-based instance types.
*
* Amazon * Linux. Amazon Linux has reached the end-of-life of standard support. For more information, see Amazon Linux AMI. *
*
* If the imageIdOverride
parameter isn't specified, then a recent Amazon EKS-optimized
* Amazon Linux AMI (EKS_AL2
) is used. If a new image type is specified in an update, but
* neither an imageId
nor a imageIdOverride
parameter is specified, then the
* latest Amazon EKS optimized AMI for that image type that Batch supports is used.
*
* Amazon Linux 2: * Default for all non-GPU instance families. *
*
* Amazon Linux 2
* (accelerated): Default for all GPU instance families (for example, P4
and
* G4
) and can be used for all non Amazon Web Services Graviton-based instance types.
*
* The image type to match with the instance type to select an AMI. The supported values are different for
* ECS
and EKS
resources.
*
* If the imageIdOverride
parameter isn't specified, then a recent Amazon
* ECS-optimized Amazon Linux 2 AMI (ECS_AL2
) is used. If a new image type is specified in an
* update, but neither an imageId
nor a imageIdOverride
parameter is specified, then the
* latest Amazon ECS optimized AMI for that image type that's supported by Batch is used.
*
* Amazon Linux * 2: Default for all non-GPU instance families. *
*
* Amazon Linux
* 2 (GPU): Default for all GPU instance families (for example P4
and G4
) and can be
* used for all non Amazon Web Services Graviton-based instance types.
*
* Amazon * Linux. Amazon Linux has reached the end-of-life of standard support. For more information, see Amazon Linux AMI. *
*
* If the imageIdOverride
parameter isn't specified, then a recent Amazon EKS-optimized Amazon Linux
* AMI (EKS_AL2
) is used. If a new image type is specified in an update, but neither an
* imageId
nor a imageIdOverride
parameter is specified, then the latest Amazon EKS
* optimized AMI for that image type that Batch supports is used.
*
* Amazon Linux 2: Default for * all non-GPU instance families. *
*
* Amazon Linux 2
* (accelerated): Default for all GPU instance families (for example, P4
and G4
) and
* can be used for all non Amazon Web Services Graviton-based instance types.
*
ECS
and EKS
resources.
*
* If the imageIdOverride
parameter isn't specified, then a recent Amazon
* ECS-optimized Amazon Linux 2 AMI (ECS_AL2
) is used. If a new image type is specified in
* an update, but neither an imageId
nor a imageIdOverride
parameter is specified,
* then the latest Amazon ECS optimized AMI for that image type that's supported by Batch is used.
*
* Amazon * Linux 2: Default for all non-GPU instance families. *
*
* Amazon
* Linux 2 (GPU): Default for all GPU instance families (for example P4
and G4
)
* and can be used for all non Amazon Web Services Graviton-based instance types.
*
* Amazon * Linux. Amazon Linux has reached the end-of-life of standard support. For more information, see Amazon Linux AMI. *
*
* If the imageIdOverride
parameter isn't specified, then a recent Amazon EKS-optimized Amazon
* Linux AMI (EKS_AL2
) is used. If a new image type is specified in an update, but neither
* an imageId
nor a imageIdOverride
parameter is specified, then the latest Amazon
* EKS optimized AMI for that image type that Batch supports is used.
*
* Amazon Linux 2: * Default for all non-GPU instance families. *
*
* Amazon Linux 2
* (accelerated): Default for all GPU instance families (for example, P4
and G4
* ) and can be used for all non Amazon Web Services Graviton-based instance types.
*
* The AMI ID used for instances launched in the compute environment that match the image type. This setting
* overrides the imageId
set in the computeResource
object.
*
* The AMI that you choose for a compute environment must match the architecture of the instance types that you * intend to use for that compute environment. For example, if your compute environment uses A1 instance types, the * compute resource AMI that you choose must support ARM instances. Amazon ECS vends both x86 and ARM versions of * the Amazon ECS-optimized Amazon Linux 2 AMI. For more information, see Amazon ECS-optimized Amazon Linux 2 AMI in the Amazon Elastic Container Service Developer Guide. *
*imageId
set in the computeResource
object. * The AMI that you choose for a compute environment must match the architecture of the instance types that * you intend to use for that compute environment. For example, if your compute environment uses A1 instance * types, the compute resource AMI that you choose must support ARM instances. Amazon ECS vends both x86 and * ARM versions of the Amazon ECS-optimized Amazon Linux 2 AMI. For more information, see Amazon ECS-optimized Amazon Linux 2 AMI in the Amazon Elastic Container Service Developer * Guide. *
*/ public void setImageIdOverride(String imageIdOverride) { this.imageIdOverride = imageIdOverride; } /** *
* The AMI ID used for instances launched in the compute environment that match the image type. This setting
* overrides the imageId
set in the computeResource
object.
*
* The AMI that you choose for a compute environment must match the architecture of the instance types that you * intend to use for that compute environment. For example, if your compute environment uses A1 instance types, the * compute resource AMI that you choose must support ARM instances. Amazon ECS vends both x86 and ARM versions of * the Amazon ECS-optimized Amazon Linux 2 AMI. For more information, see Amazon ECS-optimized Amazon Linux 2 AMI in the Amazon Elastic Container Service Developer Guide. *
*imageId
set in the computeResource
object. * The AMI that you choose for a compute environment must match the architecture of the instance types that * you intend to use for that compute environment. For example, if your compute environment uses A1 instance * types, the compute resource AMI that you choose must support ARM instances. Amazon ECS vends both x86 and * ARM versions of the Amazon ECS-optimized Amazon Linux 2 AMI. For more information, see Amazon ECS-optimized Amazon Linux 2 AMI in the Amazon Elastic Container Service Developer * Guide. *
*/ public String getImageIdOverride() { return this.imageIdOverride; } /** *
* The AMI ID used for instances launched in the compute environment that match the image type. This setting
* overrides the imageId
set in the computeResource
object.
*
* The AMI that you choose for a compute environment must match the architecture of the instance types that you * intend to use for that compute environment. For example, if your compute environment uses A1 instance types, the * compute resource AMI that you choose must support ARM instances. Amazon ECS vends both x86 and ARM versions of * the Amazon ECS-optimized Amazon Linux 2 AMI. For more information, see Amazon ECS-optimized Amazon Linux 2 AMI in the Amazon Elastic Container Service Developer Guide. *
*imageId
set in the computeResource
object. * The AMI that you choose for a compute environment must match the architecture of the instance types that * you intend to use for that compute environment. For example, if your compute environment uses A1 instance * types, the compute resource AMI that you choose must support ARM instances. Amazon ECS vends both x86 and * ARM versions of the Amazon ECS-optimized Amazon Linux 2 AMI. For more information, see Amazon ECS-optimized Amazon Linux 2 AMI in the Amazon Elastic Container Service Developer * Guide. *
* @return Returns a reference to this object so that method calls can be chained together. */ public Ec2Configuration withImageIdOverride(String imageIdOverride) { setImageIdOverride(imageIdOverride); return this; } /** ** The Kubernetes version for the compute environment. If you don't specify a value, the latest version that Batch * supports is used. *
* * @param imageKubernetesVersion * The Kubernetes version for the compute environment. If you don't specify a value, the latest version that * Batch supports is used. */ public void setImageKubernetesVersion(String imageKubernetesVersion) { this.imageKubernetesVersion = imageKubernetesVersion; } /** ** The Kubernetes version for the compute environment. If you don't specify a value, the latest version that Batch * supports is used. *
* * @return The Kubernetes version for the compute environment. If you don't specify a value, the latest version that * Batch supports is used. */ public String getImageKubernetesVersion() { return this.imageKubernetesVersion; } /** ** The Kubernetes version for the compute environment. If you don't specify a value, the latest version that Batch * supports is used. *
* * @param imageKubernetesVersion * The Kubernetes version for the compute environment. If you don't specify a value, the latest version that * Batch supports is used. * @return Returns a reference to this object so that method calls can be chained together. */ public Ec2Configuration withImageKubernetesVersion(String imageKubernetesVersion) { setImageKubernetesVersion(imageKubernetesVersion); return this; } /** * 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. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getImageType() != null) sb.append("ImageType: ").append(getImageType()).append(","); if (getImageIdOverride() != null) sb.append("ImageIdOverride: ").append(getImageIdOverride()).append(","); if (getImageKubernetesVersion() != null) sb.append("ImageKubernetesVersion: ").append(getImageKubernetesVersion()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Ec2Configuration == false) return false; Ec2Configuration other = (Ec2Configuration) obj; if (other.getImageType() == null ^ this.getImageType() == null) return false; if (other.getImageType() != null && other.getImageType().equals(this.getImageType()) == false) return false; if (other.getImageIdOverride() == null ^ this.getImageIdOverride() == null) return false; if (other.getImageIdOverride() != null && other.getImageIdOverride().equals(this.getImageIdOverride()) == false) return false; if (other.getImageKubernetesVersion() == null ^ this.getImageKubernetesVersion() == null) return false; if (other.getImageKubernetesVersion() != null && other.getImageKubernetesVersion().equals(this.getImageKubernetesVersion()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getImageType() == null) ? 0 : getImageType().hashCode()); hashCode = prime * hashCode + ((getImageIdOverride() == null) ? 0 : getImageIdOverride().hashCode()); hashCode = prime * hashCode + ((getImageKubernetesVersion() == null) ? 0 : getImageKubernetesVersion().hashCode()); return hashCode; } @Override public Ec2Configuration clone() { try { return (Ec2Configuration) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.batch.model.transform.Ec2ConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller); } }