Created
February 24, 2017 01:38
-
-
Save ivawzh/435dd3f169aeb7c19878b828c6a5c72a to your computer and use it in GitHub Desktop.
Stand alone ALB Cloudformation setup. For ECS service to consume.
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
Resources: | |
# ============================ Application Load Balancer ============================ | |
LoadBalancer: | |
Type: AWS::ElasticLoadBalancingV2::LoadBalancer | |
Properties: | |
Name: !Ref AWS::StackName | |
Scheme: internet-facing | |
Subnets: !Split | |
- ',' | |
- "Fn::ImportValue": | |
"Fn::Sub": "${NetworkStackName}-PublicSubnets" | |
SecurityGroups: | |
- !ImportValue | |
"Fn::Sub": "${ECSCLusterStackName}-LoadBalancerSecurityGroup" | |
LoadBalancerAttributes: | |
- Key: idle_timeout.timeout_seconds | |
Value: '30' | |
Tags: | |
- Key: Name | |
Value: !Ref AWS::StackName | |
LoadBalancerListener: | |
Type: AWS::ElasticLoadBalancingV2::Listener | |
Properties: | |
LoadBalancerArn: !Ref LoadBalancer | |
Port: 80 | |
# Protocol: HTTPS | |
Protocol: HTTP | |
Certificates: | |
- CertificateArn: !ImportValue | |
"Fn::Sub": "${CertificatesStackName}-StudyABitCertificate" | |
DefaultActions: | |
- Type: forward | |
TargetGroupArn: !Ref DefaultTargetGroup | |
# # We define a default target group here, as this is a mandatory Parameters | |
# # when creating an Application Load Balancer Listener. This is not used, instead | |
# # a target group is created per-service in each service template | |
DefaultTargetGroup: | |
Type: AWS::ElasticLoadBalancingV2::TargetGroup | |
Properties: | |
Name: default | |
VpcId: !ImportValue | |
"Fn::Sub": "${NetworkStackName}-VPC" | |
Port: 80 | |
Protocol: HTTP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment