Aswin kumar
Aswin kumar

Reputation: 91

When I run terraform plan there is no response, it keeps running

I just created azure account and tried to create resource group using terraform, I provided sub.id, tenant_id, client_id and client_secret. But after terraform init and validate, terraform plan is not responding, will it take long time, should I need to wait or Is it an error?

I tried with gitbash terminal and powershell terminal and I tried with different local directories, it gives the same response. Refer the screenshot here.

Upvotes: 0

Views: 1387

Answers (2)

RSW
RSW

Reputation: 1386

Most probably its due Microsoft Provider(s) not registered. You can either register a provider or set flag skip_provider_registration.

provider "azurerm" {
  skip_provider_registration = true
}

Register a provider, if not already:

Register-AzResourceProvider -ProviderNamespace Microsoft.Network

Note: As of azurerm 4.x release, this property is replaced with a resource_provider_registrations flag which you can set to none if you want the old behavior.

Upvotes: 1

Sha Md. Nayeem
Sha Md. Nayeem

Reputation: 1

this indicates a potential issue or delay in the execution though it is difficult to find out the exact reason without more information.

Please check the below steps in case any of these will help:

  1. Use this command to enable commands with the debug flag. It will enable debug logging. I think this will provide more information on what Terraform is doing and where it gets stuck.
export TF_LOG=DEBUG 
terraform plan
  1. Also, double-check check you have proper permissions to create a resource group.
  2. Sometimes there might be some network issues or slow Azure API responses and due to that Terraform behaves like it's hanging. Please try adding some timeout.
terraform plan -timeout=2m

Upvotes: 0

Related Questions