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

missing metadata host URL on backend configurations #100

Closed
glennmusa opened this issue Mar 22, 2021 · 0 comments · Fixed by #147
Closed

missing metadata host URL on backend configurations #100

glennmusa opened this issue Mar 22, 2021 · 0 comments · Fixed by #147
Labels
bug Something isn't working

Comments

@glennmusa
Copy link
Contributor

glennmusa commented Mar 22, 2021

Description

The codebase supports specifying a different management endpoint (e.g. "management.azure.com" or "management.usgovcloudapi.net") for Terraform variables, but it does not use that endpoint to instantiate a backend.

Steps to Reproduce
Steps to reproduce the behavior:

  1. Specify a non-commercial endpoint
  2. Attempt to apply or init Terraform into a non-commercial storage account

Expected behavior
I should be able to init and apply Terraform with supported endpoints. We should pass the endpoint as a backend-config argument here:

terraform init \
-backend-config "key=${key}" \
-backend-config "resource_group_name=${tf_be_rg_name}" \
-backend-config "storage_account_name=${tf_be_sa_name}" \
-backend-config "container_name=${container_name}" \
-backend-config "environment=${environment}" \
-backend-config "tenant_id=${tenant_id}" \
-backend-config "subscription_id=${sub_id}" \
-backend-config "client_id=${client_id}" \
-backend-config "client_secret=${client_secret}"

Actual behavior
Initialization fails with Error: unable to locate metadata for environment "<envrionment name>" from the built in "public", "usgovernment", "china" and no customer metadata host has been specified

Additional context
Operating System:
Terraform Version:
Cloud (public, Azure Government, etc.):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant