How To Structure Terraform Project (3 Levels)

preview_player
Показать описание


▬▬▬▬▬ Experience & Location 💼 ▬▬▬▬▬
► I’m a Senior Software Engineer at Juniper Networks (12+ years of experience)
► Located in San Francisco Bay Area, CA (US citizen)

▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬

▬▬▬▬▬▬ Related videos 👨‍🏫 ▬▬▬▬▬▬

▬▬▬▬▬▬▬ Timestamps ⏰ ▬▬▬▬▬▬▬
0:00 Intro
5:01 Beginner
25:35 Intermediate
35:37 Advanced

▬▬▬▬▬▬▬ Source Code 📚 ▬▬▬▬▬▬▬

#Terraform #Kubernetes #DevOps
Рекомендации по теме
Комментарии
Автор

Anton, you and Cloud Champs youtube channels are seriously holding it down for the DevOps learning community. Im constantly bouncing between the channels because the content is practical and great.

maserati
Автор

Dude you're putting serious quality content with these videos. Liking before seeing and already saving this on my watchlist ...

THANKS

cokegen
Автор

Thank you for this kind of video. There are thousands of Terraform videos in youtube but it is hard to find one that show how to use it professionally.

normuradovdavronbek
Автор

Thank you so much for making such a thorough yet simplified video about this, I'm new to TF and have been experimenting with so many different ideas. I've been running into a lot of the issues you covered, consistently, this is such a great help.

Samuel-gyx
Автор

What a awesome lesson! I was looking for that info 1 month ago because changed my job place and needed to create terraform repo from a scratch. Very useful

ZergStylexDD
Автор

I found that Terragrunt method which you uploaded here is the best for me. I hope you extend about Terragrunt more. Thanks Anton

uri_
Автор

Amazing video Anton! I saw a lot of companies trying to scale with V2 version and is impossible! Other common mistake is use one repository for the entire IaC, with the same life cycle for a VPC and a simple resource(S3 for audit team, DynamoDB for specific API...)

ingdamiangonzalez
Автор

Great practical content with best practices... Wish you make Python videos too as people expect DevOps guys to code too...

atulwankhade
Автор

Thank you so much for this incredible vidéo. I'm going to watch to Terragrunt to get more deeper on the subjet. Much appreciate

DavidBenOtto
Автор

Please continue this series with real time production grade terraform ci CD pipeline

nishitkumar
Автор

Thank you so much for this video! It's a great reference.

GabrielPozo
Автор

From my experience, we paid rackspace to write us terraform code for deployments, since we had many customers and environments. I remember the code they wrote was very heavy, I mean terraform plan could take up to 20-30 minutes, terraform apply more then 40 minutes.

VuqarIE
Автор

Hi Anton,

Great video as always! I went through a similar evolutionary process to what you described. I started with a very basic setup, and as the infrastructure grew, the problems you mentioned arose. Eventually, I ended up with a structure like yours, except I set up a private Terraform registry to manage the modules more efficiently and conveniently. I use Terrareg, which I believe is the ultimate option.

I have a few questions:
1. Do you think it's correct to manage the providers as a separate module instead of creating a file for each project?
2. You mentioned that some resources can be put in the global folder. What do you think should go there?

Thanks!

usarov
Автор

Nice video. What about using git submodules? i think you can create git repo and store all modules there and then add this repo as git submodule to your project. After that you can simple reference module in submodule folder. Also you can switch between branches in this submodule so you can test changes or deploy different configurations

ivanmokhonko
Автор

Thank you for the awesome video! What do you think about terraform workspaces? Any pluses/minuses to using them instead of splitting the environments into folders?

vmnneyt
Автор

Having one root module per environment (e.g. dev, stg, prd) makes sense to me, as you definitely want those to be different terraform states and be able to run in parallel, but I simply can't wrap my head around why you'd want to have a root module for each service as well (e.g. envs/dev/subnet, envs/dev/vpc as opposed to a single envs/dev that has all services).

I know Google suggests a similar thing for their terraform guide, as it helps keep the state file and thus blast radius small and makes terraform plan run fast.
However, you no longer manage dependencies between services in terraform and have to move to bash scripts with specific order in them. As a developer you then need to be extremely mindful in which order you've applied things as it's no longer as simple as running one single `plan` or `apply`.

The number of root modules also rises significantly, and becomes a product of `envs` and `services` - which can lead to a large amount of boilerplate code one has to manage.

It seems that the reason you'd want a state file per envⓧservice pair is due to terraform's limitations - if it could impute which part needs to be re-planned / fetched, it wouldn't really matter how big your state file is. Kinda how git & web state management frameworks can be pretty efficient and spot diffs accurately.

Any advice on this would be appreciated, still learning how to do this best.

gajop
Автор

can you do please a deep full course on ecs like you did on eks with terraform and all the concepts that would help a lot because you have a way of teaching so great ! cuz sometimes you don't need eks for simple projects, ecs would satisfy the need ! thnks in advance

mdxvnbz
Автор

It would be very cool to learn more about terragrunt =)

dimaserbenyuk
Автор

And the second question is providers also provides module like to create vpc, eks cluster, etc so we can use it directly. So should we use that ? Or not then why?


Recently I started learning gcp so I thought to use terraform with gcp to create vpc & gke modules . So today i do that created custom module for vpc. But when i looked at gke resources. Looks like it was impossible for me to create module for gke. Tons of attributes was there.

Krsaurav-clkj
Автор

Thank you, consider a blog with some of the slides or ReadMe to the same git repo...just a thought...thx

hubstrangers