Skip to content

Instantly share code, notes, and snippets.

@JustinDPerkins
Last active November 21, 2022 16:25
Show Gist options
  • Save JustinDPerkins/09001a21f974432ecb57d7c29daa7a25 to your computer and use it in GitHub Desktop.
Save JustinDPerkins/09001a21f974432ecb57d7c29daa7a25 to your computer and use it in GitHub Desktop.
AWS SSM Parameter Store AMI ID Query String
Description: This template deploys a Linux and Ubuntu EC2 instance to highlight the SSM parameter store public AMI-ID strings.
#Default VPC will be used.
Parameters:
#CFT Parameter created with default string for SSM AMI string.
LatestUbuntuAmiId:
Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
Default: '/aws/service/canonical/ubuntu/server/18.04/stable/20220810/amd64/hvm/ebs-gp2/ami-id'
Description: DO NOT CHANGE THIS VALUE
Resources:
#Amazon Linux Resource created with resolve string for SSM AMI string.
AmazonLinux:
Type: AWS::EC2::Instance
Properties:
ImageId: resolve:ssm:/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2
InstanceType: t3.micro
Tags:
- Key: Name
Value: AmazonLinux
- Key: Project
Value: SSM
#Ubuntu Resource via CFT input parameter to link for SSM AMI string.
UbuntuLinux:
Type: AWS::EC2::Instance
Properties:
ImageId: !Ref LatestUbuntuAmiId
InstanceType: t3.micro
Tags:
- Key: Name
Value: Ubuntu
- Key: Project
Value: SSM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment