-
Notifications
You must be signed in to change notification settings - Fork 5
/
test-load-balancer.yaml
62 lines (50 loc) · 1.32 KB
/
test-load-balancer.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Description: >
Create Application Load Balancer resources for Deployment on ECS.
Parameters:
VpcId:
Type: String
VpcCIDR:
Type: String
Subnet1:
Type: AWS::EC2::Subnet::Id
Subnet2:
Type: AWS::EC2::Subnet::Id
Name:
Type: String
Resources:
SecurityGroup:
Type: "AWS::EC2::SecurityGroup"
Properties:
GroupDescription: !Sub ${AWS::StackName}-alb
SecurityGroupIngress:
- CidrIp: "0.0.0.0/0"
IpProtocol: "TCP"
FromPort: 443
ToPort: 443
- CidrIp: "0.0.0.0/0"
# Change above to !Ref VpcCIDR, if you want to restrict the beta version of the traffic to VPC CIDRs only
IpProtocol: "TCP"
FromPort: 8443
ToPort: 8443
VpcId: !Ref VpcId
LoadBalancer:
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
Properties:
Name: !Ref Name
Subnets:
- !Ref Subnet1
- !Ref Subnet2
SecurityGroups:
- !Ref SecurityGroup
Outputs:
ServiceUrl:
Description: URL of the load balancer for the sample service.
Value: !Sub http://${LoadBalancer.DNSName}
SecurityGroup:
Value: !Ref SecurityGroup
LoadBalancerArn:
Value: !Ref LoadBalancer
CanonicalHostedZoneID:
Value: !GetAtt LoadBalancer.CanonicalHostedZoneID
DNSName:
Value: !GetAtt LoadBalancer.DNSName