Skip to content

Commit

Permalink
Fix environment_domains linting issues
Browse files Browse the repository at this point in the history
- Fix redirect_rules default value
- Fix string interpolations
  • Loading branch information
saliceti committed Jul 2, 2024
1 parent b2bc395 commit fcf8af0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion domains/environment_domains/dns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ data "azurerm_dns_zone" "main" {

resource "azurerm_dns_txt_record" "main" {
for_each = { for k in toset(var.domains) : k => k if !startswith(k, "apex") }
name = join(".", ["_dnsauth", "${each.key}"])
name = join(".", ["_dnsauth", each.key])
zone_name = data.azurerm_dns_zone.main.name
resource_group_name = var.resource_group_name
ttl = 300
Expand Down
2 changes: 1 addition & 1 deletion domains/environment_domains/front_door.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ resource "azurerm_cdn_frontdoor_custom_domain" "main" {
name = replace(each.key, ".", "-")
cdn_frontdoor_profile_id = data.azurerm_cdn_frontdoor_profile.main.id
dns_zone_id = data.azurerm_dns_zone.main.id
host_name = startswith(each.key, "apex") ? "${var.zone}" : "${each.key}.${var.zone}"
host_name = startswith(each.key, "apex") ? var.zone : "${each.key}.${var.zone}"
tls {
certificate_type = "ManagedCertificate"
minimum_tls_version = "TLS12"
Expand Down
2 changes: 1 addition & 1 deletion domains/environment_domains/front_door_rules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resource "azurerm_cdn_frontdoor_rule" "rule" {
conditions {
host_name_condition {
operator = "Equal"
match_values = [for d in [var.redirect_rules[count.index]["from-domain"]] : startswith(d, "apex") ? "${var.zone}" : "${d}.${var.zone}"]
match_values = [for d in [var.redirect_rules[count.index]["from-domain"]] : startswith(d, "apex") ? var.zone : "${d}.${var.zone}"]
}
}

Expand Down
2 changes: 1 addition & 1 deletion domains/environment_domains/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ variable "exclude_cnames" {

variable "redirect_rules" {
nullable = false
default = {}
default = []
description = <<EOF
List of ordered redirect rules with format:
[
Expand Down

0 comments on commit fcf8af0

Please sign in to comment.