Building multi-account, multi-region apps with Terraform Stacks (DOP206)

Introduction

  • The session is about building multi-environment, multi-region applications with Terraform Stacks.
  • The speakers are Welly, a Principal Partner Solution Architect at AWS, and Kareem, a Senior Developer Advocate at HashiCorp.

Use Cases for Multi-Environment, Multi-Region

  1. Platform Infrastructure:

    • Deploy resources like networking, security, IAM roles consistently across multiple environments and workloads.
    • Key challenges are managing state, ensuring consistency, and navigating the directory structure.
    • Existing solutions include AWS Account Factory for Terraform and Terraform templates.
  2. Application Workloads:

    • Applications span both infrastructure and application components, e.g., a Kubernetes cluster with add-ons.
    • Challenges include managing dependencies between resources, such as VPC, cluster, and workloads.
    • Typical approach is to split deployments into multiple Terraform workspaces, leading to a complex matrix of dependencies.

Introducing Terraform Stacks

  • Terraform Stacks aims to provide a way to declaratively define deployments, building on top of existing Terraform modules.
  • Key components of a Terraform Stack:
    1. Components: Combination of Terraform modules that define the infrastructure resources.
    2. Deployments: Define how components are deployed, including the number of times and across which regions/accounts.
    3. Orchestration: Define rules and checks to manage the deployment process.
    4. Fur Changes: Allow work to continue in the background while Terraform resolves unknown values.

Demo

  1. Simple IAM Role Deployment:

    • Defined IAM roles as components.
    • Deployed the roles across two AWS accounts using the Deployments.
    • Demonstrated the ability to specify provider configurations and orchestration rules.
  2. Multi-Account, Multi-Region Deployment:

    • Modeled the deployment using organizational units (OUs) and a list of accounts.
    • Leveraged the flexibility of Terraform Stacks to loop through the accounts and regions.
    • Demonstrated the deployment of VPC and EKS cluster components across multiple environments.

Key Takeaways

  • Terraform Stacks provides a scalable and efficient way to manage multi-environment, multi-region deployments.
  • It offers features like improved visibility, consolidated configuration, and better orchestration capabilities.
  • Terraform Stacks integrates with HashiCorp Cloud Platform (HCP) for a complete infrastructure management solution.
  • The presented concepts and demos are available on GitHub for further exploration.

Your Digital Journey deserves a great story.

Build one with us.

Cookies Icon

These cookies are used to collect information about how you interact with this website and allow us to remember you. We use this information to improve and customize your browsing experience, as well as for analytics.

If you decline, your information won’t be tracked when you visit this website. A single cookie will be used in your browser to remember your preference.

Talk to us