Skip to content

Instantly share code, notes, and snippets.

@liyucun
liyucun / ec2-instance.yml
Created May 14, 2019
ec2 instance security group cloudformation example template
View ec2-instance.yml
InstanceSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Allow traffic from the security group assigned to the load balancer
VpcId: !Ref Vpc
SecurityGroupIngress:
- SourceSecurityGroupId: !Ref PublicLoadBalancerSG
IpProtocol: -1
@liyucun
liyucun / load-balancer.yml
Last active May 16, 2019
load balancer cloudformation sample template
View load-balancer.yml
PrivateLoadBalancerSG:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Access to the private facing load balancer
VpcId: !Ref Vpc
SecurityGroupIngress:
- SourceSecurityGroupId: !Ref 'PublicEC2InstanceSecurityGroup' # only accept traffic from public accessible instances in the security group
IpProtocol: -1
SecurityGroupEgress:
- CidrIp: 0.0.0.0/0