-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
49 lines (41 loc) · 1.37 KB
/
main.tf
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
# This is the token to communicate with the Fastly API. This was provisioned in
# advance and can be found at terraform/terraform.tfvars.
variable "fastly_api_token" {
type = "string"
}
# This is a unique value for your service in the class. This was provisioned in
# advance and can be found at terraform/terraform.tfvars.
variable "fastly_name" {
type = "string"
}
provider "fastly" {
api_key = "${var.fastly_api_token}"
}
resource "fastly_service_v1" "my-fastly-service" {
name = "${var.fastly_name}"
force_destroy = true
domain {
name = "${var.fastly_name}.fastly-altitude-2017.com"
comment = "Altitude 2017 workshop domain"
}
backend {
address = "storage.googleapis.com"
ssl_cert_hostname = "altitude-ci-cd-2017-stage.storage.googleapis.com"
ssl_sni_hostname = "altitude-ci-cd-2017-stage.storage.googleapis.com"
name = "altitude-ci-cd-2017-stage"
port = 443
first_byte_timeout = 3000
max_conn = 200
between_bytes_timeout = 1000
}
header {
name = "backend-host-override"
action = "set"
type = "request"
destination = "http.Host"
source = "\"altitude-ci-cd-2017-stage.storage.googleapis.com\""
}
}
output "address" {
value = "${var.fastly_name}.fastly-altitude-2017.com.global.prod.fastly.net/index.html"
}