Skip to content

Instantly share code, notes, and snippets.

@eulersson
Last active February 20, 2019 00:02
Show Gist options
  • Save eulersson/f037414c82e286a3320548fc5e11b9ff to your computer and use it in GitHub Desktop.
Save eulersson/f037414c82e286a3320548fc5e11b9ff to your computer and use it in GitHub Desktop.
TargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Properties:
Name: ecsfs-target-group
Port: 80
Protocol: HTTP
TargetType: ip
VpcId: !Ref VPC
ListenerHTTP:
Type: AWS::ElasticLoadBalancingV2::Listener
Properties:
DefaultActions:
- TargetGroupArn: !Ref TargetGroup
Type: forward
LoadBalancerArn: !Ref LoadBalancer
Port: 80
Protocol: HTTP
LoadBalancer:
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
Properties:
Scheme: internet-facing
SecurityGroups:
- !Ref PublicLoadBalancerSecurityGroup
Subnets:
- !Ref PublicSubnetOne
- !Ref PublicSubnetTwo
DNSRecord:
Type: AWS::Route53::RecordSet
Condition: HasHostedZoneName
Properties:
HostedZoneName: !Ref HostedZoneName
Name: !Join ['.', [ecsfs, !Ref HostedZoneName]]
Type: A
AliasTarget:
DNSName: !GetAtt LoadBalancer.DNSName
HostedZoneId: !GetAtt LoadBalancer.CanonicalHostedZoneID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment