Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . ecs ]

update-container-agent

Description

Updates the Amazon ECS container agent on a specified container instance. Updating the Amazon ECS container agent does not interrupt running tasks or services on the container instance. The process for updating the agent differs depending on whether your container instance was launched with the Amazon ECS-optimized AMI or another operating system.

update-container-agent requires the Amazon ECS-optimized AMI or Amazon Linux with the ecs-init service installed and running. For help updating the Amazon ECS container agent on other operating systems, see Manually Updating the Amazon ECS Container Agent in the Amazon EC2 Container Service Developer Guide .

See also: AWS API Documentation

Synopsis

  update-container-agent
[--cluster <value>]
--container-instance <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--cluster (string)

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

--container-instance (string)

The container instance ID or full Amazon Resource Name (ARN) entries for the container instance on which you would like to update the Amazon ECS container agent.

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

Examples

To update the container agent on an Amazon ECS container instance

This example command updates the container agent on the container instance a3e98c65-2a40-4452-a63c-62beb4d9be9b in the default cluster.

Command:

aws ecs update-container-agent --cluster default --container-instance a3e98c65-2a40-4452-a63c-62beb4d9be9b

Output:

{
    "containerInstance": {
        "status": "ACTIVE",
...
        "agentUpdateStatus": "PENDING",
        "versionInfo": {
            "agentVersion": "1.0.0",
            "agentHash": "4023248",
            "dockerVersion": "DockerVersion: 1.5.0"
        }
    }
}

Output

containerInstance -> (structure)

The container instance for which the container agent was updated.

containerInstanceArn -> (string)

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 AWS 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 `` .

ec2InstanceId -> (string)

The EC2 instance ID of the container instance.

version -> (long)

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.

versionInfo -> (structure)

The version information for the Amazon ECS container agent and Docker daemon running on the container instance.

agentVersion -> (string)

The version number of the Amazon ECS container agent.

agentHash -> (string)

The Git commit hash for the Amazon ECS container agent build on the amazon-ecs-agent GitHub repository.

dockerVersion -> (string)

The Docker version running on the container instance.

remainingResources -> (list)

For most resource types, this parameter describes the remaining resources of the container instance that are available for new tasks. For port resource types, this parameter describes the ports that are reserved by the Amazon ECS container agent and any containers that have reserved port mappings; any port that is not specified here is available for new tasks.

(structure)

Describes the resources available for a container instance.

name -> (string)

The name of the resource, such as cpu , memory , ports , or a user-defined resource.

type -> (string)

The type of the resource, such as INTEGER , DOUBLE , LONG , or STRINGSET .

doubleValue -> (double)

When the doubleValue type is set, the value of the resource must be a double precision floating-point type.

longValue -> (long)

When the longValue type is set, the value of the resource must be an extended precision floating-point type.

integerValue -> (integer)

When the integerValue type is set, the value of the resource must be an integer.

stringSetValue -> (list)

When the stringSetValue type is set, the value of the resource must be a string type.

(string)

registeredResources -> (list)

For most resource types, this parameter describes the registered resources on the container instance that are in use by current 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.

(structure)

Describes the resources available for a container instance.

name -> (string)

The name of the resource, such as cpu , memory , ports , or a user-defined resource.

type -> (string)

The type of the resource, such as INTEGER , DOUBLE , LONG , or STRINGSET .

doubleValue -> (double)

When the doubleValue type is set, the value of the resource must be a double precision floating-point type.

longValue -> (long)

When the longValue type is set, the value of the resource must be an extended precision floating-point type.

integerValue -> (integer)

When the integerValue type is set, the value of the resource must be an integer.

stringSetValue -> (list)

When the stringSetValue type is set, the value of the resource must be a string type.

(string)

status -> (string)

The status of the container instance. The valid values are ACTIVE , INACTIVE , or DRAINING . ACTIVE indicates that the container instance can accept tasks. 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 Container Instance Draining in the Amazon EC2 Container Service Developer Guide .

agentConnected -> (boolean)

This parameter returns true if the agent is actually connected to Amazon ECS. Registered instances with an agent that may be unhealthy or stopped return false , and instances without a connected agent cannot accept placement requests.

runningTasksCount -> (integer)

The number of tasks on the container instance that are in the RUNNING status.

pendingTasksCount -> (integer)

The number of tasks on the container instance that are in the PENDING status.

agentUpdateStatus -> (string)

The status of the most recent agent update. If an update has never been requested, this value is NULL .

attributes -> (list)

The attributes set for the container instance, either by the Amazon ECS container agent at instance registration or manually with the put-attributes operation.

(structure)

An attribute is a name-value pair associated with an Amazon ECS object. Attributes enable you to extend the Amazon ECS data model by adding custom metadata to your resources. For more information, see Attributes in the Amazon EC2 Container Service Developer Guide .

name -> (string)

The name of the attribute. Up to 128 letters (uppercase and lowercase), numbers, hyphens, underscores, and periods are allowed.

value -> (string)

The value of the attribute. Up to 128 letters (uppercase and lowercase), numbers, hyphens, underscores, periods, at signs (@), forward slashes, colons, and spaces are allowed.

targetType -> (string)

The type of the target with which to attach the attribute. This parameter is required if you use the short form ID for a resource instead of the full Amazon Resource Name (ARN).

targetId -> (string)

The ID of the target. You can specify the short form ID for a resource or the full Amazon Resource Name (ARN).

registeredAt -> (timestamp)

The Unix timestamp for when the container instance was registered.

attachments -> (list)

The Elastic Network Interfaces associated with the container instance.

(structure)

An object representing a container instance or task attachment.

id -> (string)

The unique identifier for the attachment.

type -> (string)

The type of the attachment, such as an ElasticNetworkInterface .

status -> (string)

The status of the attachment. Valid values are PRECREATED , CREATED , ATTACHING , ATTACHED , DETACHING , DETACHED , and DELETED .

details -> (list)

Details of the attachment. For Elastic Network Interfaces, this includes the network interface ID, the MAC address, the subnet ID, and the private IPv4 address.

(structure)

A key and value pair object.

name -> (string)

The name of the key value pair. For environment variables, this is the name of the environment variable.

value -> (string)

The value of the key value pair. For environment variables, this is the value of the environment variable.