Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (63 sloc) 2.01 KB
AWSTemplateFormatVersion: "2010-09-09"
Description: ECR repo test WM Node Test
Parameters:
EnvironmentName:
Default: staging
Description: Name of the environment this cloudformation stack belongs to
Type: String
Resources:
LoadBalancer:
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
Properties:
Name: training-aws-lb
Subnets:
- Fn::ImportValue:
!Join [":", [ !Ref EnvironmentName, "SubnetAZ1Public" ]]
- Fn::ImportValue:
!Join [ ":", [ !Ref EnvironmentName, "SubnetAZ2Public" ]]
SecurityGroups:
- !Ref LoadBalancerSecurityGroup
LoadBalancerSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Security group for loadbalancer to services on ECS
VpcId:
Fn::ImportValue:
!Join [ ":", [ !Ref EnvironmentName, "VPC" ]]
SecurityGroupIngress:
- CidrIp: 0.0.0.0/0
IpProtocol: -1
LoadBalancerListener:
Type: AWS::ElasticLoadBalancingV2::Listener
Properties:
LoadBalancerArn: !Ref LoadBalancer
Protocol: HTTP
Port: 80
DefaultActions:
- Type: forward
TargetGroupArn: !Ref DefaultTargetGroup
DefaultTargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Properties:
Name: aws-training-default
VpcId:
Fn::ImportValue:
!Join [ ":", [ !Ref EnvironmentName, "VPC" ]]
Protocol: HTTP
Port: 80
Outputs:
LoadBalancerDNS:
Description: Domain name for the loadbalancer
Value: !GetAtt LoadBalancer.DNSName
Export:
Name: !Join [':', [ !Ref EnvironmentName, TrainingDomainName ]]
LoadBalancerListener:
Description: loadbalancer listener
Value: !Ref LoadBalancerListener
Export:
Name: !Join [':', [ !Ref EnvironmentName, TrainingLoadBalancerListener ]]
LoadBalancerSecurityGroup:
Description: Loadbalancer security group
Value: !Ref LoadBalancerSecurityGroup
Export:
Name: !Join [':', [ !Ref EnvironmentName, TrainingLoadBalancerSecurityGroup ]]
You can’t perform that action at this time.