Although module path given correctly it is not recognizing

I have given module path as below, Please suggest what could be the wrong, thank you

A module is a directory… Not one file within a directory.

Hi Max,

Module is the folder i have created, could you please suggest how to fix this

I just did… You’ve incorrectly given a path to a file in your module source.

Hi Max,

I still did not get it, can you provide me path here I supposed to give, thank you

  source = "./module"

also, could you please stop using screenshots in your posts. They deny people the ability to quote text from them in responses.

HI Max,

Thanks.

Then let me know how can I share the error?

Most people will just copy/paste all relevant text, both code and errors.

Be sure to enclose sections of code or errors with ``` markers so the forum preserves their indentation.

1 Like

HI Max,

I got it, thanks

Module error is fixed.

However I see error as following:

code:

terraform {
  backend "azurerm" {
    #resource_group_name   =  AzureDevOps
    #storage_account_name  = sa3lo
    container_name        = "test1"
    key                   = "XXX"
  }
}

I have provided the key for the storage account but it is givig following error:

ERROR:

│ Error: Either an Access Key / SAS Token or the Resource Group for the Storage Account must be specified - or Azure AD Authentication must be enabled

Please suggest further, thanks for the support.

You probably meant to use access_key instead of key

terraform {
  backend "azurerm" {
    storage_account_name = "abcd1234"
    container_name       = "tfstate"
    key                  = "prod.terraform.tfstate"

    # rather than defining this inline, the Access Key can also be sourced
    # from an Environment Variable - more information is available below.
    access_key = "abcdefghijklmnopqrstuvwxyz0123456789..."
  }
}

See Backend Type: azurerm | Terraform | HashiCorp Developer

Hi Max,

THank you very much, it worked.

Could you please help how to remove lock , I tried to give force but it is not working , below error when I apply force. Please suggest further.

PS D:\TFP\TFP\terraform> terraform plan
Acquiring state lock. This may take a few moments…

│ Error: Error acquiring the state lock

│ Error message: state blob is already locked
│ Lock Info:
│ ID: e93703df-9a04-bd93-1b6e-261c6f8fb478
│ Path: test1/prod.terraform.tfstate
│ Operation: OperationTypePlan
│ Who: DESKTOP-24PTARK\kumar@DESKTOP-24PTARK
│ Version: 1.2.6
│ Created: 2023-04-08 09:20:45.416876 +0000 UTC
│ Info:


│ Terraform acquires a state lock to protect the state from being written
│ by multiple users at the same time. Please resolve the issue above and try
│ again. For most commands, you can disable locking with the “-lock=false”
│ flag, but this is not recommended.

The ID is in the message above

But please use a search engine before asking questions with such straightforward answers.

2 Likes

THank you, Reason I asked because it save lot of time and also I will get accurate answer, sure noted I will try from my end first with through R and D
Thank you max for your time on this.

But I am new to terraform, I am seeing lock is there since 30 minutes and not going further

I uploaded screenshot because it would be easy in this case as I can not share error