-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathexample.yaml
89 lines (83 loc) · 2.67 KB
/
example.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
80
81
82
83
84
85
86
87
88
89
---
AWSTemplateFormatVersion: '2010-09-09'
Description: |
The following CloudFormation Fastly resource types allow the creation and configuration of
service level objectives, locations, monitors and metrics related to your application.
This allows kicking off monitoring of new projects simply, efficiently, and consistently.
Parameters:
DeliveryServiceName:
Type: String
Description: Name of the delivery service in Fastly
Resources:
# 1. Delivery service
DeliveryService:
Type: Fastly::Services::Service
Properties:
Name: !Ref DeliveryServiceName
# 2. Domains
UKDomain:
Type: Fastly::Services::Domain
Properties:
Name: acme.co.uk
Comment: This is a specific domain to access the ACME public webpage in the UK
ServiceId: !GetAtt DeliveryService.Id
VersionId: !GetAtt DeliveryService.LatestVersionId
ChinaDomain:
Type: Fastly::Services::Domain
Properties:
Name: acme.cn
Comment: This is a specific domain to access the ACME public webpage in China
ServiceId: !GetAtt DeliveryService.Id
VersionId: !GetAtt DeliveryService.LatestVersionId
# 3. Health checks
UKHealthcheck:
Type: Fastly::Services::Healthcheck
Properties:
ServiceId: !GetAtt DeliveryService.Id
VersionId: !GetAtt DeliveryService.LatestVersionId
Name: Heathcheck for the UK
CheckInterval: 60000
Host: !GetAtt UKDomain.DomainName
Initial: 1
Path: "/"
Threshold: 1
Timeout: 5000
Window: 2
ChinaHealthcheck:
Type: Fastly::Services::Healthcheck
Properties:
ServiceId: !GetAtt DeliveryService.Id
VersionId: !GetAtt DeliveryService.LatestVersionId
Name: Heathcheck for China (Mainland)
CheckInterval: 60000
Host: !GetAtt ChinaDomain.DomainName
Initial: 1
Path: "/"
Threshold: 1
Timeout: 5000
Window: 2
# 4. Backends
UKBackend:
Type: Fastly::Services::Backend
DependsOn: UKHealthcheck
Properties:
ServiceId: !GetAtt DeliveryService.Id
VersionId: !GetAtt DeliveryService.LatestVersionId
Name: !GetAtt UKDomain.DomainName
Address: !GetAtt UKDomain.DomainName
Port: 443
UseSsl: true
MinTlsVersion: "1.2"
Healthcheck: !GetAtt UKHealthcheck.HealthcheckName
ChinaBackend:
Type: Fastly::Services::Backend
DependsOn: ChinaHealthcheck
Properties:
ServiceId: !GetAtt DeliveryService.Id
VersionId: !GetAtt DeliveryService.LatestVersionId
Name: !GetAtt ChinaDomain.DomainName
Address: !GetAtt ChinaDomain.DomainName
Port: 443
UseSsl: true
MinTlsVersion: "1.2"
Healthcheck: !GetAtt ChinaHealthcheck.HealthcheckName