How do I remove old variables from a Terraform project?

Hi all.

I started to plan a terraform deployment, and because there were options defined in the variables.tf file, it prompted me to enter variables (or enter to use the default), however I was then given a Terraform tfvars variables file which turned out to be malformed and skipped defining important values.

So, now I just want to run the plan again and have it prompt me for variables as it originally did.

I destroyed the original deployment. Then I removed the old .terraform folder and lock files and the malformed tfvars file.

However, when I re-run the terraform plan or apply, it just goes and redeploys with all of the old variables that are no longer defined in the project. Where is it getting these variables from?

Terraform does not store your interactively entered values, so you must have a file or environment variable that is still defining these values.

I appreciate that viewpoint, however if I grep the filesystem for the project, none of the files contain the values used that are showing in the output when the project redeploys to Azure or even before that when I run a Terraform plan.

On the otherhand, if I download the project again from the source repo and run it, it does prompt me for inputs again, however it also throws some additional errors telling me I need to delete existing resources first, even when all resources have already been destroyed.

I think we need to see some copy/paste of exact command lines run and the resulting output - the textual summary of what is happening isn’t conveying enough detail to spot clues.