{-# 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.ECS.Types.Deployment
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ECS.Types.Deployment where

import qualified Amazonka.Core as Core
import Amazonka.ECS.Types.CapacityProviderStrategyItem
import Amazonka.ECS.Types.DeploymentRolloutState
import Amazonka.ECS.Types.LaunchType
import Amazonka.ECS.Types.NetworkConfiguration
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The details of an Amazon ECS service deployment. This is used only when
-- a service uses the @ECS@ deployment controller type.
--
-- /See:/ 'newDeployment' smart constructor.
data Deployment = Deployment'
  { -- | The @rolloutState@ of a service is only returned for services that use
    -- the rolling update (@ECS@) deployment type that are not behind a Classic
    -- Load Balancer.
    --
    -- The rollout state of the deployment. When a service deployment is
    -- started, it begins in an @IN_PROGRESS@ state. When the service reaches a
    -- steady state, the deployment will transition to a @COMPLETED@ state. If
    -- the service fails to reach a steady state and circuit breaker is
    -- enabled, the deployment will transition to a @FAILED@ state. A
    -- deployment in @FAILED@ state will launch no new tasks. For more
    -- information, see DeploymentCircuitBreaker.
    Deployment -> Maybe DeploymentRolloutState
rolloutState :: Prelude.Maybe DeploymentRolloutState,
    -- | The number of tasks in the deployment that are in the @RUNNING@ status.
    Deployment -> Maybe Int
runningCount :: Prelude.Maybe Prelude.Int,
    -- | The status of the deployment. The following describes each state:
    --
    -- [PRIMARY]
    --     The most recent deployment of a service.
    --
    -- [ACTIVE]
    --     A service deployment that still has running tasks, but are in the
    --     process of being replaced with a new @PRIMARY@ deployment.
    --
    -- [INACTIVE]
    --     A deployment that has been completely replaced.
    Deployment -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The Unix timestamp for when the service deployment was created.
    Deployment -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The platform version on which your tasks in the service are running. A
    -- platform version is only specified for tasks using the Fargate launch
    -- type. If one is not specified, the @LATEST@ platform version is used by
    -- default. For more information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html Fargate Platform Versions>
    -- in the /Amazon Elastic Container Service Developer Guide/.
    Deployment -> Maybe Text
platformVersion :: Prelude.Maybe Prelude.Text,
    -- | The most recent desired count of tasks that was specified for the
    -- service to deploy or maintain.
    Deployment -> Maybe Int
desiredCount :: Prelude.Maybe Prelude.Int,
    -- | The number of tasks in the deployment that are in the @PENDING@ status.
    Deployment -> Maybe Int
pendingCount :: Prelude.Maybe Prelude.Int,
    -- | The ID of the deployment.
    Deployment -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The number of consecutively failed tasks in the deployment. A task is
    -- considered a failure if the service scheduler can\'t launch the task,
    -- the task doesn\'t transition to a @RUNNING@ state, or if it fails any of
    -- its defined health checks and is stopped.
    --
    -- Once a service deployment has one or more successfully running tasks,
    -- the failed task count resets to zero and stops being evaluated.
    Deployment -> Maybe Int
failedTasks :: Prelude.Maybe Prelude.Int,
    -- | The launch type the tasks in the service are using. For more
    -- information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html Amazon ECS Launch Types>
    -- in the /Amazon Elastic Container Service Developer Guide/.
    Deployment -> Maybe LaunchType
launchType :: Prelude.Maybe LaunchType,
    -- | The Unix timestamp for when the service deployment was last updated.
    Deployment -> Maybe POSIX
updatedAt :: Prelude.Maybe Core.POSIX,
    -- | The most recent task definition that was specified for the tasks in the
    -- service to use.
    Deployment -> Maybe Text
taskDefinition :: Prelude.Maybe Prelude.Text,
    -- | A description of the rollout state of a deployment.
    Deployment -> Maybe Text
rolloutStateReason :: Prelude.Maybe Prelude.Text,
    -- | The VPC subnet and security group configuration for tasks that receive
    -- their own elastic network interface by using the @awsvpc@ networking
    -- mode.
    Deployment -> Maybe NetworkConfiguration
networkConfiguration :: Prelude.Maybe NetworkConfiguration,
    -- | The capacity provider strategy that the deployment is using.
    Deployment -> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy :: Prelude.Maybe [CapacityProviderStrategyItem]
  }
  deriving (Deployment -> Deployment -> Bool
(Deployment -> Deployment -> Bool)
-> (Deployment -> Deployment -> Bool) -> Eq Deployment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Deployment -> Deployment -> Bool
$c/= :: Deployment -> Deployment -> Bool
== :: Deployment -> Deployment -> Bool
$c== :: Deployment -> Deployment -> Bool
Prelude.Eq, ReadPrec [Deployment]
ReadPrec Deployment
Int -> ReadS Deployment
ReadS [Deployment]
(Int -> ReadS Deployment)
-> ReadS [Deployment]
-> ReadPrec Deployment
-> ReadPrec [Deployment]
-> Read Deployment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Deployment]
$creadListPrec :: ReadPrec [Deployment]
readPrec :: ReadPrec Deployment
$creadPrec :: ReadPrec Deployment
readList :: ReadS [Deployment]
$creadList :: ReadS [Deployment]
readsPrec :: Int -> ReadS Deployment
$creadsPrec :: Int -> ReadS Deployment
Prelude.Read, Int -> Deployment -> ShowS
[Deployment] -> ShowS
Deployment -> String
(Int -> Deployment -> ShowS)
-> (Deployment -> String)
-> ([Deployment] -> ShowS)
-> Show Deployment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Deployment] -> ShowS
$cshowList :: [Deployment] -> ShowS
show :: Deployment -> String
$cshow :: Deployment -> String
showsPrec :: Int -> Deployment -> ShowS
$cshowsPrec :: Int -> Deployment -> ShowS
Prelude.Show, (forall x. Deployment -> Rep Deployment x)
-> (forall x. Rep Deployment x -> Deployment) -> Generic Deployment
forall x. Rep Deployment x -> Deployment
forall x. Deployment -> Rep Deployment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Deployment x -> Deployment
$cfrom :: forall x. Deployment -> Rep Deployment x
Prelude.Generic)

-- |
-- Create a value of 'Deployment' 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:
--
-- 'rolloutState', 'deployment_rolloutState' - The @rolloutState@ of a service is only returned for services that use
-- the rolling update (@ECS@) deployment type that are not behind a Classic
-- Load Balancer.
--
-- The rollout state of the deployment. When a service deployment is
-- started, it begins in an @IN_PROGRESS@ state. When the service reaches a
-- steady state, the deployment will transition to a @COMPLETED@ state. If
-- the service fails to reach a steady state and circuit breaker is
-- enabled, the deployment will transition to a @FAILED@ state. A
-- deployment in @FAILED@ state will launch no new tasks. For more
-- information, see DeploymentCircuitBreaker.
--
-- 'runningCount', 'deployment_runningCount' - The number of tasks in the deployment that are in the @RUNNING@ status.
--
-- 'status', 'deployment_status' - The status of the deployment. The following describes each state:
--
-- [PRIMARY]
--     The most recent deployment of a service.
--
-- [ACTIVE]
--     A service deployment that still has running tasks, but are in the
--     process of being replaced with a new @PRIMARY@ deployment.
--
-- [INACTIVE]
--     A deployment that has been completely replaced.
--
-- 'createdAt', 'deployment_createdAt' - The Unix timestamp for when the service deployment was created.
--
-- 'platformVersion', 'deployment_platformVersion' - The platform version on which your tasks in the service are running. A
-- platform version is only specified for tasks using the Fargate launch
-- type. If one is not specified, the @LATEST@ platform version is used by
-- default. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html Fargate Platform Versions>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- 'desiredCount', 'deployment_desiredCount' - The most recent desired count of tasks that was specified for the
-- service to deploy or maintain.
--
-- 'pendingCount', 'deployment_pendingCount' - The number of tasks in the deployment that are in the @PENDING@ status.
--
-- 'id', 'deployment_id' - The ID of the deployment.
--
-- 'failedTasks', 'deployment_failedTasks' - The number of consecutively failed tasks in the deployment. A task is
-- considered a failure if the service scheduler can\'t launch the task,
-- the task doesn\'t transition to a @RUNNING@ state, or if it fails any of
-- its defined health checks and is stopped.
--
-- Once a service deployment has one or more successfully running tasks,
-- the failed task count resets to zero and stops being evaluated.
--
-- 'launchType', 'deployment_launchType' - The launch type the tasks in the service are using. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html Amazon ECS Launch Types>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- 'updatedAt', 'deployment_updatedAt' - The Unix timestamp for when the service deployment was last updated.
--
-- 'taskDefinition', 'deployment_taskDefinition' - The most recent task definition that was specified for the tasks in the
-- service to use.
--
-- 'rolloutStateReason', 'deployment_rolloutStateReason' - A description of the rollout state of a deployment.
--
-- 'networkConfiguration', 'deployment_networkConfiguration' - The VPC subnet and security group configuration for tasks that receive
-- their own elastic network interface by using the @awsvpc@ networking
-- mode.
--
-- 'capacityProviderStrategy', 'deployment_capacityProviderStrategy' - The capacity provider strategy that the deployment is using.
newDeployment ::
  Deployment
newDeployment :: Deployment
newDeployment =
  Deployment' :: Maybe DeploymentRolloutState
-> Maybe Int
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe LaunchType
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe NetworkConfiguration
-> Maybe [CapacityProviderStrategyItem]
-> Deployment
Deployment'
    { $sel:rolloutState:Deployment' :: Maybe DeploymentRolloutState
rolloutState = Maybe DeploymentRolloutState
forall a. Maybe a
Prelude.Nothing,
      $sel:runningCount:Deployment' :: Maybe Int
runningCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:status:Deployment' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:Deployment' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:platformVersion:Deployment' :: Maybe Text
platformVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:desiredCount:Deployment' :: Maybe Int
desiredCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:pendingCount:Deployment' :: Maybe Int
pendingCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:id:Deployment' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:failedTasks:Deployment' :: Maybe Int
failedTasks = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:launchType:Deployment' :: Maybe LaunchType
launchType = Maybe LaunchType
forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:Deployment' :: Maybe POSIX
updatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:taskDefinition:Deployment' :: Maybe Text
taskDefinition = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:rolloutStateReason:Deployment' :: Maybe Text
rolloutStateReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:networkConfiguration:Deployment' :: Maybe NetworkConfiguration
networkConfiguration = Maybe NetworkConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:capacityProviderStrategy:Deployment' :: Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy = Maybe [CapacityProviderStrategyItem]
forall a. Maybe a
Prelude.Nothing
    }

-- | The @rolloutState@ of a service is only returned for services that use
-- the rolling update (@ECS@) deployment type that are not behind a Classic
-- Load Balancer.
--
-- The rollout state of the deployment. When a service deployment is
-- started, it begins in an @IN_PROGRESS@ state. When the service reaches a
-- steady state, the deployment will transition to a @COMPLETED@ state. If
-- the service fails to reach a steady state and circuit breaker is
-- enabled, the deployment will transition to a @FAILED@ state. A
-- deployment in @FAILED@ state will launch no new tasks. For more
-- information, see DeploymentCircuitBreaker.
deployment_rolloutState :: Lens.Lens' Deployment (Prelude.Maybe DeploymentRolloutState)
deployment_rolloutState :: (Maybe DeploymentRolloutState -> f (Maybe DeploymentRolloutState))
-> Deployment -> f Deployment
deployment_rolloutState = (Deployment -> Maybe DeploymentRolloutState)
-> (Deployment -> Maybe DeploymentRolloutState -> Deployment)
-> Lens
     Deployment
     Deployment
     (Maybe DeploymentRolloutState)
     (Maybe DeploymentRolloutState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe DeploymentRolloutState
rolloutState :: Maybe DeploymentRolloutState
$sel:rolloutState:Deployment' :: Deployment -> Maybe DeploymentRolloutState
rolloutState} -> Maybe DeploymentRolloutState
rolloutState) (\s :: Deployment
s@Deployment' {} Maybe DeploymentRolloutState
a -> Deployment
s {$sel:rolloutState:Deployment' :: Maybe DeploymentRolloutState
rolloutState = Maybe DeploymentRolloutState
a} :: Deployment)

-- | The number of tasks in the deployment that are in the @RUNNING@ status.
deployment_runningCount :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Int)
deployment_runningCount :: (Maybe Int -> f (Maybe Int)) -> Deployment -> f Deployment
deployment_runningCount = (Deployment -> Maybe Int)
-> (Deployment -> Maybe Int -> Deployment)
-> Lens Deployment Deployment (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Int
runningCount :: Maybe Int
$sel:runningCount:Deployment' :: Deployment -> Maybe Int
runningCount} -> Maybe Int
runningCount) (\s :: Deployment
s@Deployment' {} Maybe Int
a -> Deployment
s {$sel:runningCount:Deployment' :: Maybe Int
runningCount = Maybe Int
a} :: Deployment)

-- | The status of the deployment. The following describes each state:
--
-- [PRIMARY]
--     The most recent deployment of a service.
--
-- [ACTIVE]
--     A service deployment that still has running tasks, but are in the
--     process of being replaced with a new @PRIMARY@ deployment.
--
-- [INACTIVE]
--     A deployment that has been completely replaced.
deployment_status :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_status :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_status = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
status :: Maybe Text
$sel:status:Deployment' :: Deployment -> Maybe Text
status} -> Maybe Text
status) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:status:Deployment' :: Maybe Text
status = Maybe Text
a} :: Deployment)

-- | The Unix timestamp for when the service deployment was created.
deployment_createdAt :: Lens.Lens' Deployment (Prelude.Maybe Prelude.UTCTime)
deployment_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Deployment -> f Deployment
deployment_createdAt = (Deployment -> Maybe POSIX)
-> (Deployment -> Maybe POSIX -> Deployment)
-> Lens Deployment Deployment (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Deployment' :: Deployment -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Deployment
s@Deployment' {} Maybe POSIX
a -> Deployment
s {$sel:createdAt:Deployment' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Deployment) ((Maybe POSIX -> f (Maybe POSIX)) -> Deployment -> f Deployment)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Deployment
-> f Deployment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The platform version on which your tasks in the service are running. A
-- platform version is only specified for tasks using the Fargate launch
-- type. If one is not specified, the @LATEST@ platform version is used by
-- default. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html Fargate Platform Versions>
-- in the /Amazon Elastic Container Service Developer Guide/.
deployment_platformVersion :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_platformVersion :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_platformVersion = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
platformVersion :: Maybe Text
$sel:platformVersion:Deployment' :: Deployment -> Maybe Text
platformVersion} -> Maybe Text
platformVersion) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:platformVersion:Deployment' :: Maybe Text
platformVersion = Maybe Text
a} :: Deployment)

-- | The most recent desired count of tasks that was specified for the
-- service to deploy or maintain.
deployment_desiredCount :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Int)
deployment_desiredCount :: (Maybe Int -> f (Maybe Int)) -> Deployment -> f Deployment
deployment_desiredCount = (Deployment -> Maybe Int)
-> (Deployment -> Maybe Int -> Deployment)
-> Lens Deployment Deployment (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Int
desiredCount :: Maybe Int
$sel:desiredCount:Deployment' :: Deployment -> Maybe Int
desiredCount} -> Maybe Int
desiredCount) (\s :: Deployment
s@Deployment' {} Maybe Int
a -> Deployment
s {$sel:desiredCount:Deployment' :: Maybe Int
desiredCount = Maybe Int
a} :: Deployment)

-- | The number of tasks in the deployment that are in the @PENDING@ status.
deployment_pendingCount :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Int)
deployment_pendingCount :: (Maybe Int -> f (Maybe Int)) -> Deployment -> f Deployment
deployment_pendingCount = (Deployment -> Maybe Int)
-> (Deployment -> Maybe Int -> Deployment)
-> Lens Deployment Deployment (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Int
pendingCount :: Maybe Int
$sel:pendingCount:Deployment' :: Deployment -> Maybe Int
pendingCount} -> Maybe Int
pendingCount) (\s :: Deployment
s@Deployment' {} Maybe Int
a -> Deployment
s {$sel:pendingCount:Deployment' :: Maybe Int
pendingCount = Maybe Int
a} :: Deployment)

-- | The ID of the deployment.
deployment_id :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_id :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_id = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
id :: Maybe Text
$sel:id:Deployment' :: Deployment -> Maybe Text
id} -> Maybe Text
id) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:id:Deployment' :: Maybe Text
id = Maybe Text
a} :: Deployment)

-- | The number of consecutively failed tasks in the deployment. A task is
-- considered a failure if the service scheduler can\'t launch the task,
-- the task doesn\'t transition to a @RUNNING@ state, or if it fails any of
-- its defined health checks and is stopped.
--
-- Once a service deployment has one or more successfully running tasks,
-- the failed task count resets to zero and stops being evaluated.
deployment_failedTasks :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Int)
deployment_failedTasks :: (Maybe Int -> f (Maybe Int)) -> Deployment -> f Deployment
deployment_failedTasks = (Deployment -> Maybe Int)
-> (Deployment -> Maybe Int -> Deployment)
-> Lens Deployment Deployment (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Int
failedTasks :: Maybe Int
$sel:failedTasks:Deployment' :: Deployment -> Maybe Int
failedTasks} -> Maybe Int
failedTasks) (\s :: Deployment
s@Deployment' {} Maybe Int
a -> Deployment
s {$sel:failedTasks:Deployment' :: Maybe Int
failedTasks = Maybe Int
a} :: Deployment)

-- | The launch type the tasks in the service are using. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html Amazon ECS Launch Types>
-- in the /Amazon Elastic Container Service Developer Guide/.
deployment_launchType :: Lens.Lens' Deployment (Prelude.Maybe LaunchType)
deployment_launchType :: (Maybe LaunchType -> f (Maybe LaunchType))
-> Deployment -> f Deployment
deployment_launchType = (Deployment -> Maybe LaunchType)
-> (Deployment -> Maybe LaunchType -> Deployment)
-> Lens Deployment Deployment (Maybe LaunchType) (Maybe LaunchType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe LaunchType
launchType :: Maybe LaunchType
$sel:launchType:Deployment' :: Deployment -> Maybe LaunchType
launchType} -> Maybe LaunchType
launchType) (\s :: Deployment
s@Deployment' {} Maybe LaunchType
a -> Deployment
s {$sel:launchType:Deployment' :: Maybe LaunchType
launchType = Maybe LaunchType
a} :: Deployment)

-- | The Unix timestamp for when the service deployment was last updated.
deployment_updatedAt :: Lens.Lens' Deployment (Prelude.Maybe Prelude.UTCTime)
deployment_updatedAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Deployment -> f Deployment
deployment_updatedAt = (Deployment -> Maybe POSIX)
-> (Deployment -> Maybe POSIX -> Deployment)
-> Lens Deployment Deployment (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe POSIX
updatedAt :: Maybe POSIX
$sel:updatedAt:Deployment' :: Deployment -> Maybe POSIX
updatedAt} -> Maybe POSIX
updatedAt) (\s :: Deployment
s@Deployment' {} Maybe POSIX
a -> Deployment
s {$sel:updatedAt:Deployment' :: Maybe POSIX
updatedAt = Maybe POSIX
a} :: Deployment) ((Maybe POSIX -> f (Maybe POSIX)) -> Deployment -> f Deployment)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Deployment
-> f Deployment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The most recent task definition that was specified for the tasks in the
-- service to use.
deployment_taskDefinition :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_taskDefinition :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_taskDefinition = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
taskDefinition :: Maybe Text
$sel:taskDefinition:Deployment' :: Deployment -> Maybe Text
taskDefinition} -> Maybe Text
taskDefinition) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:taskDefinition:Deployment' :: Maybe Text
taskDefinition = Maybe Text
a} :: Deployment)

-- | A description of the rollout state of a deployment.
deployment_rolloutStateReason :: Lens.Lens' Deployment (Prelude.Maybe Prelude.Text)
deployment_rolloutStateReason :: (Maybe Text -> f (Maybe Text)) -> Deployment -> f Deployment
deployment_rolloutStateReason = (Deployment -> Maybe Text)
-> (Deployment -> Maybe Text -> Deployment)
-> Lens Deployment Deployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe Text
rolloutStateReason :: Maybe Text
$sel:rolloutStateReason:Deployment' :: Deployment -> Maybe Text
rolloutStateReason} -> Maybe Text
rolloutStateReason) (\s :: Deployment
s@Deployment' {} Maybe Text
a -> Deployment
s {$sel:rolloutStateReason:Deployment' :: Maybe Text
rolloutStateReason = Maybe Text
a} :: Deployment)

-- | The VPC subnet and security group configuration for tasks that receive
-- their own elastic network interface by using the @awsvpc@ networking
-- mode.
deployment_networkConfiguration :: Lens.Lens' Deployment (Prelude.Maybe NetworkConfiguration)
deployment_networkConfiguration :: (Maybe NetworkConfiguration -> f (Maybe NetworkConfiguration))
-> Deployment -> f Deployment
deployment_networkConfiguration = (Deployment -> Maybe NetworkConfiguration)
-> (Deployment -> Maybe NetworkConfiguration -> Deployment)
-> Lens
     Deployment
     Deployment
     (Maybe NetworkConfiguration)
     (Maybe NetworkConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe NetworkConfiguration
networkConfiguration :: Maybe NetworkConfiguration
$sel:networkConfiguration:Deployment' :: Deployment -> Maybe NetworkConfiguration
networkConfiguration} -> Maybe NetworkConfiguration
networkConfiguration) (\s :: Deployment
s@Deployment' {} Maybe NetworkConfiguration
a -> Deployment
s {$sel:networkConfiguration:Deployment' :: Maybe NetworkConfiguration
networkConfiguration = Maybe NetworkConfiguration
a} :: Deployment)

-- | The capacity provider strategy that the deployment is using.
deployment_capacityProviderStrategy :: Lens.Lens' Deployment (Prelude.Maybe [CapacityProviderStrategyItem])
deployment_capacityProviderStrategy :: (Maybe [CapacityProviderStrategyItem]
 -> f (Maybe [CapacityProviderStrategyItem]))
-> Deployment -> f Deployment
deployment_capacityProviderStrategy = (Deployment -> Maybe [CapacityProviderStrategyItem])
-> (Deployment
    -> Maybe [CapacityProviderStrategyItem] -> Deployment)
-> Lens
     Deployment
     Deployment
     (Maybe [CapacityProviderStrategyItem])
     (Maybe [CapacityProviderStrategyItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Deployment' {Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy :: Maybe [CapacityProviderStrategyItem]
$sel:capacityProviderStrategy:Deployment' :: Deployment -> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy} -> Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy) (\s :: Deployment
s@Deployment' {} Maybe [CapacityProviderStrategyItem]
a -> Deployment
s {$sel:capacityProviderStrategy:Deployment' :: Maybe [CapacityProviderStrategyItem]
capacityProviderStrategy = Maybe [CapacityProviderStrategyItem]
a} :: Deployment) ((Maybe [CapacityProviderStrategyItem]
  -> f (Maybe [CapacityProviderStrategyItem]))
 -> Deployment -> f Deployment)
-> ((Maybe [CapacityProviderStrategyItem]
     -> f (Maybe [CapacityProviderStrategyItem]))
    -> Maybe [CapacityProviderStrategyItem]
    -> f (Maybe [CapacityProviderStrategyItem]))
-> (Maybe [CapacityProviderStrategyItem]
    -> f (Maybe [CapacityProviderStrategyItem]))
-> Deployment
-> f Deployment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CapacityProviderStrategyItem]
  [CapacityProviderStrategyItem]
  [CapacityProviderStrategyItem]
  [CapacityProviderStrategyItem]
