Skip to content

Commit

Permalink
Add support for origin_max_http_version setting
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-feel committed Aug 8, 2022
1 parent 616196f commit 59fe46b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The main goals of this module are to simplify the creation of resources in Cloud
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.2.0, < 1.3.0 |
| <a name="requirement_cloudflare"></a> [cloudflare](#requirement\_cloudflare) | >= 3.18.0 |
| <a name="requirement_cloudflare"></a> [cloudflare](#requirement\_cloudflare) | >= 3.19.0 |

## Supported Resources

Expand Down
3 changes: 2 additions & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.2.0, < 1.3.0 |
| <a name="requirement_cloudflare"></a> [cloudflare](#requirement\_cloudflare) | >= 3.18.0 |
| <a name="requirement_cloudflare"></a> [cloudflare](#requirement\_cloudflare) | >= 3.19.0 |

## Modules

Expand Down Expand Up @@ -49,6 +49,7 @@ No modules.
| <a name="input_opportunistic_onion"></a> [opportunistic\_onion](#input\_opportunistic\_onion) | Add an Alt-Svc header to all legitimate requests from Tor, allowing the connection to use our onion services instead of exit nodes.<br>Available on the following plans: "free", "partners\_free", "pro", "partners\_pro", "business", "partners\_business", "enterprise", "partners\_enterprise".<br>Possible values: "on", "off". | `string` | `"off"` | no |
| <a name="input_orange_to_orange"></a> [orange\_to\_orange](#input\_orange\_to\_orange) | Orange to Orange (O2O) allows zones on Cloudflare to CNAME to other zones also on Cloudflare.<br>Available on the following plans: "enterprise", "partners\_enterprise".<br>Possible values: "on", "off". | `string` | `"off"` | no |
| <a name="input_origin_error_page_pass_thru"></a> [origin\_error\_page\_pass\_thru](#input\_origin\_error\_page\_pass\_thru) | Cloudflare will proxy customer error pages on any 502,504 errors on origin server instead of showing a default Cloudflare error page. This does not apply to 522 errors.<br>Available on the following plans: "enterprise", "partners\_enterprise".<br>Possible values: "on", "off". | `string` | `"off"` | no |
| <a name="input_origin_max_http_version"></a> [origin\_max\_http\_version](#input\_origin\_max\_http\_version) | The highest HTTP version Cloudflare will attempt to use with your origin. This setting allows Cloudflare to make HTTP/2 requests to your origin.<br>Note that you must contact customer support / account team to enable this setting before use, otherwise you will not be able to change it.<br>Available on the following plans: "free", "partners\_free", "pro", "partners\_pro", "business", "partners\_business", "enterprise", "partners\_enterprise".<br>Possible values: 1, 2. | `string` | `null` | no |
| <a name="input_prefetch_preload"></a> [prefetch\_preload](#input\_prefetch\_preload) | Cloudflare will prefetch any URLs that are included in the response headers.<br>Available on the following plans: "enterprise", "partners\_enterprise".<br>Possible values: "on", "off". | `string` | `"off"` | no |
| <a name="input_privacy_pass"></a> [privacy\_pass](#input\_privacy\_pass) | Privacy Pass is a browser extension developed by the Privacy Pass Team to improve the browsing experience for your visitors. Enabling Privacy Pass will reduce the number of CAPTCHAs shown to your visitors.<br>Available on the following plans: "free", "partners\_free", "pro", "partners\_pro", "business", "partners\_business", "enterprise", "partners\_enterprise".<br>Possible values: "on", "off". | `string` | `"on"` | no |
| <a name="input_response_buffering"></a> [response\_buffering](#input\_response\_buffering) | Enables or disables buffering of responses from the proxied server. Cloudflare may buffer the whole payload to deliver it at once to the client versus allowing it to be delivered in chunks. By default, the proxied server streams directly and is not buffered by Cloudflare.<br>Available on the following plans: "enterprise", "partners\_enterprise".<br>Possible values: "on", "off". | `string` | `"off"` | no |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ resource "cloudflare_zone_settings_override" "this" {
opportunistic_onion = var.opportunistic_onion
orange_to_orange = local.cloudflare_zone_settings_override_avail.orange_to_orange ? var.orange_to_orange : null
origin_error_page_pass_thru = local.cloudflare_zone_settings_override_avail.origin_error_page_pass_thru ? var.origin_error_page_pass_thru : null
origin_max_http_version = var.origin_max_http_version
# Since `polish` and `webp` are available on the same plan, it is not necessary to check if `webp` is available when `polish` is definitely available, so we can just use `var.webp` in the expression
polish = local.cloudflare_zone_settings_override_avail.polish ? (var.polish == null || var.polish == "off") && var.webp == "on" ? "lossless" : var.polish : null
prefetch_preload = local.cloudflare_zone_settings_override_avail.prefetch_preload ? var.prefetch_preload : null
Expand Down
8 changes: 8 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ variable "origin_error_page_pass_thru" {
default = "off"
}

# The default value of the setting is null, because in order to apply it, the setting must be activated through the customer support / account team and there is no way to know if it is available for change (`readonly_settings` output does not contain information about whether this setting is read-only)
# Also, the default values for Enterprise plans and other plans are different
variable "origin_max_http_version" {
type = string
description = "The highest HTTP version Cloudflare will attempt to use with your origin. This setting allows Cloudflare to make HTTP/2 requests to your origin.\nNote that you must contact customer support / account team to enable this setting before use, otherwise you will not be able to change it.\nAvailable on the following plans: \"free\", \"partners_free\", \"pro\", \"partners_pro\", \"business\", \"partners_business\", \"enterprise\", \"partners_enterprise\".\nPossible values: 1, 2."
default = null
}

variable "prefetch_preload" {
type = string
description = "Cloudflare will prefetch any URLs that are included in the response headers.\nAvailable on the following plans: \"enterprise\", \"partners_enterprise\".\nPossible values: \"on\", \"off\"."
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = ">= 3.18.0"
version = ">= 3.19.0"
}
}
}

0 comments on commit 59fe46b

Please sign in to comment.