Skip to content

Instantly share code, notes, and snippets.

@tasugim
Last active March 25, 2020 08:17
Show Gist options
  • Select an option

  • Save tasugim/6d90bf924e6a91a4113bfd075cce3371 to your computer and use it in GitHub Desktop.

Select an option

Save tasugim/6d90bf924e6a91a4113bfd075cce3371 to your computer and use it in GitHub Desktop.
{
"Parameters": {
"KeyName": {
"Description": "The EC2 Key Pair to allow SSH",
"Type": "AWS::EC2::KeyPair::KeyName"
}
},
"Resources": {
"Ec2Instance": {
"Type": "AWS::EC2::Instance",
"Properties": {
"SecurityGroups": [
{
"Ref": "InstanceSecurityGroup"
},
"MyExistingSecurityGroup"
],
"KeyName": {
"Ref": "KeyName"
},
"ImageID": "ami-7a11e213"
}
},
"InstanceSecurityGroup": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "Enable SSH access",
"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"FromPort": "22",
"ToPort": "22",
"CidrIp": "0.0.0.0/0"
}
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment