Skip to content

Commit

Permalink
fix: resolve minor typos (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
SweetOps authored Apr 1, 2021
1 parent f6b61cb commit 55db484
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ module "zone" {
source = "cloudposse/zone/cloudflare"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
zone = "cloudposse.co"
zone = "cloudposse.co"
records = [
{
name = "bastion"
Expand Down Expand Up @@ -257,7 +257,7 @@ Are you using this project or any of our other projects? Consider [leaving a tes
Check out these related projects.

- [terraform-null-label](https://github.com/cloudposse/terraform-null-label) - Terraform Module to define a consistent naming convention by (namespace, stage, name, [attributes])
- [terraform-cloudflare-waf-rulesets](https://github.com/cloudposse/terraform-cloudflare-waf-rulesets) - %!s(<nil>)
- [terraform-cloudflare-waf-rulesets](https://github.com/cloudposse/terraform-cloudflare-waf-rulesets) - Terraform module to manage CloudFlare WAF rulesetes



Expand Down
4 changes: 2 additions & 2 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ related:
stage, name, [attributes])
url: https://github.com/cloudposse/terraform-null-label
- name: terraform-cloudflare-waf-rulesets
description:
description: Terraform module to manage CloudFlare WAF rulesetes
url: https://github.com/cloudposse/terraform-cloudflare-waf-rulesets
references:
- name: terraform-provider-cloudflare
Expand Down Expand Up @@ -72,7 +72,7 @@ usage: |-
source = "cloudposse/zone/cloudflare"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"
zone = "cloudposse.co"
zone = "cloudposse.co"
records = [
{
name = "bastion"
Expand Down
12 changes: 3 additions & 9 deletions firewall.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
locals {
firewall_rules = module.this.enabled && var.firewall_rules != null ? {
for indx, rule in flatten(var.firewall_rules) :
format("%s-%s-%s",
for rule in flatten(var.firewall_rules) :
format("%s-%s",
rule.action,
md5(rule.expression),
lookup(rule, "description", null) == null ? md5(format("Managed by Terraform #%d", indx)) : md5(rule.description),
) => rule
} : {}
}
Expand All @@ -28,10 +27,5 @@ resource "cloudflare_firewall_rule" "default" {
priority = lookup(each.value, "priority", null)
paused = lookup(each.value, "paused", null)
products = lookup(each.value, "products", null)

filter_id = [
for filter in values(cloudflare_filter.default)[*] :
filter.id
if filter.description == each.value.description
][0]
filter_id = cloudflare_filter.default[each.key].id
}
2 changes: 1 addition & 1 deletion healthcheck.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ locals {
healthchecks = module.this.enabled && var.healthchecks != null ? {
for healthcheck in flatten(var.healthchecks) :
format("%s-%s-%s",
lookup(healthcheck, "name", null) == null ? module.this.id : healthcheck.name,
lookup(healthcheck, "name", module.this.id),
healthcheck.type,
healthcheck.address
) => healthcheck
Expand Down
1 change: 1 addition & 0 deletions page_rule.tf
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ resource "cloudflare_page_rule" "default" {
include = lookup(cache_key_fields.value.query_string, "include", null)
ignore = lookup(cache_key_fields.value.query_string, "ignore", null)
}

user {
device_type = lookup(cache_key_fields.value.user, "device_type", null)
geo = lookup(cache_key_fields.value.user, "geo", null)
Expand Down
10 changes: 10 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,22 @@ variable "plan" {
type = string
description = "The name of the commercial plan to apply to the zone. Possible values: `free`, `pro`, `business`, `enterprise`"
default = "free"

validation {
condition = var.plan == null ? true : contains(["free", "pro", "business", "enterprise"], var.plan)
error_message = "Allowed values: `free`, `pro`, `business`, `enterprise`."
}
}

variable "type" {
type = string
description = "A full zone implies that DNS is hosted with Cloudflare. A `partial` zone is typically a partner-hosted zone or a CNAME setup. Possible values: `full`, `partial`."
default = "full"

validation {
condition = var.type == null ? true : contains(["full", "partial"], var.type)
error_message = "Allowed values: `full`, `partial`."
}
}

variable "argo_enabled" {
Expand Down

0 comments on commit 55db484

Please sign in to comment.