Skip to content

Instantly share code, notes, and snippets.

@gsweene2
Last active October 29, 2018 00:05
Show Gist options
  • Save gsweene2/b7ee878aed44dc40177a8dd900e27602 to your computer and use it in GitHub Desktop.
Save gsweene2/b7ee878aed44dc40177a8dd900e27602 to your computer and use it in GitHub Desktop.
Parameters:
SSHLocation:
Description: "Allow SSH to instance from this IP"
Type: "String"
VpcId:
Description: VpcId for the SG
Type: AWS::EC2::VPC::Id
Resources:
InstanceSecurityGroup:
Type: "AWS::EC2::SecurityGroup"
Properties:
VpcId:
Ref: "VpcId"
GroupDescription: "Enable SSH access via port 22"
SecurityGroupIngress:
-
IpProtocol: "tcp"
FromPort: "22"
ToPort: "22"
CidrIp:
Ref: "SSHLocation"
-
IpProtocol: "tcp"
FromPort: "80"
ToPort: "80"
CidrIp: "0.0.0.0/0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment