8 Terraform Best Practices that will improve your TF workflow immediately

preview_player
Показать описание
8 Terraform Best Practices that will improve your Terraform workflow immediately
▬▬▬▬▬▬ Learn more about Terraform? 🚀 ▬▬▬▬▬▬

Terraform is one of the most popular Infrastructure as Code tools out there. And if you’ve just started working with Terraform, you may be asking yourself, whether you are doing things in the right way. So in this video, you will learn 8 Terraform best practices that will improve your Terraform workflows immediately and make you feel more confident when using Terraform in your projects.

► This video is sponsored by env0 (Terraform Cloud alternative) 🙌🏼

#terraform #devops #techworldwithnana

▬▬▬▬▬▬ Useful Links 🔗 ▬▬▬▬▬▬

▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬
0:00 - Intro
0:25 - Terraform State & State File - Best Practices around State
1:18 - BP 1: Manipulate state only through TF commands
1:46 - BP 2: Remote State
2:44 - BP 3: State Locking
3:43 - BP 4: Back up State File
4:23 - BP 5: Use 1 State per Environment
5:36 - BP 6: Host TF code in Git repository
6:56 - BP 7: CI for TF Code
7:39 - BP 8: Execute TF only in an automated build
8:28 - Wrap Up & More TF Resources

▬▬▬▬▬▬ Want to learn more? 🚀 ▬▬▬▬▬▬

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

▬▬▬▬▬▬ Courses & Bootcamp & Ebooks 🚀 ▬▬▬▬▬▬
Рекомендации по теме
Комментарии
Автор

If you want to support this channel, please leave a like :)

▬▬▬▬▬▬ Learn more about Terraform? 🚀 ▬▬▬▬▬▬

▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬
0:00 - Intro
0:25 - Terraform State & State File - Best Practices around State
1:18 - BP 1: Manipulate state only through TF commands
1:46 - BP 2: Remote State
2:44 - BP 3: State Locking
3:43 - BP 4: Back up State File
4:23 - BP 5: Use 1 State per Environment
5:36 - BP 6: Host TF code in Git repository
6:56 - BP 7: CI for TF Code
7:39 - BP 8: Execute TF only in an automated build
8:28 - Wrap Up & More TF Resources

▬▬▬▬▬▬ Useful Links 🔗 ▬▬▬▬▬▬

TechWorldwithNana
Автор

We are honored to sponsor this great video!

envZero
Автор

– Use remote state with versioning and locking;
– Use workspace for multiple environments;
– Use for_each instead of count if it's possible;
– Never save TF state files in git, they can contain sensitive information in plain text format;
– Use modules for code reuse (DIY);
Thanks for a video :)

andrewmiko
Автор

Nice video, you can also include -:
Using of TF modules to follow DRY code practices.
Use of terraform workflows to deploy similar type is multiple environments.
Securing sensitive variable to output on console.
Securing state files wherever kept.

Nagenderkotnala
Автор

Love the content, and I’m happy to report that I’ve been following these best practices for several years now.

Only thing I’d recommend is to use modules as a best practice. It’s just easier to manage components vs one file with all the resources.

be_erod
Автор

one of the best videos that actually shows how big orgs do it. Thanks

Djsanddy
Автор

Great job! Love your presentation style and have enjoyed many of your videos over the past year.

KahanDataSolutions
Автор

Amazing best practices, one to add is to create names or identifiers dynamically for the resources that cannot be deployed multiple times, this way you can deploy IaC for features branches to test your changes before merging to the main branch

Jstevenyepes
Автор

Love your videos as always, concise, precise and crisp, thank you

jonykiran
Автор

This env0 for both Terraform and DevOps as a whole looks and sounds so cool! Great information there Ms.Nana. Thank you so much!

yogeshdharya
Автор

Hi Nana, I just wanted to give kudos to you for your Terraform course on Udemy. I finished it some weeks ago and I can use my new knowledge in my daily work.

muelladresse
Автор

Thank you Nana. This is a handful for Terraform beginner developers.
What I would add from my experience - creating only one state file for one environment can be an issue if the environment has a lot of resources. A bigger state means a much longer plan and apply (and very often more $$$ if someone uses CI/CD as SaaS), so my suggestion is to divide code into workspaces and use state files for each of them. Keep up to 50 resources per state.

MariuszZalewski
Автор

I just love the way you present the information in your videos! Best videos out there

benjishohet
Автор

Your explanations are concise and to the point. Keep creating these videos it helps a lot.

Praveenkumar-vgpn
Автор

One thing worth mentioning regarding tfstate and putting your terraform into version control is that you do not want to version control your .tfstate files. These can potentially contain secrets in plain text. The best thing to do in this case is switch to a remote storage method like s3 even if you're not part of a team, just to be on the safe side.

professorlamp
Автор

Hi Nana, you are awesome.the way you explain things is super easy.
You know what, I became Devops expert only watching your videos.

maxweber
Автор

Using terrform modules instead of repetative resources and pass the required input arguments to this module, this module can also be versioned and kept in git and use tags (with incremental versions eg: v0.1) to refer in the main code. This enhances our code to become better in terms of readability.

Also, we have to hide the sensitive content in tf output vars ( if any) and donot hardcode sensitive protected info in tf code, instead handle them through CI ( store them as jenkins credentials ), write jpac to read it and pass it as CLI arg to tf commands as needed.

VijayKumar-xtes
Автор

Great Best Practices Explanation! Really awesome explanation on how to utilize 1 state per environment and how to organize states!

stuffedcode
Автор

Thx for sharing! How about a video on managing terraform modules? Or maybe how to separate out IaC for staging, production, and dev environments :)

therealpang
Автор

- Use workspaces to better organize state files
- Use pre-commit hooks to do basic Terraform fmt, linting before commiting changes

niravchotai