-
Notifications
You must be signed in to change notification settings - Fork 142
/
Copy pathmain.tf
220 lines (193 loc) · 5.67 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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
terraform {
required_providers {
fastly = {
source = "fastly/fastly"
version = ">1.0.0"
}
}
}
resource "fastly_service_vcl" "interface-test-project" {
activate = true
comment = "Fastly Terraform Provider: Interface Test Suite"
default_host = "interface-test-project.fastly-terraform.com"
default_ttl = 3600
force_destroy = true # Omitted `reuse` as it conflicts
http3 = false
name = "interface-test-project"
stale_if_error = false
stale_if_error_ttl = 43200
version_comment = "Fastly Terraform Provider: Version comment example"
acl {
name = "test_acl"
}
backend {
address = "127.0.0.1"
name = "test_backend"
port = 80
}
cache_setting {
action = "restart"
cache_condition = "test_cache_condition"
name = "cache_backend"
stale_ttl = 1600
ttl = 300
}
condition {
name = "test_cache_condition"
priority = 20
statement = "req.url ~ \"^/cache/\""
type = "CACHE"
}
condition {
name = "test_prefetch_condition"
priority = 15
statement = "req.url~+\"index.html\""
type = "PREFETCH"
}
condition {
name = "test_req_condition"
priority = 5
statement = "req.url ~ \"^/foo/bar$\""
type = "REQUEST"
}
# Required for `waf` to work with no diff (see waf test file for details).
condition {
name = "test_req_condition_ALWAYS_FALSE"
priority = 10
statement = "!req.url"
type = "REQUEST"
}
condition {
name = "test_res_condition"
priority = 10
statement = "resp.status == 404"
type = "RESPONSE"
}
dictionary {
name = "test_dictionary"
}
director {
backends = ["test_backend"]
name = "test_director"
}
domain {
comment = "demo"
name = "interface-test-project.fastly-terraform.com"
}
dynamicsnippet {
name = "test_dynamicsnippet"
priority = 110
type = "recv"
}
gzip {
content_types = ["application/x-javascript", "text/javascript"]
extensions = ["css"]
name = "all"
}
header {
cache_condition = "test_cache_condition"
request_condition = "test_req_condition"
response_condition = "test_res_condition"
action = "set"
destination = "http.server-name"
name = "test_header"
source = "server.identity"
type = "request"
}
healthcheck {
check_interval = 4500
expected_response = 404
headers = ["Beep: Boop"]
host = "example.com"
http_version = "1.0"
initial = 1
method = "POST"
name = "test_healthcheck"
path = "/test.txt"
threshold = 4
timeout = 4000
window = 10
}
logging_bigquery {
account_name = "testloggingbigqueryaccountname"
dataset = "test_logging_bigquery_dataset"
email = "test_logging_bigquery@example.com"
name = "test_logging_bigquery"
project_id = "example-gcp-project"
secret_key = "<SECRET_KEY>"
table = "test_logging_bigquery_table"
template = "test_logging_bigquery_template"
}
product_enablement {
bot_management = false
brotli_compression = true
domain_inspector = false
image_optimizer = false
origin_inspector = false
websockets = false
}
rate_limiter {
action = "response"
client_key = "req.http.Fastly-Client-IP,req.http.User-Agent"
feature_revision = 1
http_methods = "POST,PUT,PATCH,DELETE"
logger_type = "bigquery"
name = "test_rate_limiter"
penalty_box_duration = 30
response {
content = "test_rate_limiter_content"
content_type = "plain/text"
status = 429
}
response_object_name = "test_rate_limiter_response_object"
rps_limit = 10
# uri_dictionary_name = "test_dictionary" # Omitted as dictionary needs to exist before this is executed
window_size = 60
}
request_setting {
action = "pass"
bypass_busy_wait = true
default_host = "interface-test-project.fastly-terraform.com"
force_miss = true
force_ssl = false
geo_headers = false # DEPRECATED
hash_keys = "req.url.path, req.http.host" # Omitted because of error... Syntax error: Expected string variable or constant
max_stale_age = "300"
name = "test_request_setting"
request_condition = "test_req_condition"
timer_support = true
xff = "append"
}
response_object {
cache_condition = "test_cache_condition"
content = "test content"
content_type = "text/html"
name = "test_response_object"
request_condition = "test_req_condition"
response = "OK"
status = 200
}
response_object {
content = "content"
name = "test_response_object_waf"
request_condition = "test_req_condition_ALWAYS_FALSE"
response = "Forbidden"
status = "403"
}
snippet {
content = "if ( req.url ) { set req.http.different-header = \"true\"; }"
name = "recv_test"
priority = 110
type = "recv"
}
vcl {
content = "# some vcl here"
main = true
name = "test_vcl"
}
waf {
disabled = false
prefetch_condition = "test_prefetch_condition"
response_object = "test_response_object_waf"
}
}