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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialization of azurerm for Management Groups #11989

Open
schwarzzz opened this issue May 27, 2021 · 1 comment
Open

Initialization of azurerm for Management Groups #11989

schwarzzz opened this issue May 27, 2021 · 1 comment

Comments

@schwarzzz
Copy link

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

Description

The azurerm provider requires a subscription_id argument (or a respective environment variable). However, not all resources provided by azurerm are actually scoped within a subscription (e.g. azurerm_management_group).

I have a Terraform configuration that is bootstrapping the initial management group structure of an organization. This configuration creates Management Group structure's only. However, I cannot initialize the azurerm provider without providing a subscription Id - which I don't have (, yet).

New or Affected Resource(s)

  • azurerm

Potential Terraform Configuration

Add a new argument management_group_name and make either management_group_name or subscription_id mandatory.
If subscription_id is not set, the creation of resources scoped within a subscription should fail.

provider "azurerm" {
  tenant_id = "..."
  management_group_name = "..."
  ...
}
# 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.

References

  • #0000
@schwarzzz schwarzzz changed the title Support for [thing] Initialization of azurerm for Management Groups May 27, 2021
@favoretti
Copy link
Collaborator

Hi there and thank you for reporting this. I'll share my view on the topic here and let people with more clue on this either confirm or deny, but this is a bit of a chicken and egg thing. Unfortunately subscription ID is a config parameter provider can not work without. It's being used all over the place to construct resource IDs for virtually everything.

My best bet here - you'll have to create your first sub by hand and import it into the state.

I don't think we'll be able to initialize provider without subscription ID.

// cc @jackofallops

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants