Score:0

Terraform advice - structure

fr flag

I am starting using Terraform and imported my current infrastructure from Azure using aztfy (im starting to think that was a bad idea...)

Now I have all my resources in in single main.tf file... security group, network, disk, instance...

I would like to start the project with good pratice, but there is many informations on internet and i am a bit lost.

I would like to manage multiple cloud provider in a single project, i was thinking of just separate them by repository like this:

terraform/ 
      -> azure/
      -> gpc/
      -> xxx/
      -> main.tf
      -> .terraform/

Do you think its a good practice ?

Then i would like to separate my infrastructure by type like this:

terraform/ 
      -> azure/
              -> tools/ #container all my tools resources (gitlab...etc.)
                     main.tf
                     ...
              -> prod/ #¢ontaining all my prod resources
                     main.tf
                     ...
              -> dev/
                     main.tf

     

Again, do you think its a good idea ? It seems that terraform don't automatically looks in sub-directory folders.

Thanks for your advices.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.