suga build, Suga transforms your high-level project specification into production-ready Terraform code. This page explains how this transformation works, what gets generated, and how to customize the output.
The Build Process
Thesuga build command orchestrates a multi-step process:
1
Load Project
Suga reads your
suga.yaml file and validates the configuration:suga.yaml
2
Fetch Platform
Suga retrieves the target platform specification from the registry:
3
Map Resources
Each project resource is mapped to a platform blueprint, by the selected subtype:
suga.yaml
4
Generate Terraform Output
Suga then uses Terraform CDK to resolve the modules, variables and other configuration to produce a Terraform stack.
Module Naming
Suga generates consistent module names for application resources:Terraform Module Names
Pattern:{resource_name}_{submodule_name}
Dependency Management
Suga automatically manages resource dependencies:Explicit Dependencies
Defined by platform:Platform blueprint
Generated Terraform
Implicit Dependencies
Created by resource references:Automatic dependency
Multi-Environment Support
The same generated Terraform can deploy to multiple environments using Terraform workspaces and environment-specific variable files. This allows you to maintain a single infrastructure definition while customizing configuration for dev, staging, and production.Terraform Environment Management
Learn how to manage multiple environments with Terraform workspaces and variables
Getting Help
If you encounter issues during build:- Review platform documentation in the platform browser
- Contact Suga support
Best Practices
1. Version Control Generated Terraform
Commit generated Terraform to version control:- Track infrastructure changes over time
- Review Terraform diffs in pull requests
- Rollback if needed