-
Notifications
You must be signed in to change notification settings - Fork 29
/
ecs-elb-appserver.yaml
81 lines (70 loc) · 2.1 KB
/
ecs-elb-appserver.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Note, This template deploys an Application Load Balancer that exposes our PHP APP services.
# Service : PHP-fpm Service listen to port 9001/9002/9003
#
---
AWSTemplateFormatVersion: "2010-09-09"
Description: >
This template deploys an Application Load Balancer that exposes our PHP APP services.
Parameters:
PMServerEnv:
Description: "Server Environment name."
ConstraintDescription: "Choose an Environment from the drop down"
Type: "String"
AllowedValues:
- "dev"
- "staging"
- "prod"
PMAPPELBSG:
Description: "Select the Security Group to use for the ELB"
Type: "AWS::EC2::SecurityGroup::Id"
PMPrivateSubnets:
Description: "Subnets to launch instances into"
Type: "List<AWS::EC2::Subnet::Id>"
PMS3Logging:
Description: "S3 Logging Bucket Name"
Type: "String"
####### Resources Setup #######
Resources:
APPLoadBalancer:
Type: "AWS::ElasticLoadBalancing::LoadBalancer"
Properties:
ConnectionDrainingPolicy:
Enabled: "true"
Timeout: "30"
CrossZone: "true"
AccessLoggingPolicy:
EmitInterval: '5'
Enabled: 'True'
S3BucketName: !Ref "PMS3Logging"
S3BucketPrefix: "ALBLogs"
HealthCheck:
HealthyThreshold: '4'
Interval: '30'
Target: "TCP:9001"
Timeout: '5'
UnhealthyThreshold: '6'
LoadBalancerName: !Sub "${PMServerEnv}-ALB"
Listeners:
- InstancePort: '9001'
InstanceProtocol: "TCP"
LoadBalancerPort: '9001'
Protocol: "TCP"
- InstancePort: '9002'
InstanceProtocol: "TCP"
LoadBalancerPort: '9002'
Protocol: "TCP"
- InstancePort: '9003'
InstanceProtocol: "TCP"
LoadBalancerPort: '9003'
Protocol: "TCP"
Scheme: "internal"
SecurityGroups:
- Ref: "PMAPPELBSG"
Subnets: !Ref "PMPrivateSubnets"
Outputs:
APPLoadBalancer:
Description: "A reference to the Application Load Balancer"
Value: !Ref "APPLoadBalancer"
APPLoadBalancerUrl:
Description: "The URL of the ALB"
Value: !GetAtt "APPLoadBalancer.DNSName"