Created
December 11, 2016 14:04
-
-
Save flannon/9ca244eba14c33364c24d86279aa63a9 to your computer and use it in GitHub Desktop.
Cloudformation cross stack security group with exported GroupId
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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: 'Cross stack security group' | |
Resources: | |
egress1: | |
Type: AWS::EC2::SecurityGroupEgress | |
Properties: | |
CidrIp: 0.0.0.0/0 | |
GroupId: | |
Ref: sgTESTY22 | |
IpProtocol: '-1' | |
ingress1: | |
Type: AWS::EC2::SecurityGroupIngress | |
Properties: | |
CidrIp: 192.168.0.0/16 | |
FromPort: '22' | |
GroupId: | |
Ref: sgTESTY22 | |
IpProtocol: tcp | |
ToPort: '22' | |
ingress2: | |
Type: AWS::EC2::SecurityGroupIngress | |
Properties: | |
CidrIp: 172.16.0.0/12 | |
FromPort: '22' | |
GroupId: | |
Ref: sgTESTY22 | |
IpProtocol: tcp | |
ToPort: '22' | |
ingress3: | |
Type: AWS::EC2::SecurityGroupIngress | |
Properties: | |
CidrIp: 10.0.0.0/8 | |
FromPort: '22' | |
GroupId: | |
Ref: sgTESTY22 | |
IpProtocol: tcp | |
ToPort: '22' | |
sgTESTY22: | |
Type: AWS::EC2::SecurityGroup | |
Properties: | |
GroupDescription: SSH available to local networks | |
Tags: | |
- Key: Name | |
Value: TESTY-22 | |
VpcId: vpc-f0c46a95 | |
Outputs: | |
sgTESTY22: | |
Description: TESTY22 group security GroupId | |
Value: | |
!GetAtt | |
- sgTESTY22 | |
- GroupId | |
Export: | |
Name: !Sub "${AWS::StackName}-SecurityGroupID" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment