diff --git a/README.md b/README.md index 02d54e5..a28fbfe 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ Contains much of the logic and default configuration that exists across all offi | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0.0 | -| [fastly](#requirement\_fastly) | >= 4.1.0 | +| [fastly](#requirement\_fastly) | >= 5.7.1 | ## Providers | Name | Version | |------|---------| -| [fastly](#provider\_fastly) | >= 4.1.0 | +| [fastly](#provider\_fastly) | >= 5.7.1 | ## Modules @@ -72,6 +72,7 @@ No modules. | [max\_conn](#input\_max\_conn) | Maximum number of connections for the Backend. | `number` | `500` | no | | [min\_tls\_version](#input\_min\_tls\_version) | Minimum allowed TLS version on SSL connections to the backend. | `string` | `"1.2"` | no | | [name](#input\_name) | Name of the fastly service (defaults to hostname). | `string` | `""` | no | +| [product\_enablement](#input\_product\_enablement) | Which additional Fastly products to enable for this service. |
object({
brotli_compression = optional(bool, false)
domain_inspector = optional(bool, false)
image_optimizer = optional(bool, false)
origin_inspector = optional(bool, false)
websockets = optional(bool, false)
})
| n/a | yes | | [shield\_region](#input\_shield\_region) | Which Fastly shield region to use. Should correspond with the shield code. | `string` | n/a | yes | | [signal\_science\_host](#input\_signal\_science\_host) | Hostname to use to integrate with Signal Sciences | `string` | `""` | no | | [signal\_science\_shared\_key](#input\_signal\_science\_shared\_key) | Shared key to use when integrating with Signal Sciences | `string` | `""` | no | diff --git a/logging/fastly_globeviz.json b/logging/fastly_globeviz.json index b0ced61..8be401f 100644 --- a/logging/fastly_globeviz.json +++ b/logging/fastly_globeviz.json @@ -1,18 +1,18 @@ { - "timestamp": "%{strftime(\{"%Y-%m-%dT%H:%M:%S%z"\}, time.start)}V", - "client_ip": "%{req.http.Fastly-Client-IP}V", - "geo_country": "%{client.geo.country_name}V", - "geo_city": "%{client.geo.city}V", - "host": "%{if(req.http.Fastly-Orig-Host, req.http.Fastly-Orig-Host, req.http.Host)}V", - "url": "%{json.escape(req.url)}V", - "request_method": "%{json.escape(req.method)}V", - "request_protocol": "%{json.escape(req.proto)}V", - "request_referer": "%{json.escape(req.http.referer)}V", - "request_user_agent": "%{json.escape(req.http.User-Agent)}V", - "response_state": "%{json.escape(fastly_info.state)}V", - "response_status": %{resp.status}V, - "response_reason": %{if(resp.response, "%22"+json.escape(resp.response)+"%22", "null")}V, - "response_body_size": %{resp.body_bytes_written}V, - "fastly_server": "%{json.escape(server.identity)}V", - "fastly_is_edge": %{if(fastly.ff.visits_this_service == 0, "true", "false")}V -} \ No newline at end of file + "timestamp":"%{strftime(\{"%Y-%m-%dT%H:%M:%S%z"\}, time.start)}V", + "client_ip":"%{req.http.Fastly-Client-IP}V", + "geo_country":"%{client.geo.country_name}V", + "geo_city":"%{client.geo.city}V", + "host":"%{if(req.http.Fastly-Orig-Host, req.http.Fastly-Orig-Host, req.http.Host)}V", + "url":"%{json.escape(req.url)}V", + "request_method":"%{json.escape(req.method)}V", + "request_protocol":"%{json.escape(req.proto)}V", + "request_referer":"%{json.escape(req.http.referer)}V", + "request_user_agent":"%{json.escape(req.http.User-Agent)}V", + "response_state":"%{json.escape(fastly_info.state)}V", + "response_status":%{resp.status}V, + "response_reason":%{if(resp.response, "%22"+json.escape(resp.response)+"%22", "null")}V, + "response_body_size":%{resp.body_bytes_written}V, + "fastly_server":"%{json.escape(server.identity)}V", + "fastly_is_edge":%{if(fastly.ff.visits_this_service == 0, "true", "false")}V +} diff --git a/main.tf b/main.tf index bf1dfc6..50f4f2d 100644 --- a/main.tf +++ b/main.tf @@ -260,11 +260,11 @@ resource "fastly_service_vcl" "app_service" { # Additional products product_enablement { - brotli_compression = false - domain_inspector = false - image_optimizer = false - origin_inspector = false - websockets = false + brotli_compression = var.product_enablement.brotli_compression + domain_inspector = var.product_enablement.domain_inspector + image_optimizer = var.product_enablement.image_optimizer + origin_inspector = var.product_enablement.origin_inspector + websockets = var.product_enablement.websockets } # Support Apple Associated Domains diff --git a/variables.tf b/variables.tf index 68f8ddb..f54f929 100644 --- a/variables.tf +++ b/variables.tf @@ -185,6 +185,24 @@ variable "vcl_snippets" { default = [] } +variable "product_enablement" { + description = "Which additional Fastly products to enable for this service." + type = object({ + brotli_compression = optional(bool, false) + domain_inspector = optional(bool, false) + image_optimizer = optional(bool, false) + origin_inspector = optional(bool, false) + websockets = optional(bool, false) + }) + default = { + brotli_compression = false + domain_inspector = false + image_optimizer = false + origin_inspector = false + websockets = false + } +} + # IP block lists variable "ip_blocklist" { diff --git a/versions.tf b/versions.tf index 52b5c64..c610559 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { fastly = { source = "fastly/fastly" - version = ">= 4.1.0" + version = ">= 5.7.1" } } }