Skip to content

Commit

Permalink
Update for Nitpicks (#19)
Browse files Browse the repository at this point in the history
* updated default records and removed flatten

* Auto Format

Co-authored-by: cloudpossebot <11232728+cloudpossebot@users.noreply.github.com>
  • Loading branch information
milldr and cloudpossebot authored Oct 14, 2022
1 parent 0b2bf64 commit c606473
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/validate-codeowners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
steps:
- name: "Checkout source code at current commit"
uses: actions/checkout@v2
# Leave pinned at 0.7.1 until https://github.com/mszostok/codeowners-validator/issues/173 is resolved
- uses: mszostok/codeowners-validator@v0.7.1
if: github.event.pull_request.head.repo.full_name == github.repository
name: "Full check of CODEOWNERS"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Available targets:
| <a name="input_page_rules"></a> [page\_rules](#input\_page\_rules) | A list of maps of Page Rules. <br>The values of map is fully compliant with `cloudflare_page_rule` resource.<br>To get more info see https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/cloudflare_page_rule | `list(any)` | `null` | no |
| <a name="input_paused"></a> [paused](#input\_paused) | Whether this zone is paused (traffic bypasses Cloudflare) | `bool` | `false` | no |
| <a name="input_plan"></a> [plan](#input\_plan) | The name of the commercial plan to apply to the zone. Possible values: `free`, `pro`, `business`, `enterprise` | `string` | `"free"` | no |
| <a name="input_records"></a> [records](#input\_records) | name:<br> The name of the record.<br>type:<br> The type of the record.<br>value:<br> The value of the record.<br>ttl:<br> The TTL of the record.<br> Default value: 1.<br>priority:<br> The priority of the record. <br>proxied:<br> Whether the record gets Cloudflare's origin protection. <br> Default value: false. | `list(any)` | `null` | no |
| <a name="input_records"></a> [records](#input\_records) | name:<br> The name of the record.<br>type:<br> The type of the record.<br>value:<br> The value of the record.<br>ttl:<br> The TTL of the record.<br> Default value: 1.<br>priority:<br> The priority of the record. <br>proxied:<br> Whether the record gets Cloudflare's origin protection. <br> Default value: false. | `list(any)` | `[]` | no |
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
| <a name="input_stage"></a> [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br>Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
Expand Down
2 changes: 1 addition & 1 deletion docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
| <a name="input_page_rules"></a> [page\_rules](#input\_page\_rules) | A list of maps of Page Rules. <br>The values of map is fully compliant with `cloudflare_page_rule` resource.<br>To get more info see https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/cloudflare_page_rule | `list(any)` | `null` | no |
| <a name="input_paused"></a> [paused](#input\_paused) | Whether this zone is paused (traffic bypasses Cloudflare) | `bool` | `false` | no |
| <a name="input_plan"></a> [plan](#input\_plan) | The name of the commercial plan to apply to the zone. Possible values: `free`, `pro`, `business`, `enterprise` | `string` | `"free"` | no |
| <a name="input_records"></a> [records](#input\_records) | name:<br> The name of the record.<br>type:<br> The type of the record.<br>value:<br> The value of the record.<br>ttl:<br> The TTL of the record.<br> Default value: 1.<br>priority:<br> The priority of the record. <br>proxied:<br> Whether the record gets Cloudflare's origin protection. <br> Default value: false. | `list(any)` | `null` | no |
| <a name="input_records"></a> [records](#input\_records) | name:<br> The name of the record.<br>type:<br> The type of the record.<br>value:<br> The value of the record.<br>ttl:<br> The TTL of the record.<br> Default value: 1.<br>priority:<br> The priority of the record. <br>proxied:<br> Whether the record gets Cloudflare's origin protection. <br> Default value: false. | `list(any)` | `[]` | no |
| <a name="input_regex_replace_chars"></a> [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.<br>Characters matching the regex will be removed from the ID elements.<br>If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no |
| <a name="input_stage"></a> [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).<br>Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no |
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ locals {
records_enabled = module.this.enabled && length(var.records) > 0
zone_id = local.zone_enabled ? join("", cloudflare_zone.default.*.id) : (local.zone_exists ? lookup(data.cloudflare_zones.default[0].zones[0], "id") : null)
records = local.records_enabled ? {
for index, record in flatten(var.records) :
for index, record in var.records :
try(record.key, format("%s-%s", record.name, record.type)) => record
} : {}
}
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ variable "zone_enabled" {

variable "records" {
type = list(any)
default = null
default = []
description = <<-DOC
name:
The name of the record.
Expand Down

0 comments on commit c606473

Please sign in to comment.