atmos terraform source
Use these commands to manage Terraform component sources with just-in-time (JIT) vendoring. This enables components to declare their source location inline using the top-level source field without requiring a separate component.yaml file. Sources are automatically provisioned when running terraform commands—just run atmos terraform plan and the source is downloaded on first use.
Source-Based Version Pinning
Learn how to use the source field for native per-environment version control directly in stack configuration.
Usage
atmos terraform source <subcommand> [options]
Subcommands
📄️ source delete
Remove vendored source directory
📄️ source describe
Show source configuration for a component
📄️ source list
List Terraform components with source configuration
📄️ source pull
Vendor component source from source configuration
Automatic Provisioning
Sources are automatically provisioned when running any terraform command. If a component has source configured and the target directory doesn't exist, Atmos downloads the source before running terraform:
# Source is automatically provisioned on first use
atmos terraform plan vpc --stack dev
# → Auto-provisioning source for component 'vpc'
# → Auto-provisioned source to components/terraform/vpc
# → Terraform runs
This means you can simply configure your component's source and run terraform—no explicit vendor step needed.
CLI Commands
The explicit CLI commands are useful for fine-grained control:
- Force re-vendor to get the latest version
- Describe source configuration
- Delete vendored sources
- List components with sources
How It Works
The source provisioner enables just-in-time vendoring of Terraform components directly from stack configuration. Instead of pre-vendoring components or maintaining separate component.yaml files, you can declare the source inline:
# stacks/dev.yaml
components:
terraform:
vpc:
source:
uri: github.com/cloudposse/terraform-aws-components//modules/vpc
version: 1.450.0
included_paths:
- "*.tf"
- "modules/**"
excluded_paths:
- "*.md"
- "tests/**"
vars:
cidr_block: "10.0.0.0/16"
When you run atmos terraform source pull vpc --stack dev, Atmos:
- Reads Configuration - Extracts
sourcefrom the component's stack manifest. - Resolves Source - Parses the go-getter-compatible URI with optional version.
- Downloads Content - Fetches the source using go-getter (supports git, s3, http, oci, etc.).
- Filters Files - Applies
included_pathsandexcluded_pathspatterns. - Copies to Target - Places files in the component directory.