Terraform Azure - No changes. Your infrastructure matches the configuration

46 Views Asked by At

im using the Azure free trial account to run terraform commands via visual studio. I have installed Azure CLI and I can perform the authentication successfully. However, what I put code to create new resource & use Terraform plan then it just gives "No changes. Your infrastructure matches the configuration." msg and nothing happens.

[Screenshot](https://i.stack.imgur.center image description hereom/noWHm.png)

it should give the 1 add resource

1

There are 1 best solutions below

0
Vinay B On

Terraform infrastructure doesn't match the configuration files Issue.

The message "No changes. Your infrastructure matches the configuration" typically means that the current state of your infrastructure, as known by Terraform, is the same as the configuration defined in your .tf files.

But in the next step when you run the terraform show it is showing as no state. Which only happens when accidental deletion or removal of state file from your local directory which happens after running terraform plan command.

In the Initial steps:

step 1: enter image description here

step 2: run the command terraform plan:

enter image description here

step 3: If the state file exists in local and runs the command terraform show:

enter image description here

enter image description here

step 4: when the state file removed accidentally or removed

enter image description here

And when I run the command terraform show

enter image description here

you can confirm the existence of .tfstate file using ls command

enter image description here