Skip to content

Commit

Permalink
Better Front Door and Private Link integration due to module outputs (#…
Browse files Browse the repository at this point in the history
…20)

* default_domain, container_app_fqdn and container_app_uri to outputs

* add default_domain to outputs to determine internal
  loadbalancer IP for Private Link Service integration

* rename container_app_fqdn to container_app_uri and make
  container_app_fqdn a real FQDN
  The actual fqdn is in fact a URI, which can't be used as
  Front Door Origin, as it requires a bare FQDN.

* Update outputs.tf

* Update versions.tf

---------

Co-authored-by: lonegunmanb <[email protected]>
  • Loading branch information
icklsede and lonegunmanb authored Nov 18, 2024
1 parent 8075ed0 commit a4104e1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions examples/acr/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
output "app_url" {
value = module.container_apps.container_app_uri
}
ouput "app_fqdn" {
value = module.container_apps.container_app_fqdn
}
output "default_domain" {
value = module.container_apps.default_domain
}
10 changes: 10 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ output "container_app_environment_id" {

output "container_app_fqdn" {
description = "The FQDN of the Container App's ingress."
value = { for name, container in azurerm_container_app.container_app : name => "${try(container.ingress[0].fqdn, "")}" if can(container.ingress[0].fqdn) }
}

output "container_app_uri" {
description = "The URI of the Container App's ingress."
value = { for name, container in azurerm_container_app.container_app : name => "https://${try(container.ingress[0].fqdn, "")}" if can(container.ingress[0].fqdn) }
}

Expand All @@ -22,3 +27,8 @@ output "container_app_ips" {
description = "The IPs of the Latest Revision of the Container App."
value = try(azurerm_container_app_environment.container_env[0].static_ip_address, data.azurerm_container_app_environment.container_env[0].static_ip_address)
}

output "default_domain" {
description = "The default domain of the Container App Environment."
value = azurerm_container_app_environment.container_env.default_domain
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ terraform {
version = ">= 3.98, < 4.0"
}
}
}
}

0 comments on commit a4104e1

Please sign in to comment.