Skip to content

Commit

Permalink
remove a record add certificate binding
Browse files Browse the repository at this point in the history
  • Loading branch information
madsrodal committed Sep 11, 2024
1 parent 37c6e53 commit 62ce495
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
1 change: 0 additions & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ module "dns" {
dns_prefix = "preview"
resource_group_name = azurerm_resource_group.imo_app.name
container_app_id = module.frontend.container_app_id
frontend_outbound_ip_addresses = module.frontend.outbound_ip_addresses
frontend_fqdn = module.frontend.fqdn
custom_domain_verification_id = module.frontend.custom_domain_verification_id
}
13 changes: 3 additions & 10 deletions terraform/modules/dns/frontend.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
resource "azurerm_dns_a_record" "frontend" {
name = "@"
zone_name = var.dns_zone_name
resource_group_name = var.dns_resource_group_name
ttl = 3600
records = var.frontend_outbound_ip_addresses
}

resource "azurerm_dns_cname_record" "frontend" {
name = var.dns_prefix
zone_name = var.dns_zone_name
Expand All @@ -26,8 +18,9 @@ resource "azurerm_dns_txt_record" "frontend" {
}

resource "azurerm_container_app_custom_domain" "frontend" {
name = trimprefix(azurerm_dns_txt_record.frontend.fqdn, "asuid.")
container_app_id = var.container_app_id
name = trimprefix(azurerm_dns_txt_record.frontend.fqdn, "asuid.")
container_app_id = var.container_app_id
certificate_binding_type = "SniEnabled"

lifecycle {
ignore_changes = [certificate_binding_type, container_app_environment_certificate_id]
Expand Down
4 changes: 0 additions & 4 deletions terraform/modules/dns/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ variable "container_app_id" {
type = string
}

variable "frontend_outbound_ip_addresses" {
type = list(string)
}

variable "frontend_fqdn" {
type = string
}
Expand Down
4 changes: 0 additions & 4 deletions terraform/modules/frontend/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ output "container_app_id" {
value = azurerm_container_app.frontend.id
}

output "outbound_ip_addresses" {
value = azurerm_container_app.frontend.outbound_ip_addresses
}

output "fqdn" {
value = azurerm_container_app.frontend.ingress[0].fqdn
}
Expand Down

0 comments on commit 62ce495

Please sign in to comment.