Menu
Amazon EC2 Container Service
Developer Guide (API Version 2014-11-13)

Updating the Amazon ECS Container Agent

Occasionally, you may need to update the Amazon ECS container agent to pick up bug fixes and new features. 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.

Checking Your Amazon ECS Container Agent Version

You can check the version of the container agent that is running on your container instances to see if you need to update it. The container instance view in the Amazon ECS console provides the agent version. Use the following procedure to check your agent version.

To check if your Amazon ECS container agent is running the latest version in the console

  1. Open the Amazon ECS console at https://console.aws.amazon.com/ecs/.

  2. On the Clusters page, select the cluster that hosts the container instance or instances to check.

  3. On the Cluster : cluster_name page, choose ECS Instances.

  4. Note the Agent version column for your container instances. If you are using an outdated agent version on any of your container instances, the console alerts you with a message and flags the outdated agent version.

    
                            Container instance agent version

    If your agent version is 1.14.5, you are running the latest container agent. If your agent version is below 1.14.5, you can update your container agent with the following procedures:

    Important

    To update the Amazon ECS agent version from versions prior to v1.0.0 on your Amazon ECS-optimized AMI, we recommend that you terminate your current container instance and launch a new instance with the most recent AMI version. Any container instances that use a preview version should be retired and replaced with the most recent AMI. For more information, see Launching an Amazon ECS Container Instance.

You can also use the Amazon ECS container agent introspection API to check the agent version from the container instance itself. For more information, see Amazon ECS Container Agent Introspection.

To check if your Amazon ECS container agent is running the latest version with the introspection API

  1. Log in to your container instance via SSH.

  2. Query the introspection API.

    Copy
    [ec2-user ~]$ curl -s 127.0.0.1:51678/v1/metadata | python -mjson.tool

    Output:

    {
        "Cluster": "default",
        "ContainerInstanceArn": "arn:aws:ecs:us-west-2:<aws_account_id>:container-instance/4d3910c1-27c8-410c-b1df-f5d06fab4305",
        "Version": "Amazon ECS Agent - v1.14.5 (0dcd02c)"
    }

    Note

    The introspection API added Version information in the version v1.0.0 of the Amazon ECS container agent. If Version is not present when querying the introspection API, or the introspection API is not present in your agent at all, then the version you are running is v0.0.3 or earlier. You should update your version.