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

import qualified Amazonka.Core as Core
import Amazonka.ECS.Types.AgentUpdateStatus
import Amazonka.ECS.Types.Attachment
import Amazonka.ECS.Types.Attribute
import Amazonka.ECS.Types.Resource
import Amazonka.ECS.Types.Tag
import Amazonka.ECS.Types.VersionInfo
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An EC2 instance that is running the Amazon ECS agent and has been
-- registered with a cluster.
--
-- /See:/ 'newContainerInstance' smart constructor.
data ContainerInstance = ContainerInstance'
  { -- | The status of the container instance. The valid values are
    -- @REGISTERING@, @REGISTRATION_FAILED@, @ACTIVE@, @INACTIVE@,
    -- @DEREGISTERING@, or @DRAINING@.
    --
    -- If your account has opted in to the @awsvpcTrunking@ account setting,
    -- then any newly registered container instance will transition to a
    -- @REGISTERING@ status while the trunk elastic network interface is
    -- provisioned for the instance. If the registration fails, the instance
    -- will transition to a @REGISTRATION_FAILED@ status. You can describe the
    -- container instance and see the reason for failure in the @statusReason@
    -- parameter. Once the container instance is terminated, the instance
    -- transitions to a @DEREGISTERING@ status while the trunk elastic network
    -- interface is deprovisioned. The instance then transitions to an
    -- @INACTIVE@ status.
    --
    -- The @ACTIVE@ status indicates that the container instance can accept
    -- tasks. The @DRAINING@ indicates that new tasks are not placed on the
    -- container instance and any service tasks running on the container
    -- instance are removed if possible. For more information, see
    -- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-draining.html Container Instance Draining>
    -- in the /Amazon Elastic Container Service Developer Guide/.
    ContainerInstance -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The resources attached to a container instance, such as elastic network
    -- interfaces.
    ContainerInstance -> Maybe [Attachment]
attachments :: Prelude.Maybe [Attachment],
    -- | The number of tasks on the container instance that are in the @RUNNING@
    -- status.
    ContainerInstance -> Maybe Int
runningTasksCount :: Prelude.Maybe Prelude.Int,
    -- | For CPU and memory resource types, this parameter describes the
    -- remaining CPU and memory that has not already been allocated to tasks
    -- and is therefore available for new tasks. For port resource types, this
    -- parameter describes the ports that were reserved by the Amazon ECS
    -- container agent (at instance registration time) and any task containers
    -- that have reserved port mappings on the host (with the @host@ or
    -- @bridge@ network mode). Any port that is not specified here is available
    -- for new tasks.
    ContainerInstance -> Maybe [Resource]
remainingResources :: Prelude.Maybe [Resource],
    -- | The ID of the container instance. For Amazon EC2 instances, this value
    -- is the Amazon EC2 instance ID. For external instances, this value is the
    -- Amazon Web Services Systems Manager managed instance ID.
    ContainerInstance -> Maybe Text
ec2InstanceId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the container instance. The ARN
    -- contains the @arn:aws:ecs@ namespace, followed by the Region of the
    -- container instance, the Amazon Web Services account ID of the container
    -- instance owner, the @container-instance@ namespace, and then the
    -- container instance ID. For example,
    -- @arn:aws:ecs:region:aws_account_id:container-instance\/container_instance_ID@.
    ContainerInstance -> Maybe Text
containerInstanceArn :: Prelude.Maybe Prelude.Text,
    -- | This parameter returns @true@ if the agent is connected to Amazon ECS.
    -- Registered instances with an agent that may be unhealthy or stopped
    -- return @false@. Only instances connected to an agent can accept
    -- placement requests.
    ContainerInstance -> Maybe Bool
agentConnected :: Prelude.Maybe Prelude.Bool,
    -- | The version information for the Amazon ECS container agent and Docker
    -- daemon running on the container instance.
    ContainerInstance -> Maybe VersionInfo
versionInfo :: Prelude.Maybe VersionInfo,
    -- | The status of the most recent agent update. If an update has never been
    -- requested, this value is @NULL@.
    ContainerInstance -> Maybe AgentUpdateStatus
agentUpdateStatus :: Prelude.Maybe AgentUpdateStatus,
    -- | The attributes set for the container instance, either by the Amazon ECS
    -- container agent at instance registration or manually with the
    -- PutAttributes operation.
    ContainerInstance -> Maybe [Attribute]
attributes :: Prelude.Maybe [Attribute],
    -- | The version counter for the container instance. Every time a container
    -- instance experiences a change that triggers a CloudWatch event, the
    -- version counter is incremented. If you are replicating your Amazon ECS
    -- container instance state with CloudWatch Events, you can compare the
    -- version of a container instance reported by the Amazon ECS APIs with the
    -- version reported in CloudWatch Events for the container instance (inside
    -- the @detail@ object) to verify that the version in your event stream is
    -- current.
    ContainerInstance -> Maybe Integer
version :: Prelude.Maybe Prelude.Integer,
    -- | The number of tasks on the container instance that are in the @PENDING@
    -- status.
    ContainerInstance -> Maybe Int
pendingTasksCount :: Prelude.Maybe Prelude.Int,
    -- | The capacity provider associated with the container instance.
    ContainerInstance -> Maybe Text
capacityProviderName :: Prelude.Maybe Prelude.Text,
    -- | The Unix timestamp for when the container instance was registered.
    ContainerInstance -> Maybe POSIX
registeredAt :: Prelude.Maybe Core.POSIX,
    -- | The reason that the container instance reached its current status.
    ContainerInstance -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text,
    -- | The metadata that you apply to the container instance to help you
    -- categorize and organize them. Each tag consists of a key and an optional
    -- value, both of which you define.
    --
    -- The following basic restrictions apply to tags:
    --
    -- -   Maximum number of tags per resource - 50
    --
    -- -   For each resource, each tag key must be unique, and each tag key can
    --     have only one value.
    --
    -- -   Maximum key length - 128 Unicode characters in UTF-8
    --
    -- -   Maximum value length - 256 Unicode characters in UTF-8
    --
    -- -   If your tagging schema is used across multiple services and
    --     resources, remember that other services may have restrictions on
    --     allowed characters. Generally allowed characters are: letters,
    --     numbers, and spaces representable in UTF-8, and the following
    --     characters: + - = . _ : \/ \@.
    --
    -- -   Tag keys and values are case-sensitive.
    --
    -- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
    --     such as a prefix for either keys or values as it is reserved for
    --     Amazon Web Services use. You cannot edit or delete tag keys or
    --     values with this prefix. Tags with this prefix do not count against
    --     your tags per resource limit.
    ContainerInstance -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | For CPU and memory resource types, this parameter describes the amount
    -- of each resource that was available on the container instance when the
    -- container agent registered it with Amazon ECS. This value represents the
    -- total amount of CPU and memory that can be allocated on this container
    -- instance to tasks. For port resource types, this parameter describes the
    -- ports that were reserved by the Amazon ECS container agent when it
    -- registered the container instance with Amazon ECS.
    ContainerInstance -> Maybe [Resource]
registeredResources :: Prelude.Maybe [Resource]
  }
  deriving (ContainerInstance -> ContainerInstance -> Bool
(ContainerInstance -> ContainerInstance -> Bool)
-> (ContainerInstance -> ContainerInstance -> Bool)
-> Eq ContainerInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContainerInstance -> ContainerInstance -> Bool
$c/= :: ContainerInstance -> ContainerInstance -> Bool
== :: ContainerInstance -> ContainerInstance -> Bool
$c== :: ContainerInstance -> ContainerInstance -> Bool
Prelude.Eq, ReadPrec [ContainerInstance]
ReadPrec ContainerInstance
Int -> ReadS ContainerInstance
ReadS [ContainerInstance]
(Int -> ReadS ContainerInstance)
-> ReadS [ContainerInstance]
-> ReadPrec ContainerInstance
-> ReadPrec [ContainerInstance]
-> Read ContainerInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContainerInstance]
$creadListPrec :: ReadPrec [ContainerInstance]
readPrec :: ReadPrec ContainerInstance
$creadPrec :: ReadPrec ContainerInstance
readList :: ReadS [ContainerInstance]
$creadList :: ReadS [ContainerInstance]
readsPrec :: Int -> ReadS ContainerInstance
$creadsPrec :: Int -> ReadS ContainerInstance
Prelude.Read, Int -> ContainerInstance -> ShowS
[ContainerInstance] -> ShowS
ContainerInstance -> String
(Int -> ContainerInstance -> ShowS)
-> (ContainerInstance -> String)
-> ([ContainerInstance] -> ShowS)
-> Show ContainerInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContainerInstance] -> ShowS
$cshowList :: [ContainerInstance] -> ShowS
show :: ContainerInstance -> String
$cshow :: ContainerInstance -> String
showsPrec :: Int -> ContainerInstance -> ShowS
$cshowsPrec :: Int -> ContainerInstance -> ShowS
Prelude.Show, (forall x. ContainerInstance -> Rep ContainerInstance x)
-> (forall x. Rep ContainerInstance x -> ContainerInstance)
-> Generic ContainerInstance
forall x. Rep ContainerInstance x -> ContainerInstance
forall x. ContainerInstance -> Rep ContainerInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContainerInstance x -> ContainerInstance
$cfrom :: forall x. ContainerInstance -> Rep ContainerInstance x
Prelude.Generic)

-- |
-- Create a value of 'ContainerInstance' 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:
--
-- 'status', 'containerInstance_status' - The status of the container instance. The valid values are
-- @REGISTERING@, @REGISTRATION_FAILED@, @ACTIVE@, @INACTIVE@,
-- @DEREGISTERING@, or @DRAINING@.
--
-- If your account has opted in to the @awsvpcTrunking@ account setting,
-- then any newly registered container instance will transition to a
-- @REGISTERING@ status while the trunk elastic network interface is
-- provisioned for the instance. If the registration fails, the instance
-- will transition to a @REGISTRATION_FAILED@ status. You can describe the
-- container instance and see the reason for failure in the @statusReason@
-- parameter. Once the container instance is terminated, the instance
-- transitions to a @DEREGISTERING@ status while the trunk elastic network
-- interface is deprovisioned. The instance then transitions to an
-- @INACTIVE@ status.
--
-- The @ACTIVE@ status indicates that the container instance can accept
-- tasks. The @DRAINING@ indicates that new tasks are not placed on the
-- container instance and any service tasks running on the container
-- instance are removed if possible. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-draining.html Container Instance Draining>
-- in the /Amazon Elastic Container Service Developer Guide/.
--
-- 'attachments', 'containerInstance_attachments' - The resources attached to a container instance, such as elastic network
-- interfaces.
--
-- 'runningTasksCount', 'containerInstance_runningTasksCount' - The number of tasks on the container instance that are in the @RUNNING@
-- status.
--
-- 'remainingResources', 'containerInstance_remainingResources' - For CPU and memory resource types, this parameter describes the
-- remaining CPU and memory that has not already been allocated to tasks
-- and is therefore available for new tasks. For port resource types, this
-- parameter describes the ports that were reserved by the Amazon ECS
-- container agent (at instance registration time) and any task containers
-- that have reserved port mappings on the host (with the @host@ or
-- @bridge@ network mode). Any port that is not specified here is available
-- for new tasks.
--
-- 'ec2InstanceId', 'containerInstance_ec2InstanceId' - The ID of the container instance. For Amazon EC2 instances, this value
-- is the Amazon EC2 instance ID. For external instances, this value is the
-- Amazon Web Services Systems Manager managed instance ID.
--
-- 'containerInstanceArn', 'containerInstance_containerInstanceArn' - The Amazon Resource Name (ARN) of the container instance. The ARN
-- contains the @arn:aws:ecs@ namespace, followed by the Region of the
-- container instance, the Amazon Web Services account ID of the container
-- instance owner, the @container-instance@ namespace, and then the
-- container instance ID. For example,
-- @arn:aws:ecs:region:aws_account_id:container-instance\/container_instance_ID@.
--
-- 'agentConnected', 'containerInstance_agentConnected' - This parameter returns @true@ if the agent is connected to Amazon ECS.
-- Registered instances with an agent that may be unhealthy or stopped
-- return @false@. Only instances connected to an agent can accept
-- placement requests.
--
-- 'versionInfo', 'containerInstance_versionInfo' - The version information for the Amazon ECS container agent and Docker
-- daemon running on the container instance.
--
-- 'agentUpdateStatus', 'containerInstance_agentUpdateStatus' - The status of the most recent agent update. If an update has never been
-- requested, this value is @NULL@.
--
-- 'attributes', 'containerInstance_attributes' - The attributes set for the container instance, either by the Amazon ECS
-- container agent at instance registration or manually with the
-- PutAttributes operation.
--
-- 'version', 'containerInstance_version' - The version counter for the container instance. Every time a container
-- instance experiences a change that triggers a CloudWatch event, the
-- version counter is incremented. If you are replicating your Amazon ECS
-- container instance state with CloudWatch Events, you can compare the
-- version of a container instance reported by the Amazon ECS APIs with the
-- version reported in CloudWatch Events for the container instance (inside
-- the @detail@ object) to verify that the version in your event stream is
-- current.
--
-- 'pendingTasksCount', 'containerInstance_pendingTasksCount' - The number of tasks on the container instance that are in the @PENDING@
-- status.
--
-- 'capacityProviderName', 'containerInstance_capacityProviderName' - The capacity provider associated with the container instance.
--
-- 'registeredAt', 'containerInstance_registeredAt' - The Unix timestamp for when the container instance was registered.
--
-- 'statusReason', 'containerInstance_statusReason' - The reason that the container instance reached its current status.
--
-- 'tags', 'containerInstance_tags' - The metadata that you apply to the container instance to help you
-- categorize and organize them. Each tag consists of a key and an optional
-- value, both of which you define.
--
-- The following basic restrictions apply to tags:
--
-- -   Maximum number of tags per resource - 50
--
-- -   For each resource, each tag key must be unique, and each tag key can
--     have only one value.
--
-- -   Maximum key length - 128 Unicode characters in UTF-8
--
-- -   Maximum value length - 256 Unicode characters in UTF-8
--
-- -   If your tagging schema is used across multiple services and
--     resources, remember that other services may have restrictions on
--     allowed characters. Generally allowed characters are: letters,
--     numbers, and spaces representable in UTF-8, and the following
--     characters: + - = . _ : \/ \@.
--
-- -   Tag keys and values are case-sensitive.
--
-- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
--     such as a prefix for either keys or values as it is reserved for
--     Amazon Web Services use. You cannot edit or delete tag keys or
--     values with this prefix. Tags with this prefix do not count against
--     your tags per resource limit.
--
-- 'registeredResources', 'containerInstance_registeredResources' - For CPU and memory resource types, this parameter describes the amount
-- of each resource that was available on the container instance when the
-- container agent registered it with Amazon ECS. This value represents the
-- total amount of CPU and memory that can be allocated on this container
-- instance to tasks. For port resource types, this parameter describes the
-- ports that were reserved by the Amazon ECS container agent when it
-- registered the container instance with Amazon ECS.
newContainerInstance ::
  ContainerInstance
newContainerInstance :: ContainerInstance
newContainerInstance =
  ContainerInstance' :: Maybe Text
-> Maybe [Attachment]
-> Maybe Int
-> Maybe [Resource]
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe VersionInfo
-> Maybe AgentUpdateStatus
-> Maybe [Attribute]
-> Maybe Integer
-> Maybe Int
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe [Tag]
-> Maybe [Resource]
-> ContainerInstance
ContainerInstance'
    { $sel:status:ContainerInstance' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attachments:ContainerInstance' :: Maybe [Attachment]
attachments = Maybe [Attachment]
forall a. Maybe a
Prelude.Nothing,
      $sel:runningTasksCount:ContainerInstance' :: Maybe Int
runningTasksCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:remainingResources:ContainerInstance' :: Maybe [Resource]
remainingResources = Maybe [Resource]
forall a. Maybe a
Prelude.Nothing,
      $sel:ec2InstanceId:ContainerInstance' :: Maybe Text
ec2InstanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:containerInstanceArn:ContainerInstance' :: Maybe Text
containerInstanceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:agentConnected:ContainerInstance' :: Maybe Bool
agentConnected = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:versionInfo:ContainerInstance' :: Maybe VersionInfo
versionInfo = Maybe VersionInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:agentUpdateStatus:ContainerInstance' :: Maybe AgentUpdateStatus
agentUpdateStatus = Maybe AgentUpdateStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:attributes:ContainerInstance' :: Maybe [Attribute]
attributes = Maybe [Attribute]
forall a. Maybe a
Prelude.Nothing,
      $sel:version:ContainerInstance' :: Maybe Integer
version = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:pendingTasksCount:ContainerInstance' :: Maybe Int
pendingTasksCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:capacityProviderName:ContainerInstance' :: Maybe Text
capacityProviderName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:registeredAt:ContainerInstance' :: Maybe POSIX
registeredAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:statusReason:ContainerInstance' :: Maybe Text
statusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ContainerInstance' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:registeredResources:ContainerInstance' :: Maybe [Resource]
registeredResources = Maybe [Resource]
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the container instance. The valid values are
-- @REGISTERING@, @REGISTRATION_FAILED@, @ACTIVE@, @INACTIVE@,
-- @DEREGISTERING@, or @DRAINING@.
--
-- If your account has opted in to the @awsvpcTrunking@ account setting,
-- then any newly registered container instance will transition to a
-- @REGISTERING@ status while the trunk elastic network interface is
-- provisioned for the instance. If the registration fails, the instance
-- will transition to a @REGISTRATION_FAILED@ status. You can describe the
-- container instance and see the reason for failure in the @statusReason@
-- parameter. Once the container instance is terminated, the instance
-- transitions to a @DEREGISTERING@ status while the trunk elastic network
-- interface is deprovisioned. The instance then transitions to an
-- @INACTIVE@ status.
--
-- The @ACTIVE@ status indicates that the container instance can accept
-- tasks. The @DRAINING@ indicates that new tasks are not placed on the
-- container instance and any service tasks running on the container
-- instance are removed if possible. For more information, see
-- <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-draining.html Container Instance Draining>
-- in the /Amazon Elastic Container Service Developer Guide/.
containerInstance_status :: Lens.Lens' ContainerInstance (Prelude.Maybe Prelude.Text)
containerInstance_status :: (Maybe Text -> f (Maybe Text))
-> ContainerInstance -> f ContainerInstance
containerInstance_status = (ContainerInstance -> Maybe Text)
-> (ContainerInstance -> Maybe Text -> ContainerInstance)
-> Lens
     ContainerInstance ContainerInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe Text
status :: Maybe Text
$sel:status:ContainerInstance' :: ContainerInstance -> Maybe Text
status} -> Maybe Text
status) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe Text
a -> ContainerInstance
s {$sel:status:ContainerInstance' :: Maybe Text
status = Maybe Text
a} :: ContainerInstance)

-- | The resources attached to a container instance, such as elastic network
-- interfaces.
containerInstance_attachments :: Lens.Lens' ContainerInstance (Prelude.Maybe [Attachment])
containerInstance_attachments :: (Maybe [Attachment] -> f (Maybe [Attachment]))
-> ContainerInstance -> f ContainerInstance
containerInstance_attachments = (ContainerInstance -> Maybe [Attachment])
-> (ContainerInstance -> Maybe [Attachment] -> ContainerInstance)
-> Lens
     ContainerInstance
     ContainerInstance
     (Maybe [Attachment])
     (Maybe [Attachment])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe [Attachment]
attachments :: Maybe [Attachment]
$sel:attachments:ContainerInstance' :: ContainerInstance -> Maybe [Attachment]
attachments} -> Maybe [Attachment]
attachments) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe [Attachment]
a -> ContainerInstance
s {$sel:attachments:ContainerInstance' :: Maybe [Attachment]
attachments = Maybe [Attachment]
a} :: ContainerInstance) ((Maybe [Attachment] -> f (Maybe [Attachment]))
 -> ContainerInstance -> f ContainerInstance)
-> ((Maybe [Attachment] -> f (Maybe [Attachment]))
    -> Maybe [Attachment] -> f (Maybe [Attachment]))
-> (Maybe [Attachment] -> f (Maybe [Attachment]))
-> ContainerInstance
-> f ContainerInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Attachment] [Attachment] [Attachment] [Attachment]
-> Iso
     (Maybe [Attachment])
     (Maybe [Attachment])
     (Maybe [Attachment])
     (Maybe [Attachment])
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 [Attachment] [Attachment] [Attachment] [Attachment]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The number of tasks on the container instance that are in the @RUNNING@
-- status.
containerInstance_runningTasksCount :: Lens.Lens' ContainerInstance (Prelude.Maybe Prelude.Int)
containerInstance_runningTasksCount :: (Maybe Int -> f (Maybe Int))
-> ContainerInstance -> f ContainerInstance
containerInstance_runningTasksCount = (ContainerInstance -> Maybe Int)
-> (ContainerInstance -> Maybe Int -> ContainerInstance)
-> Lens ContainerInstance ContainerInstance (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe Int
runningTasksCount :: Maybe Int
$sel:runningTasksCount:ContainerInstance' :: ContainerInstance -> Maybe Int
runningTasksCount} -> Maybe Int
runningTasksCount) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe Int
a -> ContainerInstance
s {$sel:runningTasksCount:ContainerInstance' :: Maybe Int
runningTasksCount = Maybe Int
a} :: ContainerInstance)

-- | For CPU and memory resource types, this parameter describes the
-- remaining CPU and memory that has not already been allocated to tasks
-- and is therefore available for new tasks. For port resource types, this
-- parameter describes the ports that were reserved by the Amazon ECS
-- container agent (at instance registration time) and any task containers
-- that have reserved port mappings on the host (with the @host@ or
-- @bridge@ network mode). Any port that is not specified here is available
-- for new tasks.
containerInstance_remainingResources :: Lens.Lens' ContainerInstance (Prelude.Maybe [Resource])
containerInstance_remainingResources :: (Maybe [Resource] -> f (Maybe [Resource]))
-> ContainerInstance -> f ContainerInstance
containerInstance_remainingResources = (ContainerInstance -> Maybe [Resource])
-> (ContainerInstance -> Maybe [Resource] -> ContainerInstance)
-> Lens
     ContainerInstance
     ContainerInstance
     (Maybe [Resource])
     (Maybe [Resource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe [Resource]
remainingResources :: Maybe [Resource]
$sel:remainingResources:ContainerInstance' :: ContainerInstance -> Maybe [Resource]
remainingResources} -> Maybe [Resource]
remainingResources) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe [Resource]
a -> ContainerInstance
s {$sel:remainingResources:ContainerInstance' :: Maybe [Resource]
remainingResources = Maybe [Resource]
a} :: ContainerInstance) ((Maybe [Resource] -> f (Maybe [Resource]))
 -> ContainerInstance -> f ContainerInstance)
-> ((Maybe [Resource] -> f (Maybe [Resource]))
    -> Maybe [Resource] -> f (Maybe [Resource]))
