Skip to content

Commit

Permalink
Add explicit_cache_control, bump versions, rm deprecations (#6)
Browse files Browse the repository at this point in the history
* Update page_rule.tf

* Auto Format

* Update page_rule.tf

* Auto Format

* Update healthcheck.tf

* Update main.tf

* Update versions.tf

* Update versions.tf

* Auto Format

* Update page_rule.tf

Co-authored-by: cloudpossebot <[email protected]>
Co-authored-by: nitrocode <[email protected]>
  • Loading branch information
3 people authored Sep 7, 2022
1 parent 9487f79 commit 85e7410
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 44 deletions.
1 change: 0 additions & 1 deletion .github/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ version-resolver:
- 'bugfix'
- 'bug'
- 'hotfix'
- 'no-release'
default: 'minor'

categories:
Expand Down
2 changes: 1 addition & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
":preserveSemverRanges"
],
"labels": ["auto-update"],
"dependencyDashboardAutoclose": true,
"enabledManagers": ["terraform"],
"terraform": {
"ignorePaths": ["**/context.tf", "examples/**"]
}
}

11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ Available targets:
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
| <a name="requirement_cloudflare"></a> [cloudflare](#requirement\_cloudflare) | >= 2.19 |
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.7 |
| <a name="requirement_cloudflare"></a> [cloudflare](#requirement\_cloudflare) | >= 3.23 |
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.8 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_cloudflare"></a> [cloudflare](#provider\_cloudflare) | >= 2.19 |
| <a name="provider_time"></a> [time](#provider\_time) | >= 0.7 |
| <a name="provider_cloudflare"></a> [cloudflare](#provider\_cloudflare) | >= 3.23 |
| <a name="provider_time"></a> [time](#provider\_time) | >= 0.8 |

## Modules

Expand Down Expand Up @@ -411,7 +411,7 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply

[![README Footer][readme_footer_img]][readme_footer_link]
[![Beacon][beacon]][website]

<!-- markdownlint-disable -->
[logo]: https://cloudposse.com/logo-300x69.svg
[docs]: https://cpco.io/docs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-cloudflare-zone&utm_content=docs
[website]: https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-cloudflare-zone&utm_content=website
Expand Down Expand Up @@ -442,3 +442,4 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
[share_googleplus]: https://plus.google.com/share?url=https://github.com/cloudposse/terraform-cloudflare-zone
[share_email]: mailto:?subject=terraform-cloudflare-zone&body=https://github.com/cloudposse/terraform-cloudflare-zone
[beacon]: https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/terraform-cloudflare-zone?pixel&cs=github&cm=readme&an=terraform-cloudflare-zone
<!-- markdownlint-restore -->
8 changes: 4 additions & 4 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
| <a name="requirement_cloudflare"></a> [cloudflare](#requirement\_cloudflare) | >= 2.19 |
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.7 |
| <a name="requirement_cloudflare"></a> [cloudflare](#requirement\_cloudflare) | >= 3.23 |
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.8 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_cloudflare"></a> [cloudflare](#provider\_cloudflare) | >= 2.19 |
| <a name="provider_time"></a> [time](#provider\_time) | >= 0.7 |
| <a name="provider_cloudflare"></a> [cloudflare](#provider\_cloudflare) | >= 3.23 |
| <a name="provider_time"></a> [time](#provider\_time) | >= 0.8 |

## Modules

Expand Down
7 changes: 0 additions & 7 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module "zone" {
}
]


firewall_rules = [
{
expression = "(ip.src eq 192.168.0.1)"
Expand All @@ -36,9 +35,6 @@ module "zone" {
"WEU",
"EEU"
]
notification_email_addresses = [
"[email protected]"
]
type = "TCP"
port = "22"
timeout = 10
Expand All @@ -54,9 +50,6 @@ module "zone" {
"WEU",
"EEU"
]
notification_email_addresses = [
"[email protected]"
]
type = "HTTPS"
port = "443"
timeout = 10
Expand Down
4 changes: 2 additions & 2 deletions examples/complete/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = ">= 2.19"
version = ">= 3.23"
}
time = {
source = "hashicorp/time"
version = ">= 0.7"
version = ">= 0.8"
}
}
}
40 changes: 19 additions & 21 deletions healthcheck.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,25 @@ resource "time_sleep" "wait_for_records_creation" {
resource "cloudflare_healthcheck" "default" {
for_each = local.healthchecks

zone_id = local.zone_id
name = lookup(each.value, "name", null) == null ? each.key : each.value.name
description = lookup(each.value, "description", null) == null ? "Managed by Terraform" : each.value.description
address = each.value.address
suspended = lookup(each.value, "suspended", null) == null ? false : each.value.suspended
check_regions = lookup(each.value, "check_regions", null)
notification_suspended = lookup(each.value, "notification_suspended", null) == null ? false : each.value.notification_suspended
notification_email_addresses = lookup(each.value, "notification_email_addresses", null)
type = each.value.type
port = lookup(each.value, "suspended", null) == null ? 80 : each.value.port
timeout = lookup(each.value, "timeout", null) == null ? 5 : each.value.timeout
retries = lookup(each.value, "retries", null) == null ? 3 : each.value.retries
interval = lookup(each.value, "interval", null) == null ? 60 : each.value.interval
consecutive_fails = lookup(each.value, "consecutive_fails", null) == null ? 1 : each.value.consecutive_fails
consecutive_successes = lookup(each.value, "consecutive_successes", null) == null ? 1 : each.value.consecutive_successes
method = lookup(each.value, "method", null) == null ? (each.value.type == "TCP" ? "connection_established" : "GET") : each.value.method
path = lookup(each.value, "path", null) == null ? (each.value.type == "TCP" ? null : "/") : each.value.path
expected_body = lookup(each.value, "expected_body", null)
expected_codes = lookup(each.value, "expected_codes", null) == null ? (each.value.type == "TCP" ? null : ["200"]) : each.value.expected_codes
follow_redirects = lookup(each.value, "follow_redirects", null) == null ? (each.value.type == "TCP" ? null : false) : each.value.follow_redirects
allow_insecure = lookup(each.value, "allow_insecure", null) == null ? (each.value.type == "HTTPS" ? false : null) : each.value.allow_insecure
zone_id = local.zone_id
name = lookup(each.value, "name", null) == null ? each.key : each.value.name
description = lookup(each.value, "description", null) == null ? "Managed by Terraform" : each.value.description
address = each.value.address
suspended = lookup(each.value, "suspended", null) == null ? false : each.value.suspended
check_regions = lookup(each.value, "check_regions", null)
type = each.value.type
port = lookup(each.value, "suspended", null) == null ? 80 : each.value.port
timeout = lookup(each.value, "timeout", null) == null ? 5 : each.value.timeout
retries = lookup(each.value, "retries", null) == null ? 3 : each.value.retries
interval = lookup(each.value, "interval", null) == null ? 60 : each.value.interval
consecutive_fails = lookup(each.value, "consecutive_fails", null) == null ? 1 : each.value.consecutive_fails
consecutive_successes = lookup(each.value, "consecutive_successes", null) == null ? 1 : each.value.consecutive_successes
method = lookup(each.value, "method", null) == null ? (each.value.type == "TCP" ? "connection_established" : "GET") : each.value.method
path = lookup(each.value, "path", null) == null ? (each.value.type == "TCP" ? null : "/") : each.value.path
expected_body = lookup(each.value, "expected_body", null)
expected_codes = lookup(each.value, "expected_codes", null) == null ? (each.value.type == "TCP" ? null : ["200"]) : each.value.expected_codes
follow_redirects = lookup(each.value, "follow_redirects", null) == null ? (each.value.type == "TCP" ? null : false) : each.value.follow_redirects
allow_insecure = lookup(each.value, "allow_insecure", null) == null ? (each.value.type == "HTTPS" ? false : null) : each.value.allow_insecure

dynamic "header" {
for_each = lookup(each.value, "header", null) == null ? [] : [lookup(each.value, "header", {})]
Expand Down
2 changes: 1 addition & 1 deletion page_rule.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ resource "cloudflare_page_rule" "default" {
status = lookup(each.value, "status", null)

actions {
always_online = lookup(each.value.actions, "always_online", null)
always_use_https = lookup(each.value.actions, "always_use_https", null)
automatic_https_rewrites = lookup(each.value.actions, "automatic_https_rewrites", null)
browser_cache_ttl = lookup(each.value.actions, "browser_cache_ttl", null)
Expand All @@ -30,6 +29,7 @@ resource "cloudflare_page_rule" "default" {
disable_security = lookup(each.value.actions, "disable_security", false)
edge_cache_ttl = lookup(each.value.actions, "edge_cache_ttl", null)
email_obfuscation = lookup(each.value.actions, "email_obfuscation", null)
explicit_cache_control = lookup(each.value.actions, "explicit_cache_control", null)
host_header_override = lookup(each.value.actions, "host_header_override", null)
ip_geolocation = lookup(each.value.actions, "ip_geolocation", null)
mirage = lookup(each.value.actions, "mirage", null)
Expand Down
4 changes: 2 additions & 2 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = ">= 2.19"
version = ">= 3.23"
}
time = {
source = "hashicorp/time"
version = ">= 0.7"
version = ">= 0.8"
}
}
}

0 comments on commit 85e7410

Please sign in to comment.