Adding resources to existing infra, but with Terraform this time

Hello Folks,

I want to ask do I have to import the existing infrastructure to Terraform if I want to build the infrastructure with Terraform from now on.

To make it simple:

  • I have an existing infrastructure in Google Cloud ( separated in 2 projects, prod and non prod)
  • All this infra was created manually.
  • Now, I want to introduce terraform so that I don't want to sit and do it manually the next time I'm setting up a resource

I have a few questions in regards to this:

  1. Can I start writing code from now and add the resources to the existing infrastructure right away?
  2. Do I have to import the existing infra and keep it in my repo and keep adding the code to the imported resources?
  3. Is there any easy way of importing the existing infrastructure without writing the code for all the existing resources, cause there are a lot?
  4. If I start writing code now and apply it to my non prod without importing the existing resources, will it delete the existing ones and apply only the resources I have terraform files for (the files I'm going to write?)

Any help is greatly appreciated!

submitted by /u/sarcasticengineer369
[link] [comments]

Read more here: https://www.reddit.com/r/Terraform/comments/kxdq9v/adding_resources_to_existing_infra_but_with/

Content Attribution

This content was originally published by /u/sarcasticengineer369 at Terraform, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: