Skip to content

Commit

Permalink
PLT-977 fixed lint errors and updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
vselcuk committed Oct 22, 2024
1 parent 72d30a4 commit 12a5447
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion data.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
data "cloudflare_zone" "this" {
for_each = { for d, p in local.domain_validation_providers : d => p if p.provider == "cloudflare" }
name = each.value.zone_domain
name = each.value.zone_domain
}
5 changes: 1 addition & 4 deletions examples/san/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ module "this" {
source = "../../"

cloudflare_api_token = var.cloudflare_api_token

zone_name = var.domain_name
domain_name = "test-san.${var.domain_name}"

domain_name = "test-san.${var.domain_name}"
subject_alternative_names = [
["subdomain.test-san.${var.domain_name}", "cloudflare"],
["test-other.${var.domain_name}", "cloudflare"]
Expand Down
4 changes: 1 addition & 3 deletions examples/simple/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ module "this" {
source = "../../"

cloudflare_api_token = var.cloudflare_api_token

zone_name = var.domain_name
domain_name = "test.${var.domain_name}"
domain_name = "test.${var.domain_name}"
}
5 changes: 1 addition & 4 deletions locals.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
locals {
# Creates a map of domains and their dns providers
domain_validation_providers = {
for v in concat([
[var.domain_name, var.dns_validation_provider]
], var.subject_alternative_names) : v[0] => {
provider = v[1]
for v in concat([[var.domain_name, var.dns_validation_provider]], var.subject_alternative_names) : v[0] => { provider = v[1]
# if condition to check the root domain; flaconi.de vs www.flaconi.de
zone_domain = length(split(".", v[0])) == 2 ? v[0] : regex("^.+\\.(.+\\..+)$", v[0])[0]
}
Expand Down

0 comments on commit 12a5447

Please sign in to comment.