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

azurerm_key_vault_secret cannot use keyvault from another subscription within the same tenancy #4702

Closed
bikramgcnz opened this issue Oct 24, 2019 · 3 comments

Comments

@bikramgcnz
Copy link

bikramgcnz commented Oct 24, 2019

We are trying to access keyvault located in another subscription within the same tenancy, but after a recent update, vault_uri parameter has been removed that means we can no longer access keyvault secret from a uri.

We need to specify key_vault_id but this doesn't work as expected because key vault won't be in the subscription its looking for. Either vault_uri needs to be re-added or a new parameter needs to be introduced to specify subscription_id, so the engine knows its from a different subscription.

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 "+1" or "me too" comments, 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

Terraform (and AzureRM Provider) Version

Affected Resource(s)

  • azurerm_key_vault_secret

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

Debug Output

Panic Output

Expected Behavior

Actual Behavior

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@laughtonsm
Copy link

Hi.

You can actually create multiple provider blocks and alias a subscription:

provider "azurerm" {
  alias  = "keyvaultsub"
  subscription_id = "<other_subscription_id>"
}

Then try in your azurerm_key_vault_secret data source, reference the alternate provider with provider = "keyvaultsub"

@bikramgcnz
Copy link
Author

thanks @laughtonsm this works great :)

@ghost
Copy link

ghost commented Nov 30, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants