Basic infrastructure stack
Infrastructure parameter fixes Implement working infrastructure stack in ECS
This commit is contained in:
67
infrastructure/cloudformation/dt/load_balancing.yaml
Normal file
67
infrastructure/cloudformation/dt/load_balancing.yaml
Normal file
@ -0,0 +1,67 @@
|
||||
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
|
Reference in New Issue
Block a user