-> (Maybe [Resource] -> f (Maybe [Resource]))
-> ContainerInstance
-> f ContainerInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Resource] [Resource] [Resource] [Resource]
-> Iso
     (Maybe [Resource])
     (Maybe [Resource])
     (Maybe [Resource])
     (Maybe [Resource])
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 [Resource] [Resource] [Resource] [Resource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the container instance. For Amazon EC2 instances, this value
-- is the Amazon EC2 instance ID. For external instances, this value is the
-- Amazon Web Services Systems Manager managed instance ID.
containerInstance_ec2InstanceId :: Lens.Lens' ContainerInstance (Prelude.Maybe Prelude.Text)
containerInstance_ec2InstanceId :: (Maybe Text -> f (Maybe Text))
-> ContainerInstance -> f ContainerInstance
containerInstance_ec2InstanceId = (ContainerInstance -> Maybe Text)
-> (ContainerInstance -> Maybe Text -> ContainerInstance)
-> Lens
     ContainerInstance ContainerInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe Text
ec2InstanceId :: Maybe Text
$sel:ec2InstanceId:ContainerInstance' :: ContainerInstance -> Maybe Text
ec2InstanceId} -> Maybe Text
ec2InstanceId) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe Text
a -> ContainerInstance
s {$sel:ec2InstanceId:ContainerInstance' :: Maybe Text
ec2InstanceId = Maybe Text
a} :: ContainerInstance)

-- | The Amazon Resource Name (ARN) of the container instance. The ARN
-- contains the @arn:aws:ecs@ namespace, followed by the Region of the
-- container instance, the Amazon Web Services account ID of the container
-- instance owner, the @container-instance@ namespace, and then the
-- container instance ID. For example,
-- @arn:aws:ecs:region:aws_account_id:container-instance\/container_instance_ID@.
containerInstance_containerInstanceArn :: Lens.Lens' ContainerInstance (Prelude.Maybe Prelude.Text)
containerInstance_containerInstanceArn :: (Maybe Text -> f (Maybe Text))
-> ContainerInstance -> f ContainerInstance
containerInstance_containerInstanceArn = (ContainerInstance -> Maybe Text)
-> (ContainerInstance -> Maybe Text -> ContainerInstance)
-> Lens
     ContainerInstance ContainerInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe Text
containerInstanceArn :: Maybe Text
$sel:containerInstanceArn:ContainerInstance' :: ContainerInstance -> Maybe Text
containerInstanceArn} -> Maybe Text
containerInstanceArn) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe Text
a -> ContainerInstance
s {$sel:containerInstanceArn:ContainerInstance' :: Maybe Text
containerInstanceArn = Maybe Text
a} :: ContainerInstance)

-- | This parameter returns @true@ if the agent is connected to Amazon ECS.
-- Registered instances with an agent that may be unhealthy or stopped
-- return @false@. Only instances connected to an agent can accept
-- placement requests.
containerInstance_agentConnected :: Lens.Lens' ContainerInstance (Prelude.Maybe Prelude.Bool)
containerInstance_agentConnected :: (Maybe Bool -> f (Maybe Bool))
-> ContainerInstance -> f ContainerInstance
containerInstance_agentConnected = (ContainerInstance -> Maybe Bool)
-> (ContainerInstance -> Maybe Bool -> ContainerInstance)
-> Lens
     ContainerInstance ContainerInstance (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe Bool
agentConnected :: Maybe Bool
$sel:agentConnected:ContainerInstance' :: ContainerInstance -> Maybe Bool
agentConnected} -> Maybe Bool
agentConnected) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe Bool
a -> ContainerInstance
s {$sel:agentConnected:ContainerInstance' :: Maybe Bool
agentConnected = Maybe Bool
a} :: ContainerInstance)

-- | The version information for the Amazon ECS container agent and Docker
-- daemon running on the container instance.
containerInstance_versionInfo :: Lens.Lens' ContainerInstance (Prelude.Maybe VersionInfo)
containerInstance_versionInfo :: (Maybe VersionInfo -> f (Maybe VersionInfo))
-> ContainerInstance -> f ContainerInstance
containerInstance_versionInfo = (ContainerInstance -> Maybe VersionInfo)
-> (ContainerInstance -> Maybe VersionInfo -> ContainerInstance)
-> Lens
     ContainerInstance
     ContainerInstance
     (Maybe VersionInfo)
     (Maybe VersionInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe VersionInfo
versionInfo :: Maybe VersionInfo
$sel:versionInfo:ContainerInstance' :: ContainerInstance -> Maybe VersionInfo
versionInfo} -> Maybe VersionInfo
versionInfo) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe VersionInfo
a -> ContainerInstance
s {$sel:versionInfo:ContainerInstance' :: Maybe VersionInfo
versionInfo = Maybe VersionInfo
a} :: ContainerInstance)

-- | The status of the most recent agent update. If an update has never been
-- requested, this value is @NULL@.
containerInstance_agentUpdateStatus :: Lens.Lens' ContainerInstance (Prelude.Maybe AgentUpdateStatus)
containerInstance_agentUpdateStatus :: (Maybe AgentUpdateStatus -> f (Maybe AgentUpdateStatus))
-> ContainerInstance -> f ContainerInstance
containerInstance_agentUpdateStatus = (ContainerInstance -> Maybe AgentUpdateStatus)
-> (ContainerInstance
    -> Maybe AgentUpdateStatus -> ContainerInstance)
-> Lens
     ContainerInstance
     ContainerInstance
     (Maybe AgentUpdateStatus)
     (Maybe AgentUpdateStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe AgentUpdateStatus
agentUpdateStatus :: Maybe AgentUpdateStatus
$sel:agentUpdateStatus:ContainerInstance' :: ContainerInstance -> Maybe AgentUpdateStatus
agentUpdateStatus} -> Maybe AgentUpdateStatus
agentUpdateStatus) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe AgentUpdateStatus
a -> ContainerInstance
s {$sel:agentUpdateStatus:ContainerInstance' :: Maybe AgentUpdateStatus
agentUpdateStatus = Maybe AgentUpdateStatus
a} :: ContainerInstance)

-- | The attributes set for the container instance, either by the Amazon ECS
-- container agent at instance registration or manually with the
-- PutAttributes operation.
containerInstance_attributes :: Lens.Lens' ContainerInstance (Prelude.Maybe [Attribute])
containerInstance_attributes :: (Maybe [Attribute] -> f (Maybe [Attribute]))
-> ContainerInstance -> f ContainerInstance
containerInstance_attributes = (ContainerInstance -> Maybe [Attribute])
-> (ContainerInstance -> Maybe [Attribute] -> ContainerInstance)
-> Lens
     ContainerInstance
     ContainerInstance
     (Maybe [Attribute])
     (Maybe [Attribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe [Attribute]
attributes :: Maybe [Attribute]
$sel:attributes:ContainerInstance' :: ContainerInstance -> Maybe [Attribute]
attributes} -> Maybe [Attribute]
attributes) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe [Attribute]
a -> ContainerInstance
s {$sel:attributes:ContainerInstance' :: Maybe [Attribute]
attributes = Maybe [Attribute]
a} :: ContainerInstance) ((Maybe [Attribute] -> f (Maybe [Attribute]))
 -> ContainerInstance -> f ContainerInstance)
-> ((Maybe [Attribute] -> f (Maybe [Attribute]))
    -> Maybe [Attribute] -> f (Maybe [Attribute]))
-> (Maybe [Attribute] -> f (Maybe [Attribute]))
-> ContainerInstance
-> f ContainerInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Attribute] [Attribute] [Attribute] [Attribute]
-> Iso
     (Maybe [Attribute])
     (Maybe [Attribute])
     (Maybe [Attribute])
     (Maybe [Attribute])
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 [Attribute] [Attribute] [Attribute] [Attribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The version counter for the container instance. Every time a container
-- instance experiences a change that triggers a CloudWatch event, the
-- version counter is incremented. If you are replicating your Amazon ECS
-- container instance state with CloudWatch Events, you can compare the
-- version of a container instance reported by the Amazon ECS APIs with the
-- version reported in CloudWatch Events for the container instance (inside
-- the @detail@ object) to verify that the version in your event stream is
-- current.
containerInstance_version :: Lens.Lens' ContainerInstance (Prelude.Maybe Prelude.Integer)
containerInstance_version :: (Maybe Integer -> f (Maybe Integer))
-> ContainerInstance -> f ContainerInstance
containerInstance_version = (ContainerInstance -> Maybe Integer)
-> (ContainerInstance -> Maybe Integer -> ContainerInstance)
-> Lens
     ContainerInstance ContainerInstance (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe Integer
version :: Maybe Integer
$sel:version:ContainerInstance' :: ContainerInstance -> Maybe Integer
version} -> Maybe Integer
version) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe Integer
a -> ContainerInstance
s {$sel:version:ContainerInstance' :: Maybe Integer
version = Maybe Integer
a} :: ContainerInstance)

-- | The number of tasks on the container instance that are in the @PENDING@
-- status.
containerInstance_pendingTasksCount :: Lens.Lens' ContainerInstance (Prelude.Maybe Prelude.Int)
containerInstance_pendingTasksCount :: (Maybe Int -> f (Maybe Int))
-> ContainerInstance -> f ContainerInstance
containerInstance_pendingTasksCount = (ContainerInstance -> Maybe Int)
-> (ContainerInstance -> Maybe Int -> ContainerInstance)
-> Lens ContainerInstance ContainerInstance (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe Int
pendingTasksCount :: Maybe Int
$sel:pendingTasksCount:ContainerInstance' :: ContainerInstance -> Maybe Int
pendingTasksCount} -> Maybe Int
pendingTasksCount) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe Int
a -> ContainerInstance
s {$sel:pendingTasksCount:ContainerInstance' :: Maybe Int
pendingTasksCount = Maybe Int
a} :: ContainerInstance)

-- | The capacity provider associated with the container instance.
containerInstance_capacityProviderName :: Lens.Lens' ContainerInstance (Prelude.Maybe Prelude.Text)
containerInstance_capacityProviderName :: (Maybe Text -> f (Maybe Text))
-> ContainerInstance -> f ContainerInstance
containerInstance_capacityProviderName = (ContainerInstance -> Maybe Text)
-> (ContainerInstance -> Maybe Text -> ContainerInstance)
-> Lens
     ContainerInstance ContainerInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe Text
capacityProviderName :: Maybe Text
$sel:capacityProviderName:ContainerInstance' :: ContainerInstance -> Maybe Text
capacityProviderName} -> Maybe Text
capacityProviderName) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe Text
a -> ContainerInstance
s {$sel:capacityProviderName:ContainerInstance' :: Maybe Text
capacityProviderName = Maybe Text
a} :: ContainerInstance)

-- | The Unix timestamp for when the container instance was registered.
containerInstance_registeredAt :: Lens.Lens' ContainerInstance (Prelude.Maybe Prelude.UTCTime)
containerInstance_registeredAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ContainerInstance -> f ContainerInstance
containerInstance_registeredAt = (ContainerInstance -> Maybe POSIX)
-> (ContainerInstance -> Maybe POSIX -> ContainerInstance)
-> Lens
     ContainerInstance ContainerInstance (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe POSIX
registeredAt :: Maybe POSIX
$sel:registeredAt:ContainerInstance' :: ContainerInstance -> Maybe POSIX
registeredAt} -> Maybe POSIX
registeredAt) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe POSIX
a -> ContainerInstance
s {$sel:registeredAt:ContainerInstance' :: Maybe POSIX
registeredAt = Maybe POSIX
a} :: ContainerInstance) ((Maybe POSIX -> f (Maybe POSIX))
 -> ContainerInstance -> f ContainerInstance)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ContainerInstance
-> f ContainerInstance
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 reason that the container instance reached its current status.
containerInstance_statusReason :: Lens.Lens' ContainerInstance (Prelude.Maybe Prelude.Text)
containerInstance_statusReason :: (Maybe Text -> f (Maybe Text))
-> ContainerInstance -> f ContainerInstance
containerInstance_statusReason = (ContainerInstance -> Maybe Text)
-> (ContainerInstance -> Maybe Text -> ContainerInstance)
-> Lens
     ContainerInstance ContainerInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:ContainerInstance' :: ContainerInstance -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe Text
a -> ContainerInstance
s {$sel:statusReason:ContainerInstance' :: Maybe Text
statusReason = Maybe Text
a} :: ContainerInstance)

-- | The metadata that you apply to the container instance to help you
-- categorize and organize them. Each tag consists of a key and an optional
-- value, both of which you define.
--
-- The following basic restrictions apply to tags:
--
-- -   Maximum number of tags per resource - 50
--
-- -   For each resource, each tag key must be unique, and each tag key can
--     have only one value.
--
-- -   Maximum key length - 128 Unicode characters in UTF-8
--
-- -   Maximum value length - 256 Unicode characters in UTF-8
--
-- -   If your tagging schema is used across multiple services and
--     resources, remember that other services may have restrictions on
--     allowed characters. Generally allowed characters are: letters,
--     numbers, and spaces representable in UTF-8, and the following
--     characters: + - = . _ : \/ \@.
--
-- -   Tag keys and values are case-sensitive.
--
-- -   Do not use @aws:@, @AWS:@, or any upper or lowercase combination of
--     such as a prefix for either keys or values as it is reserved for
--     Amazon Web Services use. You cannot edit or delete tag keys or
--     values with this prefix. Tags with this prefix do not count against
--     your tags per resource limit.
containerInstance_tags :: Lens.Lens' ContainerInstance (Prelude.Maybe [Tag])
containerInstance_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> ContainerInstance -> f ContainerInstance
containerInstance_tags = (ContainerInstance -> Maybe [Tag])
-> (ContainerInstance -> Maybe [Tag] -> ContainerInstance)
-> Lens
     ContainerInstance ContainerInstance (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:ContainerInstance' :: ContainerInstance -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe [Tag]
a -> ContainerInstance
s {$sel:tags:ContainerInstance' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: ContainerInstance) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> ContainerInstance -> f ContainerInstance)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> ContainerInstance
-> f ContainerInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | For CPU and memory resource types, this parameter describes the amount
-- of each resource that was available on the container instance when the
-- container agent registered it with Amazon ECS. This value represents the
-- total amount of CPU and memory that can be allocated on this container
-- instance to tasks. For port resource types, this parameter describes the
-- ports that were reserved by the Amazon ECS container agent when it
-- registered the container instance with Amazon ECS.
containerInstance_registeredResources :: Lens.Lens' ContainerInstance (Prelude.Maybe [Resource])
containerInstance_registeredResources :: (Maybe [Resource] -> f (Maybe [Resource]))
-> ContainerInstance -> f ContainerInstance
containerInstance_registeredResources = (ContainerInstance -> Maybe [Resource])
-> (ContainerInstance -> Maybe [Resource] -> ContainerInstance)
-> Lens
     ContainerInstance
     ContainerInstance
     (Maybe [Resource])
     (Maybe [Resource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerInstance' {Maybe [Resource]
registeredResources :: Maybe [Resource]
$sel:registeredResources:ContainerInstance' :: ContainerInstance -> Maybe [Resource]
registeredResources} -> Maybe [Resource]
registeredResources) (\s :: ContainerInstance
s@ContainerInstance' {} Maybe [Resource]
a -> ContainerInstance
s {$sel:registeredResources:ContainerInstance' :: Maybe [Resource]
registeredResources = Maybe [Resource]
a} :: ContainerInstance) ((Maybe [Resource] -> f (Maybe [Resource]))
 -> ContainerInstance -> f ContainerInstance)
-> ((Maybe [Resource] -> f (Maybe [Resource]))
    -> Maybe [Resource] -> f (Maybe [Resource]))
-> (Maybe [Resource] -> f (Maybe [Resource]))
-> ContainerInstance
-> f ContainerInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Resource] [Resource] [Resource] [Resource]
-> Iso
     (Maybe [Resource])
     (Maybe [Resource])
     (Maybe [Resource])
     (Maybe [Resource])
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 [Resource] [Resource] [Resource] [Resource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON ContainerInstance where
  parseJSON :: Value -> Parser ContainerInstance
parseJSON =
    String
-> (Object -> Parser ContainerInstance)
-> Value
-> Parser ContainerInstance
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ContainerInstance"
      ( \Object
x ->
          Maybe Text
-> Maybe [Attachment]
-> Maybe Int
-> Maybe [Resource]
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe VersionInfo
-> Maybe AgentUpdateStatus
-> Maybe [Attribute]
-> Maybe Integer
-> Maybe Int
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe [Tag]
-> Maybe [Resource]
-> ContainerInstance
ContainerInstance'
            (Maybe Text
 -> Maybe [Attachment]
 -> Maybe Int
 -> Maybe [Resource]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe VersionInfo
 -> Maybe AgentUpdateStatus
 -> Maybe [Attribute]
 -> Maybe Integer
 -> Maybe Int
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe [Tag]
 -> Maybe [Resource]
 -> ContainerInstance)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Attachment]
      -> Maybe Int
      -> Maybe [Resource]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe VersionInfo
      -> Maybe AgentUpdateStatus
      -> Maybe [Attribute]
      -> Maybe Integer
      -> Maybe Int
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe [Resource]
      -> ContainerInstance)
forall (f :: * -> *) a b. Functor 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 [Attachment]
   -> Maybe Int
   -> Maybe [Resource]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe VersionInfo
   -> Maybe AgentUpdateStatus
   -> Maybe [Attribute]
   -> Maybe Integer
   -> Maybe Int
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe [Resource]
   -> ContainerInstance)
-> Parser (Maybe [Attachment])
-> Parser
     (Maybe Int
      -> Maybe [Resource]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe VersionInfo
      -> Maybe AgentUpdateStatus
      -> Maybe [Attribute]
      -> Maybe Integer
      -> Maybe Int
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe [Resource]
      -> ContainerInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Attachment]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"attachments" Parser (Maybe (Maybe [Attachment]))
-> Maybe [Attachment] -> Parser (Maybe [Attachment])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Attachment]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Int
   -> Maybe [Resource]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe VersionInfo
   -> Maybe AgentUpdateStatus
   -> Maybe [Attribute]
   -> Maybe Integer
   -> Maybe Int
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe [Resource]
   -> ContainerInstance)
-> Parser (Maybe Int)
-> Parser
     (Maybe [Resource]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe VersionInfo
      -> Maybe AgentUpdateStatus
      -> Maybe [Attribute]
      -> Maybe Integer
      -> Maybe Int
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe [Resource]
      -> ContainerInstance)
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
"runningTasksCount")
            Parser
  (Maybe [Resource]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe VersionInfo
   -> Maybe AgentUpdateStatus
   -> Maybe [Attribute]
   -> Maybe Integer
   -> Maybe Int
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe [Resource]
   -> ContainerInstance)
-> Parser (Maybe [Resource])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe VersionInfo
      -> Maybe AgentUpdateStatus
      -> Maybe [Attribute]
      -> Maybe Integer
      -> Maybe Int
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe [Resource]
      -> ContainerInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Resource]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"remainingResources"
                            Parser (Maybe (Maybe [Resource]))
-> Maybe [Resource] -> Parser (Maybe [Resource])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Resource]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe VersionInfo
   -> Maybe AgentUpdateStatus
   -> Maybe [Attribute]
   -> Maybe Integer
   -> Maybe Int
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe [Resource]
   -> ContainerInstance)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe VersionInfo
      -> Maybe AgentUpdateStatus
      -> Maybe [Attribute]
      -> Maybe Integer
      -> Maybe Int
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe [Resource]
      -> ContainerInstance)
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
"ec2InstanceId")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe VersionInfo
   -> Maybe AgentUpdateStatus
   -> Maybe [Attribute]
   -> Maybe Integer
   -> Maybe Int
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe [Resource]
   -> ContainerInstance)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe VersionInfo
      -> Maybe AgentUpdateStatus
      -> Maybe [Attribute]
      -> Maybe Integer
      -> Maybe Int
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe [Resource]
      -> ContainerInstance)
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
"containerInstanceArn")
            Parser
  (Maybe Bool
   -> Maybe VersionInfo
   -> Maybe AgentUpdateStatus
   -> Maybe [Attribute]
   -> Maybe Integer
   -> Maybe Int
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe [Resource]
   -> ContainerInstance)
-> Parser (Maybe Bool)
-> Parser
     (Maybe VersionInfo
      -> Maybe AgentUpdateStatus
      -> Maybe [Attribute]
      -> Maybe Integer
      -> Maybe Int
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe [Resource]
      -> ContainerInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"agentConnected")
            Parser
  (Maybe VersionInfo
   -> Maybe AgentUpdateStatus
   -> Maybe [Attribute]
   -> Maybe Integer
   -> Maybe Int
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe [Resource]
   -> ContainerInstance)
-> Parser (Maybe VersionInfo)
-> Parser
     (Maybe AgentUpdateStatus
      -> Maybe [Attribute]
      -> Maybe Integer
      -> Maybe Int
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe [Resource]
      -> ContainerInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe VersionInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"versionInfo")
            Parser
  (Maybe AgentUpdateStatus
   -> Maybe [Attribute]
   -> Maybe Integer
   -> Maybe Int
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe [Resource]
   -> ContainerInstance)
-> Parser (Maybe AgentUpdateStatus)
-> Parser
     (Maybe [Attribute]
      -> Maybe Integer
      -> Maybe Int
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe [Resource]
      -> ContainerInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AgentUpdateStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"agentUpdateStatus")
            Parser
  (Maybe [Attribute]
   -> Maybe Integer
   -> Maybe Int
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe [Resource]
   -> ContainerInstance)
-> Parser (Maybe [Attribute])
-> Parser
     (Maybe Integer
      -> Maybe Int
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe [Resource]
      -> ContainerInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Attribute]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"attributes" Parser (Maybe (Maybe [Attribute]))
-> Maybe [Attribute] -> Parser (Maybe [Attribute])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Attribute]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Integer
   -> Maybe Int
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe [Resource]
   -> ContainerInstance)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe [Resource]
      -> ContainerInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"version")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe [Resource]
   -> ContainerInstance)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe [Resource]
      -> ContainerInstance)
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
"pendingTasksCount")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe [Resource]
   -> ContainerInstance)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe [Resource]
      -> ContainerInstance)
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
"capacityProviderName")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe [Resource]
   -> ContainerInstance)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe [Tag] -> Maybe [Resource] -> ContainerInstance)
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
"registeredAt")
            Parser
  (Maybe Text
   -> Maybe [Tag] -> Maybe [Resource] -> ContainerInstance)
-> Parser (Maybe Text)
-> Parser (Maybe [Tag] -> Maybe [Resource] -> ContainerInstance)
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
"statusReason")
            Parser (Maybe [Tag] -> Maybe [Resource] -> ContainerInstance)
-> Parser (Maybe [Tag])
-> Parser (Maybe [Resource] -> ContainerInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe [Resource] -> ContainerInstance)
-> Parser (Maybe [Resource]) -> Parser ContainerInstance
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Resource]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"registeredResources"
                            Parser (Maybe (Maybe [Resource]))
-> Maybe [Resource] -> Parser (Maybe [Resource])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Resource]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ContainerInstance

instance Prelude.NFData ContainerInstance