Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1750] Fix environment_domains linting issues #108

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/tfdocs.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ No modules.
| <a name="input_host_name"></a> [host\_name](#input\_host\_name) | Origin host name ie domain to where front door sends the requests. It may not be used if all requests are redirected. | `string` | `"not-in-use.education.gov.uk"` | no |
| <a name="input_multiple_hosted_zones"></a> [multiple\_hosted\_zones](#input\_multiple\_hosted\_zones) | n/a | `bool` | `false` | no |
| <a name="input_null_host_header"></a> [null\_host\_header](#input\_null\_host\_header) | The origin\_host\_header for the azurerm\_cdn\_frontdoor\_origin resource will be var.host\_name (if false) or null (if true). If null then the host name from the incoming request will be used. | `bool` | `false` | no |
| <a name="input_redirect_rules"></a> [redirect\_rules](#input\_redirect\_rules) | List of ordered redirect rules with format:<br> [<br> {<br> "from-domain": "One of the domains from var.domains to redirect from",<br> "to-domain": "Redirect destination domain",<br> "to-path": "Optional path appended to the destination URL. If not provided, the path will be the same as in the incoming request",<br> "to-query-string": "Optional path appended to the destination URL. If not provided, defaults to empty string"<br> },<br> {<br> ...<br> }<br> ] | `map` | `{}` | no |
| <a name="input_redirect_rules"></a> [redirect\_rules](#input\_redirect\_rules) | List of ordered redirect rules with format:<br> [<br> {<br> "from-domain": "One of the domains from var.domains to redirect from",<br> "to-domain": "Redirect destination domain",<br> "to-path": "Optional path appended to the destination URL. If not provided, the path will be the same as in the incoming request",<br> "to-query-string": "Optional path appended to the destination URL. If not provided, defaults to empty string"<br> },<br> {<br> ...<br> }<br> ] | `list(any)` | `[]` | no |
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | n/a | `any` | n/a | yes |
| <a name="input_rule_set_ids"></a> [rule\_set\_ids](#input\_rule\_set\_ids) | n/a | `list(any)` | `[]` | no |
| <a name="input_zone"></a> [zone](#input\_zone) | n/a | `any` | n/a | yes |
Expand Down
3 changes: 2 additions & 1 deletion domains/environment_domains/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ variable "exclude_cnames" {
}

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