Open daveinci opened 7 months ago
Thanks for this submission! Changes to the AzureRM backend are managed by the AzureRM Provider maintainer team, who have been alerted.
If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions. Thanks again!
@daveinci Thanks for reporting this. The Azure backend needs to be updated to the latest SDKs to take advantage of various bugfixes including those for custom clouds. I'm working on this at the moment and this should be fixed in an upcoming minor Terraform release.
Thanks, @manicminer. Any update on which release we can expect this in?
@daveinci would this also resolve the backend being unable to find "ussec" as an environment? At this point we are able to terraform resources in an USSec (microsoft.scloud) environment without any issues, except for being unable to set a backend for our states in an storage account within this sub... We've tried all methods but the backend always throws an "environment not found: ussec" when running an init... it's as if the backend expects only whatever cloud environments it currently has hardcoded (public, china, germany (I believe), azusgovernment)....
Would love to know if this SDK update would also cover adding ussec to the list of envs!
@jazcto86 Yes it would resolve that too. The backend is currently using a now-outdated SDK and, once updated/refactored, it will support non-public clouds just as the provider now does (i.e. via the metadata_host
property).
At that time - and also currently for both AzureRM and AzureAD providers - you only need to specify the metadata_host
property / ARM_METADATA_HOSTNAME
environment variable. The environment
property / ARM_ENVIRONMENT
env var is ignored, so you can remove that from your config when using a custom metadata service.
👋 @manicminer Is there any update on this issue? Has this been fixed?
No updates, as far as I know it has not been fixed (it would be linked to a pull request that fixes the issue in that case).
Terraform Version
Terraform Configuration Files
Debug Output
https://gist.github.com/daveinci/de6cc4e24c4fe6f2998e3ce6ccf9ce8e
Expected Behavior
Terraform should be utilizing the endpoints associated to the metadata_host value which indicates a custom cloud environment is being used. In this case, should be using login.microsoftonline.us and blob.core.usgovcloudapi.net
Actual Behavior
Terraform defaulted to the public endpoints for login and storage, ignoring the metadata_host value. This is similar to behavior seen in the azurerm and azuread providers that @manicminer fixed in v3.99.0
https://github.com/hashicorp/terraform-provider-azurerm/pull/25546 https://github.com/hashicorp/terraform-provider-azuread/pull/1353
Steps to Reproduce
Additional Context
No response
References
https://github.com/hashicorp/terraform-provider-azurerm/pull/25546 https://github.com/hashicorp/terraform-provider-azuread/pull/1353