I ran into a requirement where I need get the EC2 ami id of the latest amazon-ecs-optimized image of a specific region. Is there any script or api that is available to pick the ami-id, that they provide while creating a new cluster?
So that once they update the console with the latest ami, I need not update my scripts.
combining the answer from @romaninsh and @Derek
aws ssm get-parameters --names /aws/service/ecs/optimized-ami/amazon-linux/recommended | \
jq -r .Parameters[].Value | jq -r .image_id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With