Created
June 24, 2018 08:23
-
-
Save daniyel/08f33d4c4d6065124c323c24c3df873c to your computer and use it in GitHub Desktop.
Example of self-referencing security group in AWS
This file contains 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
Parameters: | |
VPC: | |
Description: VPC that will be used for Cluster. | |
Type: AWS::EC2::VPC::Id | |
Resources: | |
MyTestSecurityGroup: | |
Type: AWS::EC2::SecurityGroup | |
Properties: | |
VpcId: !Ref VPC | |
GroupDescription: Just my testing security group. | |
Tags: | |
- Key: Name | |
Value: sg-mytest | |
MyTestSecurityGroupIngress: | |
Type: AWS::EC2::SecurityGroupIngress | |
DependsOn: MyTestSecurityGroup | |
Properties: | |
Description: Allow access from anywhere to my security group. | |
GroupId: !Ref MyTestSecurityGroup | |
IpProtocol: tcp | |
FromPort: 80 | |
ToPort: 80 | |
CidrIp: '0.0.0.0/0' | |
MyTestSecurityGroupIngress2: | |
Type: AWS::EC2::SecurityGroupIngress | |
DependsOn: MyTestSecurityGroup | |
Properties: | |
GroupId: !Ref MyTestSecurityGroup | |
Description: Allow access between security groups. | |
IpProtocol: tcp | |
FromPort: '0' | |
ToPort: '65535' | |
SourceSecurityGroupId: !Ref MyTestSecurityGroup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment