• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

Question about Terraform writing to the .tf file based on environment

craigburmr

New member
Banned User
May 5, 2022
20
1
3
Currently, if you have an env and run the 'terraform plan' command, it will connect to the env and compare the difference between the state of your live env vs your .tf files. Afterward, it informs you of what will change to the live env based on the .tf file.

I know this is a long shot but, is there a way to check the live env and change the .tf file to reflect the live env?



For example, let's say I have an Azure resource group with no tags. Someone else went into the azure portal and added a tag. The next time I run the 'terraform plan' command, it will notice the difference and ask me if I want to apply the change (based on the .tf file)
. I wish there was a way to take the tag (that I would've removed) but add it to the .tf file. This way, they're both now in sync if it writes the tag to the .tf file.
 
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock