Posted On: Apr 10, 2018

Amazon Elastic Container Service (Amazon ECS) now allows users to dynamically get the latest ECS-optimized Amazon Machine Image (AMI) ID when creating an Amazon ECS cluster made up of Amazon EC2 instances.

It is a best practice to use the latest version of the ECS-Optimized AMI when you create a new EC2 cluster for Amazon ECS, as new releases include bug fixes and feature updates. Previously, to ensure you were using the latest AMI meant checking the Amazon Web Services Documentation or subscribing to the ECS-AMI SNS topic. You then had to manually update any templates or resources with the new AMI ID.

Now, you can simply query the SSM Parameter Store API to get the latest AMI version ID or a list of available AMI IDs and their corresponding Docker runtime and ECS agent versions. You can query the SSM Parameter Store API using the Amazon CLI or any of the Amazon SDKs.

To see the latest ECS Optimized Amazon Linux AMI information in your default region, run this Amazon CLI command in your terminal:

aws ssm get-parameters --names /aws/service/ecs/optimized-ami/amazon-linux/recommended

To learn more, visit the Amazon ECS documentation. Get more information about Amazon ECS on the product page.

Amazon ECS is available in the Amazon Web Services China (Beijing) region, operated by Sinnet.