Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save tasugim/e18a0946d027aa86d66b1193fb174502 to your computer and use it in GitHub Desktop.
Parameters:
KeyName:
Description: The EC2 Pair to allow SSH access
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