{-# 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.EksContainer
-- 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.EksContainer where

import Amazonka.Batch.Types.EksContainerEnvironmentVariable
import Amazonka.Batch.Types.EksContainerResourceRequirements
import Amazonka.Batch.Types.EksContainerSecurityContext
import Amazonka.Batch.Types.EksContainerVolumeMount
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

-- | EKS container properties are used in job definitions for Amazon EKS
-- based job definitions to describe the properties for a container node in
-- the pod that\'s launched as part of a job. This can\'t be specified for
-- Amazon ECS based job definitions.
--
-- /See:/ 'newEksContainer' smart constructor.
data EksContainer = EksContainer'
  { -- | An array of arguments to the entrypoint. If this isn\'t specified, the
    -- @CMD@ of the container image is used. This corresponds to the @args@
    -- member in the
    -- <https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#entrypoint Entrypoint>
    -- portion of the
    -- <https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/ Pod>
    -- in Kubernetes. Environment variable references are expanded using the
    -- container\'s environment.
    --
    -- If the referenced environment variable doesn\'t exist, the reference in
    -- the command isn\'t changed. For example, if the reference is to
    -- \"@$(NAME1)@\" and the @NAME1@ environment variable doesn\'t exist, the
    -- command string will remain \"@$(NAME1)@.\" @$$@ is replaced with @$@,
    -- and the resulting string isn\'t expanded. For example, @$$(VAR_NAME)@ is
    -- passed as @$(VAR_NAME)@ whether or not the @VAR_NAME@ environment
    -- variable exists. For more information, see
    -- <https://docs.docker.com/engine/reference/builder/#cmd CMD> in the
    -- /Dockerfile reference/ and
    -- <https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/ Define a command and arguments for a pod>
    -- in the /Kubernetes documentation/.
    EksContainer -> Maybe [Text]
args :: Prelude.Maybe [Prelude.Text],
    -- | The entrypoint for the container. This isn\'t run within a shell. If
    -- this isn\'t specified, the @ENTRYPOINT@ of the container image is used.
    -- Environment variable references are expanded using the container\'s
    -- environment.
    --
    -- If the referenced environment variable doesn\'t exist, the reference in
    -- the command isn\'t changed. For example, if the reference is to
    -- \"@$(NAME1)@\" and the @NAME1@ environment variable doesn\'t exist, the
    -- command string will remain \"@$(NAME1)@.\" @$$@ is replaced with @$@ and
    -- the resulting string isn\'t expanded. For example, @$$(VAR_NAME)@ will
    -- be passed as @$(VAR_NAME)@ whether or not the @VAR_NAME@ environment
    -- variable exists. The entrypoint can\'t be updated. For more information,
    -- see
    -- <https://docs.docker.com/engine/reference/builder/#entrypoint ENTRYPOINT>
    -- in the /Dockerfile reference/ and
    -- <https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/ Define a command and arguments for a container>
    -- and
    -- <https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#entrypoint Entrypoint>
    -- in the /Kubernetes documentation/.
    EksContainer -> Maybe [Text]
command :: Prelude.Maybe [Prelude.Text],
    -- | The environment variables to pass to a container.
    --
    -- Environment variables cannot start with \"@AWS_BATCH@\". This naming
    -- convention is reserved for variables that Batch sets.
    EksContainer -> Maybe [EksContainerEnvironmentVariable]
env :: Prelude.Maybe [EksContainerEnvironmentVariable],
    -- | The image pull policy for the container. Supported values are @Always@,
    -- @IfNotPresent@, and @Never@. This parameter defaults to @IfNotPresent@.
    -- However, if the @:latest@ tag is specified, it defaults to @Always@. For
    -- more information, see
    -- <https://kubernetes.io/docs/concepts/containers/images/#updating-images Updating images>
    -- in the /Kubernetes documentation/.
    EksContainer -> Maybe Text
imagePullPolicy :: Prelude.Maybe Prelude.Text,
    -- | The name of the container. If the name isn\'t specified, the default
    -- name \"@Default@\" is used. Each container in a pod must have a unique
    -- name.
    EksContainer -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The type and amount of resources to assign to a container. The supported
    -- resources include @memory@, @cpu@, and @nvidia.com\/gpu@. For more
    -- information, see
    -- <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ Resource management for pods and containers>
    -- in the /Kubernetes documentation/.
    EksContainer -> Maybe EksContainerResourceRequirements
resources :: Prelude.Maybe EksContainerResourceRequirements,
    -- | The security context for a job. For more information, see
    -- <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ Configure a security context for a pod or container>
    -- in the /Kubernetes documentation/.
    EksContainer -> Maybe EksContainerSecurityContext
securityContext :: Prelude.Maybe EksContainerSecurityContext,
    -- | The volume mounts for the container. Batch supports @emptyDir@,
    -- @hostPath@, and @secret@ volume types. For more information about
    -- volumes and volume mounts in Kubernetes, see
    -- <https://kubernetes.io/docs/concepts/storage/volumes/ Volumes> in the
    -- /Kubernetes documentation/.
    EksContainer -> Maybe [EksContainerVolumeMount]
volumeMounts :: Prelude.Maybe [EksContainerVolumeMount],
    -- | The Docker image used to start the container.
    EksContainer -> Text
image :: Prelude.Text
  }
  deriving (EksContainer -> EksContainer -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EksContainer -> EksContainer -> Bool
$c/= :: EksContainer -> EksContainer -> Bool
== :: EksContainer -> EksContainer -> Bool
$c== :: EksContainer -> EksContainer -> Bool
Prelude.Eq, ReadPrec [EksContainer]
ReadPrec EksContainer
Int -> ReadS EksContainer
ReadS [EksContainer]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EksContainer]
$creadListPrec :: ReadPrec [EksContainer]
readPrec :: ReadPrec EksContainer
$creadPrec :: ReadPrec EksContainer
readList :: ReadS [EksContainer]
$creadList :: ReadS [EksContainer]
readsPrec :: Int -> ReadS EksContainer
$creadsPrec :: Int -> ReadS EksContainer
Prelude.Read, Int -> EksContainer -> ShowS
[EksContainer] -> ShowS
EksContainer -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EksContainer] -> ShowS
$cshowList :: [EksContainer] -> ShowS
show :: EksContainer -> String
$cshow :: EksContainer -> String
showsPrec :: Int -> EksContainer -> ShowS
$cshowsPrec :: Int -> EksContainer -> ShowS
Prelude.Show, forall x. Rep EksContainer x -> EksContainer
forall x. EksContainer -> Rep EksContainer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EksContainer x -> EksContainer
$cfrom :: forall x. EksContainer -> Rep EksContainer x
Prelude.Generic)

-- |
-- Create a value of 'EksContainer' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'args', 'eksContainer_args' - An array of arguments to the entrypoint. If this isn\'t specified, the
-- @CMD@ of the container image is used. This corresponds to the @args@
-- member in the
-- <https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#entrypoint Entrypoint>
-- portion of the
-- <https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/ Pod>
-- in Kubernetes. Environment variable references are expanded using the
-- container\'s environment.
--
-- If the referenced environment variable doesn\'t exist, the reference in
-- the command isn\'t changed. For example, if the reference is to
-- \"@$(NAME1)@\" and the @NAME1@ environment variable doesn\'t exist, the
-- command string will remain \"@$(NAME1)@.\" @$$@ is replaced with @$@,
-- and the resulting string isn\'t expanded. For example, @$$(VAR_NAME)@ is
-- passed as @$(VAR_NAME)@ whether or not the @VAR_NAME@ environment
-- variable exists. For more information, see
-- <https://docs.docker.com/engine/reference/builder/#cmd CMD> in the
-- /Dockerfile reference/ and
-- <https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/ Define a command and arguments for a pod>
-- in the /Kubernetes documentation/.
--
-- 'command', 'eksContainer_command' - The entrypoint for the container. This isn\'t run within a shell. If
-- this isn\'t specified, the @ENTRYPOINT@ of the container image is used.
-- Environment variable references are expanded using the container\'s
-- environment.
--
-- If the referenced environment variable doesn\'t exist, the reference in
-- the command isn\'t changed. For example, if the reference is to
-- \"@$(NAME1)@\" and the @NAME1@ environment variable doesn\'t exist, the
-- command string will remain \"@$(NAME1)@.\" @$$@ is replaced with @$@ and
-- the resulting string isn\'t expanded. For example, @$$(VAR_NAME)@ will
-- be passed as @$(VAR_NAME)@ whether or not the @VAR_NAME@ environment
-- variable exists. The entrypoint can\'t be updated. For more information,
-- see
-- <https://docs.docker.com/engine/reference/builder/#entrypoint ENTRYPOINT>
-- in the /Dockerfile reference/ and
-- <https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/ Define a command and arguments for a container>
-- and
-- <https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#entrypoint Entrypoint>
-- in the /Kubernetes documentation/.
--
-- 'env', 'eksContainer_env' - The environment variables to pass to a container.
--
-- Environment variables cannot start with \"@AWS_BATCH@\". This naming
-- convention is reserved for variables that Batch sets.
--
-- 'imagePullPolicy', 'eksContainer_imagePullPolicy' - The image pull policy for the container. Supported values are @Always@,
-- @IfNotPresent@, and @Never@. This parameter defaults to @IfNotPresent@.
-- However, if the @:latest@ tag is specified, it defaults to @Always@. For
-- more information, see
-- <https://kubernetes.io/docs/concepts/containers/images/#updating-images Updating images>
-- in the /Kubernetes documentation/.
--
-- 'name', 'eksContainer_name' - The name of the container. If the name isn\'t specified, the default
-- name \"@Default@\" is used. Each container in a pod must have a unique
-- name.
--
-- 'resources', 'eksContainer_resources' - The type and amount of resources to assign to a container. The supported
-- resources include @memory@, @cpu@, and @nvidia.com\/gpu@. For more
-- information, see
-- <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ Resource management for pods and containers>
-- in the /Kubernetes documentation/.
--
-- 'securityContext', 'eksContainer_securityContext' - The security context for a job. For more information, see
-- <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ Configure a security context for a pod or container>
-- in the /Kubernetes documentation/.
--
-- 'volumeMounts', 'eksContainer_volumeMounts' - The volume mounts for the container. Batch supports @emptyDir@,
-- @hostPath@, and @secret@ volume types. For more information about
-- volumes and volume mounts in Kubernetes, see
-- <https://kubernetes.io/docs/concepts/storage/volumes/ Volumes> in the
-- /Kubernetes documentation/.
--
-- 'image', 'eksContainer_image' - The Docker image used to start the container.
newEksContainer ::
  -- | 'image'
  Prelude.Text ->
  EksContainer
