Hello Nikopol
Thanks for sharing this question with us, is a very good one.
So, on top of what Ryan have said, you can try something else.
When you have directories, Terraform by default won't go into them, so each directory will be a separate terraforn project, and they will have a local statefile.
Each project won't know of each other.
so if you create a VPC in one.
And you go to a new directory that also creates a VPC, terraform won't make any assumptions. here the idea is, terraform will create what the local project dictate.
So 2 options here.
- You can import the existing VPC, not 100% sure will work as not all the resources can be imported, but worth a try.
- You can try to use a backend for both of this projects so they share state. Again, I will suggest try this first to check if works for what you want.
State backend (he can share backend)
As time permits, please have a look at those links and feel free to came back with what you found.
Thanks again
Alvaro.