Terraform apply is failing although everything is correct

Terraform apply is failing although everything is correct

HI @ramch11

Please include a link to this lab.
Thanks

I found it.
It works for me.

Code

resource "local_file" "my-pet" {
    filename = "/root/pet-name"
    content = "My pet is called finnegan!!"
}

resource "random_pet" "other-pet" {
    length = 1
    prefix = "Mr"
    separator = "."
}

Then

terraform init

Then

terraform plan

output

...
Plan 2 to add, 0 to destroy
terraform apply

If it’s still saying nothing to add, then clear it out

cd /root/terraform-projects/MPL
rm -rf .terraform
rm terraform.tfstate
rm /root/pet-name

and repeat from terraform init above

If you’ve already pressed Check and it won’t let you check again, you’ll have to reset the lab.