Skip to content

Commit

Permalink
Add DNS host
Browse files Browse the repository at this point in the history
  • Loading branch information
benchiverton committed Jul 1, 2024
1 parent 5428c3b commit 1d3f6aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions terraform/instance/dns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ data "azurerm_dns_zone" "rockpal-co-uk"{
}

resource "azurerm_dns_cname_record" "api" {
name = var.api_dns_subdomain
name = "${var.api_dns_subdomain}.${var.dns_host}"
zone_name = data.azurerm_dns_zone.rockpal-co-uk.name
resource_group_name = data.azurerm_dns_zone.rockpal-co-uk.resource_group_name
ttl = 300
record = azurerm_container_app.api.ingress[0].fqdn
}

resource "azurerm_dns_txt_record" "api" {
name = "asuid.${var.api_dns_subdomain}"
name = "asuid.${var.api_dns_subdomain}.${var.dns_host}"
zone_name = data.azurerm_dns_zone.rockpal-co-uk.name
resource_group_name = data.azurerm_dns_zone.rockpal-co-uk.resource_group_name
ttl = 300
Expand Down
6 changes: 6 additions & 0 deletions terraform/instance/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ variable "acr_password" {
sensitive = true
}

variable "dns_host" {
type = string
description = "DNS host"
default = "rockpal.co.uk"
}

variable "website_dns_subdomain" {
type = string
description = "DNS subdomain for website"
Expand Down

0 comments on commit 1d3f6aa

Please sign in to comment.