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

feature request output hostname of azurerm_cdn_endpoint #15144

Closed
dc232 opened this issue Jan 27, 2022 · 6 comments
Closed

feature request output hostname of azurerm_cdn_endpoint #15144

dc232 opened this issue Jan 27, 2022 · 6 comments

Comments

@dc232
Copy link

dc232 commented Jan 27, 2022

Description

Add ability to export hostname from azure cdn endpoint hostname via output currently there doesn't seem to be a good way to do this current methods suggest (assuming azurerm_cdn_profile is defined)

resource "azurerm_cdn_endpoint" "example" {
  name                = var.cdn_endpoint_name
  profile_name        = azurerm_cdn_profile.example.name
  location            = "global"
}

then outputting

output "static_website_cdn_endpoint_hostname" {
  value       = azurerm_cdn_endpoint.example.name
  description = "CDN endpoint URL for Static website"
}

however, if we were to parse an argument into Cloudflare to create CNAME record to allow us to create a custom domain it would result in

│ Error: failed to create DNS record: HTTP status 400: DNS Validation Error (1004)

whilst there does seem to be an attribute called host_name as shown below

output "static_website_cdn_endpoint_hostname" {
  value       = azurerm_cdn_endpoint.example.host_name
}

it's not very clear as to what hostname it's outputting

The ideal one for Cloudflare would be along these lines

$test_var=(az cdn profile list -g test --query [].name -o tsv)
az cdn endpoint list -g test  --profile-name $test_var --query [].hostName -o tsv

to produce the needed Cloudflare CNAME to create a custom domain

az cdn endpoint list -g test  --profile-name $test_var --query [].hostName -o tsv
testingendpont.azureedge.net

New or Affected Resource(s)

affected resource would be
azurerm_cdn_endpoint

Can't think of a decent terraform config at the moment and it's not very good practice to use local-exec commands however there probably a better solution, open to suggestion

@tombuildsstuff
Copy link
Contributor

hi @dc232

Thanks for opening this issue.

As you've mentioned the field host_name is available which (I'd agree is unclear) does contain the FQDN here (e.g. {contoso}.azureedge.net) - so it could be worth renaming this in 3.0 to fqdn instead of host_name to make this clearer.

Thanks!

@tombuildsstuff tombuildsstuff added this to the v3.0.0 milestone Jan 27, 2022
@dc232
Copy link
Author

dc232 commented Jan 27, 2022

Ah I see thanks for the speedy reply @tombuildsstuff

@katbyte katbyte modified the milestones: v3.0.0, v3.1.0 Mar 23, 2022
@katbyte katbyte modified the milestones: v3.1.0, v3.2.0 Apr 7, 2022
@katbyte katbyte modified the milestones: v3.2.0, v3.3.0 Apr 14, 2022
@katbyte katbyte modified the milestones: v3.3.0, v3.4.0 Apr 22, 2022
@github-actions
Copy link

This functionality has been released in v3.4.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@katbyte katbyte modified the milestones: v3.4.0, v3.5.0, v3.6.0 Apr 29, 2022
@tombuildsstuff tombuildsstuff modified the milestones: v3.6.0, v3.7.0 May 17, 2022
@katbyte katbyte modified the milestones: v3.7.0, v3.8.0 May 20, 2022
@tombuildsstuff tombuildsstuff modified the milestones: v3.8.0, v3.9.0, v3.10.0 May 30, 2022
@tombuildsstuff tombuildsstuff removed this from the v3.10.0 milestone Jun 10, 2022
@tombuildsstuff tombuildsstuff added this to the v3.15.0 milestone Jul 15, 2022
@tombuildsstuff tombuildsstuff modified the milestones: v3.15.0, v3.16.0, v3.17.0 Jul 25, 2022
@katbyte katbyte modified the milestones: v3.17.0, v3.18.0, v3.19.0 Aug 5, 2022
@katbyte katbyte modified the milestones: v3.19.0, v3.20.0, v3.21.0 Aug 23, 2022
@katbyte katbyte modified the milestones: v3.21.0, v3.22.0, v3.23.0 Sep 2, 2022
@katbyte katbyte modified the milestones: v3.23.0, v3.24.0, v3.25.0 Sep 16, 2022
@katbyte katbyte modified the milestones: v3.25.0, v3.26.0, v3.27..0 Sep 30, 2022
@tombuildsstuff
Copy link
Contributor

Closing since per this comment this was released in v3.4.0

@github-actions
Copy link

This functionality has been released in v3.27.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants