amazonka-ecs-1.6.1: Amazon EC2 Container Service SDK.

Copyright(c) 2013-2018 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.ECS.UpdateContainerInstancesState

Contents

Description

Modifies the status of an Amazon ECS container instance.

You can change the status of a container instance to DRAINING to manually remove an instance from a cluster, for example to perform system updates, update the Docker daemon, or scale down the cluster size.

When you set a container instance to DRAINING , Amazon ECS prevents new tasks from being scheduled for placement on the container instance and replacement service tasks are started on other container instances in the cluster if the resources are available. Service tasks on the container instance that are in the PENDING state are stopped immediately.

Service tasks on the container instance that are in the RUNNING state are stopped and replaced according to the service's deployment configuration parameters, minimumHealthyPercent and maximumPercent . You can change the deployment configuration of your service using UpdateService .

  • If minimumHealthyPercent is below 100%, the scheduler can ignore desiredCount temporarily during task replacement. For example, desiredCount is four tasks, a minimum of 50% allows the scheduler to stop two existing tasks before starting two new tasks. If the minimum is 100%, the service scheduler can't remove existing tasks until the replacement tasks are considered healthy. Tasks for services that do not use a load balancer are considered healthy if they are in the RUNNING state. Tasks for services that use a load balancer are considered healthy if they are in the RUNNING state and the container instance they are hosted on is reported as healthy by the load balancer.
  • The maximumPercent parameter represents an upper limit on the number of running tasks during task replacement, which enables you to define the replacement batch size. For example, if desiredCount of four tasks, a maximum of 200% starts four new tasks before stopping the four tasks to be drained (provided that the cluster resources required to do this are available). If the maximum is 100%, then replacement tasks can't start until the draining tasks have stopped.

Any PENDING or RUNNING tasks that do not belong to a service are not affected; you must wait for them to finish or stop them manually.

A container instance has completed draining when it has no more RUNNING tasks. You can verify this using ListTasks .

When you set a container instance to ACTIVE , the Amazon ECS scheduler can begin scheduling tasks on the instance again.

Synopsis

Creating a Request

updateContainerInstancesState #

Creates a value of UpdateContainerInstancesState with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • ucisCluster - The short name or full Amazon Resource Name (ARN) of the cluster that hosts the container instance to update. If you do not specify a cluster, the default cluster is assumed.
  • ucisContainerInstances - A list of container instance IDs or full ARN entries.
  • ucisStatus - The container instance state with which to update the container instance.

data UpdateContainerInstancesState #

See: updateContainerInstancesState smart constructor.

Instances
Eq UpdateContainerInstancesState # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

Data UpdateContainerInstancesState # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UpdateContainerInstancesState -> c UpdateContainerInstancesState #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UpdateContainerInstancesState #

toConstr :: UpdateContainerInstancesState -> Constr #

dataTypeOf :: UpdateContainerInstancesState -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UpdateContainerInstancesState) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UpdateContainerInstancesState) #

gmapT :: (forall b. Data b => b -> b) -> UpdateContainerInstancesState -> UpdateContainerInstancesState #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UpdateContainerInstancesState -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UpdateContainerInstancesState -> r #

gmapQ :: (forall d. Data d => d -> u) -> UpdateContainerInstancesState -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UpdateContainerInstancesState -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UpdateContainerInstancesState -> m UpdateContainerInstancesState #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UpdateContainerInstancesState -> m UpdateContainerInstancesState #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UpdateContainerInstancesState -> m UpdateContainerInstancesState #

Read UpdateContainerInstancesState # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

Show UpdateContainerInstancesState # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

Generic UpdateContainerInstancesState # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

Associated Types

type Rep UpdateContainerInstancesState :: Type -> Type #

Hashable UpdateContainerInstancesState # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

ToJSON UpdateContainerInstancesState # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

AWSRequest UpdateContainerInstancesState # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

Associated Types

type Rs UpdateContainerInstancesState :: Type #

ToHeaders UpdateContainerInstancesState # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

ToPath UpdateContainerInstancesState # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

ToQuery UpdateContainerInstancesState # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

NFData UpdateContainerInstancesState # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

type Rep UpdateContainerInstancesState # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

type Rep UpdateContainerInstancesState = D1 (MetaData "UpdateContainerInstancesState" "Network.AWS.ECS.UpdateContainerInstancesState" "amazonka-ecs-1.6.1-L1UdJla9EUcK0wHkUmqs0y" False) (C1 (MetaCons "UpdateContainerInstancesState'" PrefixI True) (S1 (MetaSel (Just "_ucisCluster") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 (MetaSel (Just "_ucisContainerInstances") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [Text]) :*: S1 (MetaSel (Just "_ucisStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ContainerInstanceStatus))))
type Rs UpdateContainerInstancesState # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

Request Lenses

ucisCluster :: Lens' UpdateContainerInstancesState (Maybe Text) #

The short name or full Amazon Resource Name (ARN) of the cluster that hosts the container instance to update. If you do not specify a cluster, the default cluster is assumed.

ucisContainerInstances :: Lens' UpdateContainerInstancesState [Text] #

A list of container instance IDs or full ARN entries.

ucisStatus :: Lens' UpdateContainerInstancesState ContainerInstanceStatus #

The container instance state with which to update the container instance.

Destructuring the Response

updateContainerInstancesStateResponse #

Creates a value of UpdateContainerInstancesStateResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

data UpdateContainerInstancesStateResponse #

Instances
Eq UpdateContainerInstancesStateResponse # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

Data UpdateContainerInstancesStateResponse # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UpdateContainerInstancesStateResponse -> c UpdateContainerInstancesStateResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UpdateContainerInstancesStateResponse #

toConstr :: UpdateContainerInstancesStateResponse -> Constr #

dataTypeOf :: UpdateContainerInstancesStateResponse -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UpdateContainerInstancesStateResponse) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UpdateContainerInstancesStateResponse) #

gmapT :: (forall b. Data b => b -> b) -> UpdateContainerInstancesStateResponse -> UpdateContainerInstancesStateResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UpdateContainerInstancesStateResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UpdateContainerInstancesStateResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> UpdateContainerInstancesStateResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UpdateContainerInstancesStateResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UpdateContainerInstancesStateResponse -> m UpdateContainerInstancesStateResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UpdateContainerInstancesStateResponse -> m UpdateContainerInstancesStateResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UpdateContainerInstancesStateResponse -> m UpdateContainerInstancesStateResponse #

Read UpdateContainerInstancesStateResponse # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

Show UpdateContainerInstancesStateResponse # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

Generic UpdateContainerInstancesStateResponse # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

NFData UpdateContainerInstancesStateResponse # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

type Rep UpdateContainerInstancesStateResponse # 
Instance details

Defined in Network.AWS.ECS.UpdateContainerInstancesState

type Rep UpdateContainerInstancesStateResponse = D1 (MetaData "UpdateContainerInstancesStateResponse" "Network.AWS.ECS.UpdateContainerInstancesState" "amazonka-ecs-1.6.1-L1UdJla9EUcK0wHkUmqs0y" False) (C1 (MetaCons "UpdateContainerInstancesStateResponse'" PrefixI True) (S1 (MetaSel (Just "_ucisrsFailures") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [Failure])) :*: (S1 (MetaSel (Just "_ucisrsContainerInstances") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [ContainerInstance])) :*: S1 (MetaSel (Just "_ucisrsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int))))

Response Lenses

ucisrsFailures :: Lens' UpdateContainerInstancesStateResponse [Failure] #

Any failures associated with the call.