Last active
May 16, 2019 12:35
-
-
Save williamhub/55e9cc2d807e40856e3f3e34a396d9d2 to your computer and use it in GitHub Desktop.
load balancer cloudformation sample template
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
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 | |
IpProtocol: -1 | |
PublicLoadBalancer: | |
Type: AWS::ElasticLoadBalancingV2::LoadBalancer | |
Properties: | |
Scheme: internet-facing | |
LoadBalancerAttributes: | |
- Key: idle_timeout.timeout_seconds | |
Value: "30" | |
Subnets: | |
- Fn::ImportValue: PublicSubnetA | |
- Fn::ImportValue: PublicSubnetB | |
SecurityGroups: [!Ref "PublicLoadBalancerSG"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment