atmos terraform generate
Use these commands to generate Terraform configuration files including backend configurations and variable files for Atmos components and stacks.
Backend Configuration
Learn how to configure Terraform backends for state management in Atmos.
Usage
atmos terraform generate <subcommand> [options]
Subcommands
📄️ generate backend
Use this command to generate a Terraform backend config file for an Atmos terraform component in a stack.
📄️ generate backends
Use this command to generate the Terraform backend config files for all Atmos terraform components in all stacks.
📄️ generate planfile
Use this command to generate a Terraform planfile for an Atmos component in a stack and convert it to JSON or YAML format for review.
📄️ generate varfile
Use this command to generate a .tfvar.json variable file for an Atmos component in a stack with all configured values.
📄️ generate varfiles
Use this command to generate the Terraform varfiles (`.tfvar`) for all Atmos terraform components in all stacks.
Overview
The generate commands help you create Terraform configuration files without running Terraform directly. This is useful for:
- CI/CD pipelines - Pre-generate configuration files for review or caching
- Debugging - Inspect the generated backend and variable configurations
- Bulk operations - Generate files for all components across all stacks
Examples
Generate Backend Config
Generate a backend configuration file for a single component:
atmos terraform generate backend vpc -s dev-us-east-1
Generate All Backends
Generate backend configuration files for all components in all stacks:
atmos terraform generate backends
Generate Variable File
Generate a .tfvar.json file for a component:
atmos terraform generate varfile vpc -s dev-us-east-1
Generate All Variable Files
Generate variable files for all components in all stacks:
atmos terraform generate varfiles
Generate Plan File
Generate and convert a Terraform plan to JSON or YAML:
atmos terraform generate planfile vpc -s dev-us-east-1 --format=json
Common Flags
--stack/-s- Atmos stack name (required for single-component commands).
--dry-run- Show what would be generated without writing files.
--process-templates- Enable/disable Go template processing (default: enabled).
--process-functions- Enable/disable YAML function processing (default: enabled).
See Also
- Backend Provisioning - Configure Terraform backends
- Stack Configuration - Learn about Atmos stacks
atmos terraform plan- Run Terraform plan