generated from blackbird-cloud/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
80 lines (76 loc) · 3.79 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
data "cloudflare_zone" "this" {
count = var.zone_name != "" ? 1 : 0
name = var.zone_name
}
resource "cloudflare_page_rule" "page_rules" {
for_each = { for page_rule in var.page_rules : page_rule.target => page_rule }
target = each.value.target
priority = try(each.value.priority, null)
zone_id = try(each.value.zone_id, data.cloudflare_zone.this[0].id)
dynamic "actions" {
for_each = each.value.actions
content {
always_use_https = try(actions.value.always_use_https, null)
automatic_https_rewrites = try(actions.value.automatic_https_rewrites, null)
browser_cache_ttl = try(actions.value.browser_cache_ttl, null)
browser_check = try(actions.value.browser_check, null)
bypass_cache_on_cookie = try(actions.value.bypass_cache_on_cookie, null)
cache_by_device_type = try(actions.value.cache_by_device_type, null)
cache_deception_armor = try(actions.value.cache_deception_armor, null)
cache_level = try(actions.value.cache_level, null)
cache_on_cookie = try(actions.value.cache_on_cookie, null)
disable_apps = try(actions.value.disable_apps, null)
disable_performance = try(actions.value.disable_performance, null)
disable_railgun = try(actions.value.disable_railgun, null)
disable_security = try(actions.value.disable_security, null)
disable_zaraz = try(actions.value.disable_zaraz, null)
edge_cache_ttl = try(actions.value.edge_cache_ttl, null)
email_obfuscation = try(actions.value.email_obfuscation, null)
explicit_cache_control = try(actions.value.explicit_cache_control, null)
host_header_override = try(actions.value.host_header_override, null)
ip_geolocation = try(actions.value.ip_geolocation, null)
mirage = try(actions.value.mirage, null)
opportunistic_encryption = try(actions.value.opportunistic_encryption, null)
origin_error_page_pass_thru = try(actions.value.origin_error_page_pass_thru, null)
polish = try(actions.value.polish, null)
resolve_override = try(actions.value.resolve_override, null)
respect_strong_etag = try(actions.value.respect_strong_etag, null)
response_buffering = try(actions.value.response_buffering, null)
rocket_loader = try(actions.value.rocket_loader, null)
security_level = try(actions.value.security_level, null)
server_side_exclude = try(actions.value.server_side_exclude, null)
sort_query_string_for_cache = try(actions.value.sort_query_string_for_cache, null)
ssl = try(actions.value.ssl, null)
true_client_ip_header = try(actions.value.true_client_ip_header, null)
waf = try(actions.value.waf, null)
dynamic "forwarding_url" {
for_each = try(actions.value.forwarding_url, [])
content {
url = forwarding_url.value.url
status_code = forwarding_url.value.status_code
}
}
# TODO
# dynamic "cache_key_fields" {
# for_each = try(actions.value.cache_key_fields, [])
# content = {
# }
# }
dynamic "cache_ttl_by_status" {
for_each = try(actions.value.cache_ttl_by_status, [])
content {
codes = cache_ttl_by_status.value.codes
ttl = cache_ttl_by_status.value.ttl
}
}
dynamic "minify" {
for_each = try(actions.value.minify, [])
content {
html = minify.value.html
css = minify.value.css
js = minify.value.js
}
}
}
}
}