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

Copyright(c) 2013-2017 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 the service's deployment configuration parameters, minimumHealthyPercent and maximumPercent . Note that 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 Source #

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 Amazon Resource Name (ARN) entries.
  • ucisStatus - The container instance state with which to update the container instance.

data UpdateContainerInstancesState Source #

See: updateContainerInstancesState smart constructor.

Instances

Eq UpdateContainerInstancesState Source # 
Data UpdateContainerInstancesState Source # 

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 Source # 
Show UpdateContainerInstancesState Source # 
Generic UpdateContainerInstancesState Source # 
Hashable UpdateContainerInstancesState Source # 
ToJSON UpdateContainerInstancesState Source # 
NFData UpdateContainerInstancesState Source # 
AWSRequest UpdateContainerInstancesState Source # 
ToQuery UpdateContainerInstancesState Source # 
ToPath UpdateContainerInstancesState Source # 
ToHeaders UpdateContainerInstancesState Source # 
type Rep UpdateContainerInstancesState Source # 
type Rep UpdateContainerInstancesState = D1 (MetaData "UpdateContainerInstancesState" "Network.AWS.ECS.UpdateContainerInstancesState" "amazonka-ecs-1.5.0-EwatFke974vDkurbaNzIje" False) (C1 (MetaCons "UpdateContainerInstancesState'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_ucisCluster") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) ((:*:) (S1 (MetaSel (Just Symbol "_ucisContainerInstances") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [Text])) (S1 (MetaSel (Just Symbol "_ucisStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ContainerInstanceStatus)))))
type Rs UpdateContainerInstancesState Source # 

Request Lenses

ucisCluster :: Lens' UpdateContainerInstancesState (Maybe Text) Source #

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] Source #

A list of container instance IDs or full Amazon Resource Name (ARN) entries.

ucisStatus :: Lens' UpdateContainerInstancesState ContainerInstanceStatus Source #

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

Destructuring the Response

updateContainerInstancesStateResponse Source #

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 Source #

Instances

Eq UpdateContainerInstancesStateResponse Source # 
Data UpdateContainerInstancesStateResponse Source # 

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 Source # 
Show UpdateContainerInstancesStateResponse Source # 
Generic UpdateContainerInstancesStateResponse Source # 
NFData UpdateContainerInstancesStateResponse Source # 
type Rep UpdateContainerInstancesStateResponse Source # 
type Rep UpdateContainerInstancesStateResponse = D1 (MetaData "UpdateContainerInstancesStateResponse" "Network.AWS.ECS.UpdateContainerInstancesState" "amazonka-ecs-1.5.0-EwatFke974vDkurbaNzIje" False) (C1 (MetaCons "UpdateContainerInstancesStateResponse'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_ucisrsFailures") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [Failure]))) ((:*:) (S1 (MetaSel (Just Symbol "_ucisrsContainerInstances") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [ContainerInstance]))) (S1 (MetaSel (Just Symbol "_ucisrsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)))))

Response Lenses

ucisrsFailures :: Lens' UpdateContainerInstancesStateResponse [Failure] Source #

Any failures associated with the call.