Getting Started#
This guide will help you get up and running with infrastructure as code on Google Cloud Platform using Terragrunt and OpenTofu/Terraform.
Prerequisites#
Before you begin, ensure you have the following installed and configured:
- OpenTofu or Terraform (version 1.0+)
- Terragrunt (version 0.50+)
- Google Cloud SDK (gcloud)
Refer to the Google Cloud SDK documentation for installation instructions.
- Google Cloud Account with appropriate permissions
- Organization Owner or Editor role
- Billing account linked to your project
Initial Setup#
1. Authenticate with Google Cloud#
2. Verify Your Setup#
# Check your current configuration
gcloud config list
# Verify OpenTofu/Terraform can access Google Cloud
tofu version # or terraform version
# Verify Terragrunt installation
terragrunt --version
Quick Start with Terragrunt#
1. Understanding Terragrunt#
Terragrunt is a thin wrapper for OpenTofu/Terraform that provides extra tools for working with multiple modules and managing remote state. For a comprehensive introduction, see the Terragrunt Quick Start Guide.
2. Clone or Download Configuration#
Choose one of our pre-built Terragrunt modules or create your own configuration files with terragrunt.hcl.
3. Working with a single module#
4. Apply Your Configuration#
5. Working with Multiple Modules#
# Plan all modules
terragrunt run-all plan
# Apply all modules in subdirectories
terragrunt run-all apply
Terragrunt vs OpenTofu/Terraform#
This library leverages Terragrunt's capabilities to:
- Manage remote state automatically across multiple environments
- Handle dependencies between modules
- Reduce code duplication with shared configurations
- Simplify multi-environment deployments
While you can use plain OpenTofu/Terraform, Terragrunt provides additional benefits for managing complex infrastructure at scale.
Next Steps#
-
Explore our module library for ready-to-use Terragrunt modules
-
Read the full Terragrunt documentation
-
Contact us for Support or Professional Services