Created
March 16, 2017 23:24
-
-
Save waltervargas/0605b9cacac2e1892198f0c29742c018 to your computer and use it in GitHub Desktop.
CloudFormation SG Self-Referenced
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 characters
--- | |
Description: Create a VPC with a SG which references itself | |
AWSTemplateFormatVersion: '2010-09-09' | |
Resources: | |
vpc: | |
Type: AWS::EC2::VPC | |
Properties: | |
CidrBlock: 172.16.0.0/16 | |
EnableDnsSupport: false | |
EnableDnsHostnames: false | |
InstanceTenancy: default | |
Tags: | |
- Key: Name | |
Value: vpc-main | |
sgcluster: | |
Type: AWS::EC2::SecurityGroup | |
DependsOn: vpc | |
Properties: | |
GroupDescription: vpc tester sg | |
VpcId: | |
Ref: vpc | |
sgclusteringress: | |
Type: AWS::EC2::SecurityGroupIngress | |
DependsOn: sgcluster | |
Properties: | |
GroupId: | |
Ref: sgcluster | |
IpProtocol: tcp | |
FromPort: '0' | |
ToPort: '65535' | |
SourceSecurityGroupId: | |
Ref: sgcluster |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment