How do i find the ecs optimised ami for a particular region?



  • These are AMI that have software preinstalled like docker and the ecs agent.

    This command lists the AMI for the us-east-1 region.

    $ aws ssm get-parameters --names /aws/service/ecs/optimized-ami/amazon-linux/recommended --region us-east-1
    {
        "InvalidParameters": [], 
        "Parameters": [
            {
                "Version": 3, 
                "Type": "String", 
                "Name": "/aws/service/ecs/optimized-ami/amazon-linux/recommended", 
                "Value": "{\"schema_version\":1,\"image_name\":\"amzn-ami-2017.09.l-amazon-ecs-optimized\",\"image_id\":\"ami-aff65ad2\",\"os\":\"Amazon Linux\",\"ecs_runtime_version\":\"Docker version 17.12.1-ce\",\"ecs_agent_version\":\"1.17.3\"}"
            }
        ]
    }
    

    To obtain just the ami id.

    $ aws ssm get-parameters --names /aws/service/ecs/optimized-ami/amazon-linux/recommended/image_id --region us-east-1 --query "Parameters[0].Value"
    
    "ami-aff65ad2"
    

Log in to reply
 

© Lightnetics 2024