{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE NoImplicitPrelude #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} -- Derived from AWS service descriptions, licensed under Apache 2.0. -- | -- Module : Amazonka.Batch.Types.Ec2Configuration -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) module Amazonka.Batch.Types.Ec2Configuration where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import qualified Amazonka.Prelude as Prelude -- | 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@ -- (). -- -- This object isn\'t applicable to jobs that are running on Fargate -- resources. -- -- /See:/ 'newEc2Configuration' smart constructor. data Ec2Configuration = Ec2Configuration' { -- | 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 -- -- in the /Amazon Elastic Container Service Developer Guide/. imageIdOverride :: Prelude.Maybe Prelude.Text, -- | The Kubernetes version for the compute environment. If you don\'t -- specify a value, the latest version that Batch supports is used. imageKubernetesVersion :: Prelude.Maybe Prelude.Text, -- | The image type to match with the instance type to select an AMI. The -- supported values are different for @ECS@ and @EKS@ resources. -- -- [ECS] -- If the @imageIdOverride@ parameter isn\'t specified, then a recent -- -- (@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. -- -- [ECS_AL2] -- : -- Default for all non-GPU instance families. -- -- [ECS_AL2_NVIDIA] -- : -- 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_AL1] -- . -- Amazon Linux has reached the end-of-life of standard support. -- For more information, see -- . -- -- [EKS] -- If the @imageIdOverride@ parameter isn\'t specified, then a recent -- -- (@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. -- -- [EKS_AL2] -- : -- Default for all non-GPU instance families. -- -- [EKS_AL2_NVIDIA] -- : -- 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. imageType :: Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'Ec2Configuration' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'imageIdOverride', 'ec2Configuration_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 -- -- in the /Amazon Elastic Container Service Developer Guide/. -- -- 'imageKubernetesVersion', 'ec2Configuration_imageKubernetesVersion' - The Kubernetes version for the compute environment. If you don\'t -- specify a value, the latest version that Batch supports is used. -- -- 'imageType', 'ec2Configuration_imageType' - The image type to match with the instance type to select an AMI. The -- supported values are different for @ECS@ and @EKS@ resources. -- -- [ECS] -- If the @imageIdOverride@ parameter isn\'t specified, then a recent -- -- (@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. -- -- [ECS_AL2] -- : -- Default for all non-GPU instance families. -- -- [ECS_AL2_NVIDIA] -- : -- 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_AL1] -- . -- Amazon Linux has reached the end-of-life of standard support. -- For more information, see -- . -- -- [EKS] -- If the @imageIdOverride@ parameter isn\'t specified, then a recent -- -- (@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. -- -- [EKS_AL2] -- : -- Default for all non-GPU instance families. -- -- [EKS_AL2_NVIDIA] -- : -- 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. newEc2Configuration :: -- | 'imageType' Prelude.Text -> Ec2Configuration newEc2Configuration pImageType_ = Ec2Configuration' { imageIdOverride = Prelude.Nothing, imageKubernetesVersion = Prelude.Nothing, imageType = pImageType_ } -- | 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 -- -- in the /Amazon Elastic Container Service Developer Guide/. ec2Configuration_imageIdOverride :: Lens.Lens' Ec2Configuration (Prelude.Maybe Prelude.Text) ec2Configuration_imageIdOverride = Lens.lens (\Ec2Configuration' {imageIdOverride} -> imageIdOverride) (\s@Ec2Configuration' {} a -> s {imageIdOverride = a} :: Ec2Configuration) -- | The Kubernetes version for the compute environment. If you don\'t -- specify a value, the latest version that Batch supports is used. ec2Configuration_imageKubernetesVersion :: Lens.Lens' Ec2Configuration (Prelude.Maybe Prelude.Text) ec2Configuration_imageKubernetesVersion = Lens.lens (\Ec2Configuration' {imageKubernetesVersion} -> imageKubernetesVersion) (\s@Ec2Configuration' {} a -> s {imageKubernetesVersion = a} :: Ec2Configuration) -- | The image type to match with the instance type to select an AMI. The -- supported values are different for @ECS@ and @EKS@ resources. -- -- [ECS] -- If the @imageIdOverride@ parameter isn\'t specified, then a recent -- -- (@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. -- -- [ECS_AL2] -- : -- Default for all non-GPU instance families. -- -- [ECS_AL2_NVIDIA] -- : -- 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_AL1] -- . -- Amazon Linux has reached the end-of-life of standard support. -- For more information, see -- . -- -- [EKS] -- If the @imageIdOverride@ parameter isn\'t specified, then a recent -- -- (@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. -- -- [EKS_AL2] -- : -- Default for all non-GPU instance families. -- -- [EKS_AL2_NVIDIA] -- : -- 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. ec2Configuration_imageType :: Lens.Lens' Ec2Configuration Prelude.Text ec2Configuration_imageType = Lens.lens (\Ec2Configuration' {imageType} -> imageType) (\s@Ec2Configuration' {} a -> s {imageType = a} :: Ec2Configuration) instance Data.FromJSON Ec2Configuration where parseJSON = Data.withObject "Ec2Configuration" ( \x -> Ec2Configuration' Prelude.<$> (x Data..:? "imageIdOverride") Prelude.<*> (x Data..:? "imageKubernetesVersion") Prelude.<*> (x Data..: "imageType") ) instance Prelude.Hashable Ec2Configuration where hashWithSalt _salt Ec2Configuration' {..} = _salt `Prelude.hashWithSalt` imageIdOverride `Prelude.hashWithSalt` imageKubernetesVersion `Prelude.hashWithSalt` imageType instance Prelude.NFData Ec2Configuration where rnf Ec2Configuration' {..} = Prelude.rnf imageIdOverride `Prelude.seq` Prelude.rnf imageKubernetesVersion `Prelude.seq` Prelude.rnf imageType instance Data.ToJSON Ec2Configuration where toJSON Ec2Configuration' {..} = Data.object ( Prelude.catMaybes [ ("imageIdOverride" Data..=) Prelude.<$> imageIdOverride, ("imageKubernetesVersion" Data..=) Prelude.<$> imageKubernetesVersion, Prelude.Just ("imageType" Data..= imageType) ] )