Skip to content

Instantly share code, notes, and snippets.

@e2kaneko
Created February 6, 2019 13:32
Show Gist options
  • Save e2kaneko/4af439d757266925233d5c95347bfcad to your computer and use it in GitHub Desktop.
Save e2kaneko/4af439d757266925233d5c95347bfcad to your computer and use it in GitHub Desktop.
CloudFormationで自身のセキュリティグループIDをターゲットにするグループを作成する
InternalSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
VpcId: !Ref FirstVPC
GroupName: !Sub "internal-sg"
GroupDescription: "Internal SG"
InternalSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: !Ref InternalSecurityGroup
IpProtocol: -1
FromPort: 0
ToPort: 65535
SourceSecurityGroupId: !Ref InternalSecurityGroup
DependsOn: InternalSecurityGroup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment