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

Error: subscription_id is a required provider property when performing a plan/apply operation #949

Open
harperaa opened this issue Sep 27, 2024 · 1 comment

Comments

@harperaa
Copy link

harperaa commented Sep 27, 2024

OS: MacOS Ventura 13.6.9
Azure terraform scripts
Latest code clone

(attack-range-py3.12) bash-5.2$ python3 attack_range.py build
...
...
│ Error: subscription_id is a required provider property when performing a plan/apply operation

│ with provider["registry.terraform.io/hashicorp/azurerm"],
│ on main.tf line 4, in provider "azurerm":
│ 4: provider "azurerm" {


2024-09-27 16:42:19,677 - INFO - attack_range - [action] > show
...

The subject error is given on a recent config and build. I looked around and found that there is a new issue with Terraform, that they are working, but the work around in the below link, adding subscription_id to the azurerm block of Main.tf worked for me... this may help someone else, until they fix it and this attack_range project may need to adjust how it is calling terraform, not sure.

hashicorp/terraform-provider-azurerm#27423

@DefinitelyNotWilko
Copy link

This is indeed a problem with the newer AzureRM Terraform Providers. I was able to get around it by updating the main.tf config for Azure to use an older version of the AzureRM Provider. In my case, 3.6.0 works great.

There is no need to hardcode the subscription_id yourself...unless you really want to :)

Filepath: terraform\azure\main.tf

Replace the contents of that file with the following:

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "~> 3.6.0"
    }
  }
}

provider "azurerm" {
  features {}
}

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

No branches or pull requests

2 participants