-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathASG-behind-ELB.yaml
54 lines (48 loc) · 1.37 KB
/
ASG-behind-ELB.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
AWSTemplateFormatVersion: "2010-09-09"
Description: >-
This Template creates a EC2 Auto Scaling group behind a Elastic LoadBalancer
Resources:
theloadBalancer:
Type: AWS::ElasticLoadBalancing::LoadBalancer
Properties:
LoadBalancerName: theLoadBalancer
AvailabilityZones:
- "us-east-2a"
- "us-east-2b"
- "us-east-2c"
HealthCheck:
HealthyThreshold: "2"
Interval: "10"
Target: HTTP:80/
Timeout: "4"
UnhealthyThreshold: '3'
Listeners:
- InstancePort: "80"
InstanceProtocol: HTTP
LoadBalancerPort: "443"
Protocol: HTTP
theServersLaunchTemplate:
Type: AWS::EC2::LaunchTemplate
Properties:
LaunchTemplateData:
ImageId: "ami-077e31c4939f6a2f3"
InstanceType: t2.micro
KeyName: "bbtgraphicswebsite1"
myServers:
Type: AWS::AutoScaling::AutoScalingGroup
Properties:
AutoScalingGroupName: myServers
AvailabilityZones:
- "us-east-2a"
- "us-east-2b"
- "us-east-2c"
DesiredCapacity: "2"
HealthCheckGracePeriod: 300
HealthCheckType: ELB
LaunchTemplate:
LaunchTemplateId: !Ref theServersLaunchTemplate
Version: !GetAtt theServersLaunchTemplate.LatestVersionNumber
LoadBalancerNames:
- theLoadBalancer
MaxSize: "6"
MinSize: "1"