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

Azure Container App azurerm_container_app is missing the output attribute for the Application URL (fqdn) #26559

Open
1 task done
Bastien-Brd opened this issue Jul 7, 2024 · 3 comments

Comments

@Bastien-Brd
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Description

Please add something like fqdn or application_url as output attribute to azurerm_container_app.

When deploying a Azure Container App (azurerm_container_app), the only Terraform attribute in output for the app's FQDN is latest_revision_fqdn (https://registry.terraform.io/providers/hashicorp/azurerm/3.111.0/docs/resources/container_app#latest_revision_fqdn)`. This is a value of the form e.g. my-container-app--52twja6.gentleluke-8f70498d.uksouth.azurecontainerapps.io:6379. Notice the --52twja6 which corresponds to the latest revision ID.

Whereas the most useful output would be the Application URL as exposed in the Azure Portal, or the application FQDN, meaning the FQDN of the app with no mention of revision at all. This is of the form my-container-app.gentleluke-8f70498d.uksouth.azurecontainerapps.io Notice there is no mention of any revision ID here. This points to the latest revision too. But this FQDN is stable and always correct, whereas the latest revision FQDN will change everytime a new revision is created.

Please add something like fqdn or application_url as output attribute to azurerm_container_app.

New or Affected Resource(s)/Data Source(s)

azurerm_container_app

Potential Terraform Configuration

No response

References

https://registry.terraform.io/providers/hashicorp/azurerm/3.111.0/docs/resources/container_app#latest_revision_fqdn

@Bastien-Brd
Copy link
Author

Meanwhile for anyone interested I am currently using this expression in Terraform to get the application URL/FQDN I need:

replace(azurerm_container_app.main.latest_revision_fqdn, "/--.{7}/", "")

This removes the --abc1234 revision suffix from the latest revision FQDN.

@Chambras
Copy link
Contributor

This is a good suggestion @Bastien-Brd I will try to submit a PR for this.

@Bastien-Brd
Copy link
Author

Oh actually nevermind, I found what is the correct attribute that already exists: this FQDN I was looking for is actually an attribute of the ingress bock, you can get it like this:

azurerm_container_app.main.ingress[0].fqdn

I don't think there needs to be anything new added then, this issue can probably be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants