Last active
July 21, 2017 03:02
-
-
Save tmclaugh/fb72dbe9a30ba36279b2704ef84dc4d3 to your computer and use it in GitHub Desktop.
Revisions
-
tmclaugh revised this gist
Jul 21, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ vpc: Type: AWS::EC2::VPC Properties: CidrBlock: "10.0.0.0/16" -
tmclaugh created this gist
Jul 21, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,72 @@ c: Type: AWS::EC2::VPC Properties: CidrBlock: "10.0.0.0/16" EnableDnsSupport: false EnableDnsHostnames: false Tags: - Key: Name Value: ${self:service}-${self:provider.stage} # This doesn't work for all regions but handles the vast majority. I hope # when this actually becomes a problem for their to be a better solution. vpcSubnet1: Type: AWS::EC2::Subnet Properties: AvailabilityZone: Fn::Select: - 0 - Fn::GetAZs: "" CidrBlock: 10.0.0.0/20 VpcId: Ref: vpc vpcSubnet2: Type: AWS::EC2::Subnet Properties: AvailabilityZone: Fn::Select: - 1 - Fn::GetAZs: "" CidrBlock: 10.0.16.0/20 VpcId: Ref: vpc vpcSubnet3: Type: AWS::EC2::Subnet Properties: AvailabilityZone: Fn::Select: - 2 - Fn::GetAZs: "" CidrBlock: 10.0.32.0/20 VpcId: Ref: vpc securityGroupDefault: Type: AWS::EC2::SecurityGroup Properties: GroupDescription: ${self:service}-${self:provider.stage} Tags: - Key: Name Value: ${self:service}-${self:provider.stage} VpcId: Ref: vpc # This will override the default SG so we can control rules using # AWS::EC2::SecurityGroup{Ingress,Egress} resources. SecurityGroupEgress: - IpProtocol: -1 CidrIp: 127.0.0.1/32 securityGroupEgressDefault: Type: AWS::EC2::SecurityGroupEgress Properties: GroupId: Ref: securityGroupDefault IpProtocol: -1 DestinationSecurityGroupId: Ref: securityGroupDefault securityGroupIngressDefault: Type: AWS::EC2::SecurityGroupIngress Properties: GroupId: Ref: securityGroupDefault IpProtocol: -1 SourceSecurityGroupId: Ref: securityGroupDefault