This repository has been archived on 2023-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
Joseph Manley 1ceff14887 Basic infrastructure stack
Infrastructure parameter fixes

Implement working infrastructure stack in ECS
2020-04-30 23:05:13 -04:00

67 lines
1.6 KiB
YAML

AWSTemplateFormatVersion: "2010-09-09"
Description: DT load balancing stack
Parameters:
environment:
Type: String
Description: Name of the environment
Default: production
release:
Type: String
Description: Name of the release name of the stack version to use.
Default: production
PublicSubnets:
Description: The public subnets for the ALB to run in.
Type: String
VpcId:
Description: ID of the VPC
Type: AWS::EC2::VPC::Id
Resources:
#-- Network Load Balancer --#
PublicNLB:
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
Properties:
Type: network
LoadBalancerAttributes:
- Key: deletion_protection.enabled
Value: false
Scheme: internet-facing
Subnets: !Split [",", !Ref PublicSubnets]
Tags:
- Key: Name
Value: !Sub "DT-${environment}-NLB"
- Key: environment
Value: !Ref environment
NlbTargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Properties:
Port: 7777
Protocol: TCP_UDP
TargetGroupAttributes:
- Key: deregistration_delay.timeout_seconds
Value: '20'
VpcId: !Ref 'VpcId'
Tags:
- Key: Name
Value: !Sub 'DT-${release}'
NlbListener:
Type: AWS::ElasticLoadBalancingV2::Listener
Properties:
DefaultActions:
- Type: forward
TargetGroupArn: !Ref NlbTargetGroup
LoadBalancerArn: !Ref PublicNLB
Port: 7777
Protocol: TCP_UDP
Outputs:
TargetGroup:
Description: ""
Value: !Ref NlbTargetGroup
NlbDnsName:
Description: ""
Value: !GetAtt PublicNLB.DNSName