Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
81 lines (70 sloc) 2.1 KB
# 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"
You can’t perform that action at this time.