newEksContainer :: Text -> EksContainer
newEksContainer Text
pImage_ =
  EksContainer'
    { $sel:args:EksContainer' :: Maybe [Text]
args = forall a. Maybe a
Prelude.Nothing,
      $sel:command:EksContainer' :: Maybe [Text]
command = forall a. Maybe a
Prelude.Nothing,
      $sel:env:EksContainer' :: Maybe [EksContainerEnvironmentVariable]
env = forall a. Maybe a
Prelude.Nothing,
      $sel:imagePullPolicy:EksContainer' :: Maybe Text
imagePullPolicy = forall a. Maybe a
Prelude.Nothing,
      $sel:name:EksContainer' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:resources:EksContainer' :: Maybe EksContainerResourceRequirements
resources = forall a. Maybe a
Prelude.Nothing,
      $sel:securityContext:EksContainer' :: Maybe EksContainerSecurityContext
securityContext = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeMounts:EksContainer' :: Maybe [EksContainerVolumeMount]
volumeMounts = forall a. Maybe a
Prelude.Nothing,
      $sel:image:EksContainer' :: Text
image = Text
pImage_
    }

-- | An array of arguments to the entrypoint. If this isn\'t specified, the
-- @CMD@ of the container image is used. This corresponds to the @args@
-- member in the
-- <https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#entrypoint Entrypoint>
-- portion of the
-- <https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/ Pod>
-- in Kubernetes. Environment variable references are expanded using the
-- container\'s environment.
--
-- If the referenced environment variable doesn\'t exist, the reference in
-- the command isn\'t changed. For example, if the reference is to
-- \"@$(NAME1)@\" and the @NAME1@ environment variable doesn\'t exist, the
-- command string will remain \"@$(NAME1)@.\" @$$@ is replaced with @$@,
-- and the resulting string isn\'t expanded. For example, @$$(VAR_NAME)@ is
-- passed as @$(VAR_NAME)@ whether or not the @VAR_NAME@ environment
-- variable exists. For more information, see
-- <https://docs.docker.com/engine/reference/builder/#cmd CMD> in the
-- /Dockerfile reference/ and
-- <https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/ Define a command and arguments for a pod>
-- in the /Kubernetes documentation/.
eksContainer_args :: Lens.Lens' EksContainer (Prelude.Maybe [Prelude.Text])
eksContainer_args :: Lens' EksContainer (Maybe [Text])
eksContainer_args = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EksContainer' {Maybe [Text]
args :: Maybe [Text]
$sel:args:EksContainer' :: EksContainer -> Maybe [Text]
args} -> Maybe [Text]
args) (\s :: EksContainer
s@EksContainer' {} Maybe [Text]
a -> EksContainer
s {$sel:args:EksContainer' :: Maybe [Text]
args = Maybe [Text]
a} :: EksContainer) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The entrypoint for the container. This isn\'t run within a shell. If
-- this isn\'t specified, the @ENTRYPOINT@ of the container image is used.
-- Environment variable references are expanded using the container\'s
-- environment.
--
-- If the referenced environment variable doesn\'t exist, the reference in
-- the command isn\'t changed. For example, if the reference is to
-- \"@$(NAME1)@\" and the @NAME1@ environment variable doesn\'t exist, the
-- command string will remain \"@$(NAME1)@.\" @$$@ is replaced with @$@ and
-- the resulting string isn\'t expanded. For example, @$$(VAR_NAME)@ will
-- be passed as @$(VAR_NAME)@ whether or not the @VAR_NAME@ environment
-- variable exists. The entrypoint can\'t be updated. For more information,
-- see
-- <https://docs.docker.com/engine/reference/builder/#entrypoint ENTRYPOINT>
-- in the /Dockerfile reference/ and
-- <https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/ Define a command and arguments for a container>
-- and
-- <https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#entrypoint Entrypoint>
-- in the /Kubernetes documentation/.
eksContainer_command :: Lens.Lens' EksContainer (Prelude.Maybe [Prelude.Text])
eksContainer_command :: Lens' EksContainer (Maybe [Text])
eksContainer_command = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EksContainer' {Maybe [Text]
command :: Maybe [Text]
$sel:command:EksContainer' :: EksContainer -> Maybe [Text]
command} -> Maybe [Text]
command) (\s :: EksContainer
s@EksContainer' {} Maybe [Text]
a -> EksContainer
s {$sel:command:EksContainer' :: Maybe [Text]
command = Maybe [Text]
a} :: EksContainer) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The environment variables to pass to a container.
--
-- Environment variables cannot start with \"@AWS_BATCH@\". This naming
-- convention is reserved for variables that Batch sets.
eksContainer_env :: Lens.Lens' EksContainer (Prelude.Maybe [EksContainerEnvironmentVariable])
eksContainer_env :: Lens' EksContainer (Maybe [EksContainerEnvironmentVariable])
eksContainer_env = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EksContainer' {Maybe [EksContainerEnvironmentVariable]
env :: Maybe [EksContainerEnvironmentVariable]
$sel:env:EksContainer' :: EksContainer -> Maybe [EksContainerEnvironmentVariable]
env} -> Maybe [EksContainerEnvironmentVariable]
env) (\s :: EksContainer
s@EksContainer' {} Maybe [EksContainerEnvironmentVariable]
a -> EksContainer
s {$sel:env:EksContainer' :: Maybe [EksContainerEnvironmentVariable]
env = Maybe [EksContainerEnvironmentVariable]
a} :: EksContainer) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The image pull policy for the container. Supported values are @Always@,
-- @IfNotPresent@, and @Never@. This parameter defaults to @IfNotPresent@.
-- However, if the @:latest@ tag is specified, it defaults to @Always@. For
-- more information, see
-- <https://kubernetes.io/docs/concepts/containers/images/#updating-images Updating images>
-- in the /Kubernetes documentation/.
eksContainer_imagePullPolicy :: Lens.Lens' EksContainer (Prelude.Maybe Prelude.Text)
eksContainer_imagePullPolicy :: Lens' EksContainer (Maybe Text)
eksContainer_imagePullPolicy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EksContainer' {Maybe Text
imagePullPolicy :: Maybe Text
$sel:imagePullPolicy:EksContainer' :: EksContainer -> Maybe Text
imagePullPolicy} -> Maybe Text
imagePullPolicy) (\s :: EksContainer
s@EksContainer' {} Maybe Text
a -> EksContainer
s {$sel:imagePullPolicy:EksContainer' :: Maybe Text
imagePullPolicy = Maybe Text
a} :: EksContainer)

-- | The name of the container. If the name isn\'t specified, the default
-- name \"@Default@\" is used. Each container in a pod must have a unique
-- name.
eksContainer_name :: Lens.Lens' EksContainer (Prelude.Maybe Prelude.Text)
eksContainer_name :: Lens' EksContainer (Maybe Text)
eksContainer_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EksContainer' {Maybe Text
name :: Maybe Text
$sel:name:EksContainer' :: EksContainer -> Maybe Text
name} -> Maybe Text
name) (\s :: EksContainer
s@EksContainer' {} Maybe Text
a -> EksContainer
s {$sel:name:EksContainer' :: Maybe Text
name = Maybe Text
a} :: EksContainer)

-- | The type and amount of resources to assign to a container. The supported
-- resources include @memory@, @cpu@, and @nvidia.com\/gpu@. For more
-- information, see
-- <https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ Resource management for pods and containers>
-- in the /Kubernetes documentation/.
eksContainer_resources :: Lens.Lens' EksContainer (Prelude.Maybe EksContainerResourceRequirements)
eksContainer_resources :: Lens' EksContainer (Maybe EksContainerResourceRequirements)
eksContainer_resources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EksContainer' {Maybe EksContainerResourceRequirements
resources :: Maybe EksContainerResourceRequirements
$sel:resources:EksContainer' :: EksContainer -> Maybe EksContainerResourceRequirements
resources} -> Maybe EksContainerResourceRequirements
resources) (\s :: EksContainer
s@EksContainer' {} Maybe EksContainerResourceRequirements
a -> EksContainer
s {$sel:resources:EksContainer' :: Maybe EksContainerResourceRequirements
resources = Maybe EksContainerResourceRequirements
a} :: EksContainer)

-- | The security context for a job. For more information, see
-- <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ Configure a security context for a pod or container>
-- in the /Kubernetes documentation/.
eksContainer_securityContext :: Lens.Lens' EksContainer (Prelude.Maybe EksContainerSecurityContext)
eksContainer_securityContext :: Lens' EksContainer (Maybe EksContainerSecurityContext)
eksContainer_securityContext = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EksContainer' {Maybe EksContainerSecurityContext
securityContext :: Maybe EksContainerSecurityContext
$sel:securityContext:EksContainer' :: EksContainer -> Maybe EksContainerSecurityContext
securityContext} -> Maybe EksContainerSecurityContext
securityContext) (\s :: EksContainer
s@EksContainer' {} Maybe EksContainerSecurityContext
a -> EksContainer
s {$sel:securityContext:EksContainer' :: Maybe EksContainerSecurityContext
securityContext = Maybe EksContainerSecurityContext
a} :: EksContainer)

-- | The volume mounts for the container. Batch supports @emptyDir@,
-- @hostPath@, and @secret@ volume types. For more information about
-- volumes and volume mounts in Kubernetes, see
-- <https://kubernetes.io/docs/concepts/storage/volumes/ Volumes> in the
-- /Kubernetes documentation/.
eksContainer_volumeMounts :: Lens.Lens' EksContainer (Prelude.Maybe [EksContainerVolumeMount])
eksContainer_volumeMounts :: Lens' EksContainer (Maybe [EksContainerVolumeMount])
eksContainer_volumeMounts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EksContainer' {Maybe [EksContainerVolumeMount]
volumeMounts :: Maybe [EksContainerVolumeMount]
$sel:volumeMounts:EksContainer' :: EksContainer -> Maybe [EksContainerVolumeMount]
volumeMounts} -> Maybe [EksContainerVolumeMount]
volumeMounts) (\s :: EksContainer
s@EksContainer' {} Maybe [EksContainerVolumeMount]
a -> EksContainer
s {$sel:volumeMounts:EksContainer' :: Maybe [EksContainerVolumeMount]
volumeMounts = Maybe [EksContainerVolumeMount]
a} :: EksContainer) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Docker image used to start the container.
eksContainer_image :: Lens.Lens' EksContainer Prelude.Text
eksContainer_image :: Lens' EksContainer Text
eksContainer_image = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EksContainer' {Text
image :: Text
$sel:image:EksContainer' :: EksContainer -> Text
image} -> Text
image) (\s :: EksContainer
s@EksContainer' {} Text
a -> EksContainer
s {$sel:image:EksContainer' :: Text
image = Text
a} :: EksContainer)

instance Data.FromJSON EksContainer where
  parseJSON :: Value -> Parser EksContainer
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EksContainer"
      ( \Object
x ->
          Maybe [Text]
-> Maybe [Text]
-> Maybe [EksContainerEnvironmentVariable]
-> Maybe Text
-> Maybe Text
-> Maybe EksContainerResourceRequirements
-> Maybe EksContainerSecurityContext
-> Maybe [EksContainerVolumeMount]
-> Text
-> EksContainer
EksContainer'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"args" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"command" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"env" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"imagePullPolicy")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"resources")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"securityContext")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"volumeMounts" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"image")
      )

instance Prelude.Hashable EksContainer where
  hashWithSalt :: Int -> EksContainer -> Int
hashWithSalt Int
_salt EksContainer' {Maybe [Text]
Maybe [EksContainerEnvironmentVariable]
Maybe [EksContainerVolumeMount]
Maybe Text
Maybe EksContainerResourceRequirements
Maybe EksContainerSecurityContext
Text
image :: Text
volumeMounts :: Maybe [EksContainerVolumeMount]
securityContext :: Maybe EksContainerSecurityContext
resources :: Maybe EksContainerResourceRequirements
name :: Maybe Text
imagePullPolicy :: Maybe Text
env :: Maybe [EksContainerEnvironmentVariable]
command :: Maybe [Text]
args :: Maybe [Text]
$sel:image:EksContainer' :: EksContainer -> Text
$sel:volumeMounts:EksContainer' :: EksContainer -> Maybe [EksContainerVolumeMount]
$sel:securityContext:EksContainer' :: EksContainer -> Maybe EksContainerSecurityContext
$sel:resources:EksContainer' :: EksContainer -> Maybe EksContainerResourceRequirements
$sel:name:EksContainer' :: EksContainer -> Maybe Text
$sel:imagePullPolicy:EksContainer' :: EksContainer -> Maybe Text
$sel:env:EksContainer' :: EksContainer -> Maybe [EksContainerEnvironmentVariable]
$sel:command:EksContainer' :: EksContainer -> Maybe [Text]
$sel:args:EksContainer' :: EksContainer -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
args
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
command
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [EksContainerEnvironmentVariable]
env
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
imagePullPolicy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EksContainerResourceRequirements
resources
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EksContainerSecurityContext
securityContext
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [EksContainerVolumeMount]
volumeMounts
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
image

instance Prelude.NFData EksContainer where
  rnf :: EksContainer -> ()
rnf EksContainer' {Maybe [Text]
Maybe [EksContainerEnvironmentVariable]
Maybe [EksContainerVolumeMount]
Maybe Text
Maybe EksContainerResourceRequirements
Maybe EksContainerSecurityContext
Text
image :: Text
volumeMounts :: Maybe [EksContainerVolumeMount]
securityContext :: Maybe EksContainerSecurityContext
resources :: Maybe EksContainerResourceRequirements
name :: Maybe Text
imagePullPolicy :: Maybe Text
env :: Maybe [EksContainerEnvironmentVariable]
command :: Maybe [Text]
args :: Maybe [Text]
$sel:image:EksContainer' :: EksContainer -> Text
$sel:volumeMounts:EksContainer' :: EksContainer -> Maybe [EksContainerVolumeMount]
$sel:securityContext:EksContainer' :: EksContainer -> Maybe EksContainerSecurityContext
$sel:resources:EksContainer' :: EksContainer -> Maybe EksContainerResourceRequirements
$sel:name:EksContainer' :: EksContainer -> Maybe Text
$sel:imagePullPolicy:EksContainer' :: EksContainer -> Maybe Text
$sel:env:EksContainer' :: EksContainer -> Maybe [EksContainerEnvironmentVariable]
$sel:command:EksContainer' :: EksContainer -> Maybe [Text]
$sel:args:EksContainer' :: EksContainer -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
args
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
command
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [EksContainerEnvironmentVariable]
env
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
imagePullPolicy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EksContainerResourceRequirements
resources
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EksContainerSecurityContext
securityContext
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [EksContainerVolumeMount]
volumeMounts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
image

instance Data.ToJSON EksContainer where
  toJSON :: EksContainer -> Value
toJSON EksContainer' {Maybe [Text]
Maybe [EksContainerEnvironmentVariable]
Maybe [EksContainerVolumeMount]
Maybe Text
Maybe EksContainerResourceRequirements
Maybe EksContainerSecurityContext
Text
image :: Text
volumeMounts :: Maybe [EksContainerVolumeMount]
securityContext :: Maybe EksContainerSecurityContext
resources :: Maybe EksContainerResourceRequirements
name :: Maybe Text
imagePullPolicy :: Maybe Text
env :: Maybe [EksContainerEnvironmentVariable]
command :: Maybe [Text]
args :: Maybe [Text]
$sel:image:EksContainer' :: EksContainer -> Text
$sel:volumeMounts:EksContainer' :: EksContainer -> Maybe [EksContainerVolumeMount]
$sel:securityContext:EksContainer' :: EksContainer -> Maybe EksContainerSecurityContext
$sel:resources:EksContainer' :: EksContainer -> Maybe EksContainerResourceRequirements
$sel:name:EksContainer' :: EksContainer -> Maybe Text
$sel:imagePullPolicy:EksContainer' :: EksContainer -> Maybe Text
$sel:env:EksContainer' :: EksContainer -> Maybe [EksContainerEnvironmentVariable]
$sel:command:EksContainer' :: EksContainer -> Maybe [Text]
$sel:args:EksContainer' :: EksContainer -> Maybe [Text]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"args" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
args,
            (Key
"command" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
command,
            (Key
"env" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EksContainerEnvironmentVariable]
env,
            (Key
"imagePullPolicy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
imagePullPolicy,
            (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Key
"resources" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EksContainerResourceRequirements
resources,
            (Key
"securityContext" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EksContainerSecurityContext
securityContext,
            (Key
"volumeMounts" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EksContainerVolumeMount]
volumeMounts,
            forall a. a -> Maybe a
Prelude.Just (Key
"image" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
image)
          ]
      )