-> Iso
     (Maybe [CapacityProviderStrategyItem])
     (Maybe [CapacityProviderStrategyItem])
     (Maybe [CapacityProviderStrategyItem])
     (Maybe [CapacityProviderStrategyItem])
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 AnIso
  [CapacityProviderStrategyItem]
  [CapacityProviderStrategyItem]
  [CapacityProviderStrategyItem]
  [CapacityProviderStrategyItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON Deployment where
  parseJSON :: Value -> Parser Deployment
parseJSON =
    String
-> (Object -> Parser Deployment) -> Value -> Parser Deployment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Deployment"
      ( \Object
x ->
          Maybe DeploymentRolloutState
-> Maybe Int
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe LaunchType
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe NetworkConfiguration
-> Maybe [CapacityProviderStrategyItem]
-> Deployment
Deployment'
            (Maybe DeploymentRolloutState
 -> Maybe Int
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Int
 -> Maybe Int
 -> Maybe Text
 -> Maybe Int
 -> Maybe LaunchType
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe NetworkConfiguration
 -> Maybe [CapacityProviderStrategyItem]
 -> Deployment)
-> Parser (Maybe DeploymentRolloutState)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe LaunchType
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe NetworkConfiguration
      -> Maybe [CapacityProviderStrategyItem]
      -> Deployment)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe DeploymentRolloutState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"rolloutState")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe LaunchType
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe NetworkConfiguration
   -> Maybe [CapacityProviderStrategyItem]
   -> Deployment)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe LaunchType
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe NetworkConfiguration
      -> Maybe [CapacityProviderStrategyItem]
      -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"runningCount")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe LaunchType
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe NetworkConfiguration
   -> Maybe [CapacityProviderStrategyItem]
   -> Deployment)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe LaunchType
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe NetworkConfiguration
      -> Maybe [CapacityProviderStrategyItem]
      -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe LaunchType
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe NetworkConfiguration
   -> Maybe [CapacityProviderStrategyItem]
   -> Deployment)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe LaunchType
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe NetworkConfiguration
      -> Maybe [CapacityProviderStrategyItem]
      -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe LaunchType
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe NetworkConfiguration
   -> Maybe [CapacityProviderStrategyItem]
   -> Deployment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe LaunchType
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe NetworkConfiguration
      -> Maybe [CapacityProviderStrategyItem]
      -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"platformVersion")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe LaunchType
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe NetworkConfiguration
   -> Maybe [CapacityProviderStrategyItem]
   -> Deployment)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Int
      -> Maybe LaunchType
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe NetworkConfiguration
      -> Maybe [CapacityProviderStrategyItem]
      -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"desiredCount")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Int
   -> Maybe LaunchType
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe NetworkConfiguration
   -> Maybe [CapacityProviderStrategyItem]
   -> Deployment)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe LaunchType
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe NetworkConfiguration
      -> Maybe [CapacityProviderStrategyItem]
      -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"pendingCount")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe LaunchType
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe NetworkConfiguration
   -> Maybe [CapacityProviderStrategyItem]
   -> Deployment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe LaunchType
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe NetworkConfiguration
      -> Maybe [CapacityProviderStrategyItem]
      -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"id")
            Parser
  (Maybe Int
   -> Maybe LaunchType
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe NetworkConfiguration
   -> Maybe [CapacityProviderStrategyItem]
   -> Deployment)
-> Parser (Maybe Int)
-> Parser
     (Maybe LaunchType
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe NetworkConfiguration
      -> Maybe [CapacityProviderStrategyItem]
      -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"failedTasks")
            Parser
  (Maybe LaunchType
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe NetworkConfiguration
   -> Maybe [CapacityProviderStrategyItem]
   -> Deployment)
-> Parser (Maybe LaunchType)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe NetworkConfiguration
      -> Maybe [CapacityProviderStrategyItem]
      -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LaunchType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"launchType")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe NetworkConfiguration
   -> Maybe [CapacityProviderStrategyItem]
   -> Deployment)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe NetworkConfiguration
      -> Maybe [CapacityProviderStrategyItem]
      -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"updatedAt")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe NetworkConfiguration
   -> Maybe [CapacityProviderStrategyItem]
   -> Deployment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe NetworkConfiguration
      -> Maybe [CapacityProviderStrategyItem]
      -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"taskDefinition")
            Parser
  (Maybe Text
   -> Maybe NetworkConfiguration
   -> Maybe [CapacityProviderStrategyItem]
   -> Deployment)
-> Parser (Maybe Text)
-> Parser
     (Maybe NetworkConfiguration
      -> Maybe [CapacityProviderStrategyItem] -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"rolloutStateReason")
            Parser
  (Maybe NetworkConfiguration
   -> Maybe [CapacityProviderStrategyItem] -> Deployment)
-> Parser (Maybe NetworkConfiguration)
-> Parser (Maybe [CapacityProviderStrategyItem] -> Deployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NetworkConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"networkConfiguration")
            Parser (Maybe [CapacityProviderStrategyItem] -> Deployment)
-> Parser (Maybe [CapacityProviderStrategyItem])
-> Parser Deployment
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Parser (Maybe (Maybe [CapacityProviderStrategyItem]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"capacityProviderStrategy"
                            Parser (Maybe (Maybe [CapacityProviderStrategyItem]))
-> Maybe [CapacityProviderStrategyItem]
-> Parser (Maybe [CapacityProviderStrategyItem])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [CapacityProviderStrategyItem]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable Deployment

instance Prelude.NFData Deployment