# Use public Systems Manager Parameter
Parameters:
LatestAmiId:
Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
Default: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2'
Resources:
Instance:
Type: 'AWS::EC2::Instance'
Properties:
ImageId: !Ref LatestAmiId
/aws/service/ami-windows-latest
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/retrieve-ecs-optimized_AMI.html
/aws/service/ecs/optimized-ami/amazon-linux-2/recommended/image_id
The following parameter name format retrieves the metadata of a specific Amazon ECS-optimized AMI version by specifying the AMI name.
Amazon ECS-optimized Amazon Linux 2 AMI metadata:
/aws/service/ecs/optimized-ami/amazon-linux-2/amzn2-ami-ecs-hvm-2.0.20181112-x86_64-ebs
Amazon ECS-optimized Amazon Linux 2 (arm64) AMI metadata:
/aws/service/ecs/optimized-ami/amazon-linux-2/arm64/amzn2-ami-ecs-hvm-2.0.20181120-arm64-ebs
Amazon ECS-optimized Amazon Linux AMI metadata:
/aws/service/ecs/optimized-ami/amazon-linux/amzn-ami-2017.09.l-amazon-ecs-optimized
Amazon ECS-optimized Windows 2019 AMI metadata:
/aws/service/ecs/optimized-ami/windows_server/2019/english/full/2019.05.10
Amazon ECS-optimized Windows 2016 AMI metadata:
/aws/service/ecs/optimized-ami/windows_server/2016/english/full/2019.03.07