dtan4 / terraforming

Export existing AWS resources to Terraform style (tf, tfstate) / No longer actively maintained
http://terraforming.dtan4.net/
MIT License
4.29k stars 659 forks source link

Apply in an already implemented environment #393

Closed hutger closed 5 years ago

hutger commented 6 years ago

Hi, I've just tested Terraforming in my implemented environment and ran flawlessly.

It can be a silly question but... I was just wondering... what would happen if I forward the output to a .tf file and apply it in my environment, it will keep all the already existent objects (EC2 instances, VPCs, EBSs, and so on) or will try to replace it?

I mean... if I run "terraforming ec2", save the output to a .tf file (ec2.tf) and later run "terraform apply"?

AnthonyWC commented 6 years ago

If you run terraform plan and it will show you the difference between the terraform tf configuration file to what's stored in your tfstate file (which should be sync to what's in your infrastructure). So if you run terraform apply it will execute whatever is the difference in that plan, assuming that the tf plan is valid w/o error.

hutger commented 6 years ago

Hi @AnthonyWC, thanks for you reply. Now I get it.

dtan4 commented 5 years ago

Terraform doesn't see and modify existing resource ouf of tfstate. Basically there is no problem for existing resources.

Thanks @AnthonyWC for your comment!