Skip to content

Instantly share code, notes, and snippets.

@darko-mesaros
Created May 18, 2020 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darko-mesaros/dc0ffa6fe15d5c3e27c60dd6ec39bcf4 to your computer and use it in GitHub Desktop.
Save darko-mesaros/dc0ffa6fe15d5c3e27c60dd6ec39bcf4 to your computer and use it in GitHub Desktop.
Automagically resolve the latest Amazon Linux AMI by using the global parameters! πŸ”
AWSTemplateFormatVersion: "2010-09-09"
Description: >
https://twitch.tv/ruptwelve
Parameters:
InstanceType:
Type: String
Description: Please Choose the instance type
Default: m6g.medium
AllowedValues:
- m6g.medium
- m6g.large
KeyPair:
Type: AWS::EC2::KeyPair::KeyName
Description: The keypair to be used to access your EC2 instances.
AMI:
Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
Default: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-arm64-gp2'
Resources:
MyGraviton:
Type: "AWS::EC2::Instance"
Properties:
InstanceType:
Ref: InstanceType
KeyName:
Ref: KeyPair
ImageId: !Ref AMI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment