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

[2183] Allow 1 character custom domains length #139

Merged
merged 1 commit into from
Dec 11, 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/front_door.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ resource "azurerm_cdn_frontdoor_origin" "main" {

resource "azurerm_cdn_frontdoor_custom_domain" "main" {
for_each = toset(var.domains)
name = replace(each.key, ".", "-")
name = length(each.key) > 1 ? replace(each.key, ".", "-") : "${replace(each.key, ".", "-")}-domain"
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}"
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 @@ -40,7 +40,7 @@ No modules.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_cached_paths"></a> [cached\_paths](#input\_cached\_paths) | List of path patterns such as /packs/* that front door will cache | `list(string)` | `[]` | no |
| <a name="input_domains"></a> [domains](#input\_domains) | List of subdomains of the zone e.g. "staging". For apex domain use "apex" or "apex<something>" if apex is already in use | `any` | n/a | yes |
| <a name="input_domains"></a> [domains](#input\_domains) | List of subdomains of the zone e.g. "staging". For apex domain use "apex" or "apex<something>" if apex is already in use.<br/> The length of "<domain>.<zone>" cannot exceed 64 characters. | `any` | n/a | yes |
| <a name="input_environment"></a> [environment](#input\_environment) | n/a | `any` | n/a | yes |
| <a name="input_exclude_cnames"></a> [exclude\_cnames](#input\_exclude\_cnames) | Don't create the CNAME for this record from var.domains. We set this when we want to configure front door for a services domain that we are migrating so we do not need to wait for the certificate to validate and front door to propagate the configuration. | `list` | `[]` | no |
| <a name="input_front_door_name"></a> [front\_door\_name](#input\_front\_door\_name) | 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 @@ -3,7 +3,8 @@ variable "front_door_name" {}
variable "resource_group_name" {}
variable "domains" {
description = <<EOF
List of subdomains of the zone e.g. "staging". For apex domain use "apex" or "apex<something>" if apex is already in use
List of subdomains of the zone e.g. "staging". For apex domain use "apex" or "apex<something>" if apex is already in use.
The length of "<domain>.<zone>" cannot exceed 64 characters.
EOF
}
variable "environment" {}
Expand Down
Loading