MENU

Fun & Interesting

Managing Multiple Environments with Terraform

Ned in the Cloud 8,985 2 years ago
Video Not Working? Fix It Now

One of the primary benefits of using IaC is to produce code that is reusable across multiple environments. But how do you actually create a workflow to support that scenario? That's what we're going to dig into today using Terraform, GitHub Actions and Microsoft Azure for examples. The big three options for working with multiple environments are: 1. Using Git Branches - This is a scenario where you have a branch for each environment, and you deploy from that branch. Many Terraform automation platforms default to this workflow, so I guess it's pretty popular. 2. Using Folder Structure - This is a scenario where you have a folder for each environment in a single repository and single main branch. You deploy from that folder. 3. Using Separate Repos - This is a scenario where you have a separate repository for each environment. Each repository has its own main branch. You deploy from that repository. Each has its pros and cons, and each has its own level of complexity. There are also other options out there, that might work better depending on your organization, preferred workflow, and requirements. You want to structure your environment management strategy in a way that makes it easier to maintain your infrastructure, not harder. A special thanks to #Spacelift for helping to sponsor this video! Repository Examples: Branch-based - https://github.com/ned1313/tt-branch-example/ Folder-based - https://github.com/ned1313/tt-folder-example/ Repo-based - https://github.com/ned1313/tt-repo-example-dev The other repo-based repositories follow the same naming structure. Thank you so much for watching! Subscribe if you think I’ve earned it. Hit the bell as well if you’re feeling swell.❤️&🌮 ✅🔔 Subscribe ► https://nedinthecloud.com/SubscribeYT ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 🌮 Other videos to check out: 📽️ Terraform Check Block: https://youtu.be/wIP5TRHt5Gw 📽️ Terraform and OPA: https://youtu.be/wfhU72d1qqw 📽️ Workload Identity with Terraform Cloud: https://youtu.be/M5hJwl2ewTk ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 🌮 Timestamps: ⌚ 0:00 Intro ⌚ 1:37 Basic Assumptions ⌚ 2:51 Big Three Options ⌚ 3:50 Branch Based ⌚ 7:26 Folder Based ⌚ 9:22 Repo Based ⌚ 10:43 Spacelift Promo ⌚ 12:02 Banch Pros and Cons ⌚ 14:24 Folder Pros and Cons ⌚ 16:17 Repo Pros and Cons ⌚ 17:42 Terragrunt Option ⌚ 19:00 Final Thoughts ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ #terraform #hashicorp #devops #cloudengineer #tacos ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ⭐ CONNECT WITH ME 🏃🦖 🌐 Day Two Cloud: https://daytwocloud.io 🌐 Chaos Lever: https://chaoslever.com 🌐 Visit my Website ► https://nedinthecloud.com 🗳 Pluralsight ► https://app.pluralsight.com/profile/author/edward-bellavance 🐙 Find the code at GitHub► https://github.com/ned1313 🐧 Twitter ► https://twitter.com/ned1313 👨‍💼 LinkedIn► https://www.linkedin.com/in/ned-bellavance/ For collaboration or any queries: [email protected] ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 🌮 About Me 🌮 Ned is a curious human with a knack for creating entertaining and informative content. With over 20 years in the industry, Ned brings real-world experience to all his creative endeavours, whether that's pontificating on a podcast, delivering live instruction, writing certification guides, or producing technical training videos. He has been a helpdesk operator, systems administrator, cloud architect, and product manager. In his newest incarnation, Ned is the Founder of Ned in the Cloud LLC. As a one-man-tech juggernaut, he develops courses for Pluralsight, runs two podcasts (Day Two Cloud and Chaos Lever, and creates original content for technology vendors. Ned has been a Microsoft MVP since 2017 and a HashiCorp Ambassador since 2020, and he holds a bunch of industry certifications that have no bearing on anything beyond his exceptional ability to take exams and pass them. When not in front of the camera, keyboard, and microphone, you can find Ned running the scenic trails of Pennsylvania or rocking out to live music in his hometown of Philadelphia. Ned has three guiding principles: Embrace discomfort, Fail often, and Be kind.

Comment