-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Unable to bind trusted_root_certificate with backend_http_settings for "azurerm_application_gateway" #4502
Comments
I think there are two problems:
|
@egorchabala I didn't have an issue uploading the certificate when it was encoded in PEM format. But I agree I have not found a solution for 1 and it's good to get independent verification from something else. I think it is possible to workaround this with a provisioner where we wrap up the Azure RM CLI commands to add the root certificate name to the backend http settings. |
For 1 have you tried to combine the root, any intermediate cert and the cert in the same file? |
@LaurentLesle I don't think that solves problem 1 because we are specifically trying to solve the problem of ensuring that the trusted_root_certificate is honored by the backend_http_settings. The frontend SSL cert already contains the full cert chain because you are uploading a PKCS12 file that has the full chain + cert & key. @egorchabala tagging you in case you would benefit from this workaround. The workaround I have come up with until the provider supports this scenarios is to add two null resources to my terraform plan:
I used the current time as a trigger to ensure that the null resources are always executed when I apply changes; that's probably not needed for most scenarios but for testing out the solution it worked well as I could verify the changes applied correctly by deleting the binding in the Azure portal and re-running my plan. |
Even with the worth around, there are a few points that make this less then ideal for an "always on" application gateway.
|
@runecalico Definitely agree this workaround has multiple disadvantages; shelling out to OpenSSL is definitely not an ideal solution. For point 2, I'm not sure; it seems the provider should be able to handle it. I'm encouraged that this was marked as a bug so hopefully there will be a solution soon! |
…ettings, possible fix for hashicorp#4502
I think I came up with a solution for this, see the PR above. |
Thanks for letting me know; following the PR. |
Since this issue seems to have been addressed in the latest versions of the provider - I'm going to close it. Please open a new updated bug report if this is still relevant. Thank you. |
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. |
Community Note
Terraform (and AzureRM Provider) Version
Terraform v0.12.9
Affected Resource(s)
"azurerm_application_gateway"
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
I expected that the trusted root certificate I had uploaded would be associated with backend_http_settings as a trusted certificate so that the StandardV2 Azure App Gateway would properly establish HTTPS connections with my backend that are using certs issued by my private CA.
Actual Behavior
No errors were returned, but when I look at the Azure App Gateway export template for the backend http settings that were created I can clearly see that the root certificate is not associated with the settings.
Note that when I used the Azure portal to manually create a backend I can associate the root certificate that I created with trusted_root_certificate with the backend http settings as shown here:
Steps to Reproduce
terraform apply
Important Factoids
None
References
It appears the trusted_root_certificate property was added via this request #4206 to specifically address the exact problem I'm trying to solve reported here #3115 but it seems like the solution is not quite complete unless we can specifically associate the uploaded root with the backend_http_settings.
The text was updated successfully, but these errors were encountered: