atmos terraform source pull
Use this command to vendor a Terraform component source based on its source configuration. This downloads the component from the specified URI and places it in the appropriate component directory.
Source-Based Version Pinning
Learn how to configure the source field for per-environment version control.
Usage
atmos terraform source pull <component> --stack <stack> [flags]
Description
The pull command vendors a Terraform component source by:
- Reading the
sourceconfiguration from the component's stack manifest - Downloading the source from the specified URI using go-getter
- Applying any
included_pathsandexcluded_pathsfilters - Copying the filtered content to the component directory
If the component is already vendored, it will be skipped unless --force is specified.
Examples
Basic Usage
Vendor a component source for a specific stack:
atmos terraform source pull vpc --stack dev
Force Re-vendor
Re-vendor even if the component directory already exists:
atmos terraform source pull vpc --stack dev --force
With Identity Override
Use a specific identity for authentication:
atmos terraform source pull vpc --stack dev --identity admin
Arguments
component- Required. The name of the Atmos component to vendor.
Flags
--stack/-s- Required. The Atmos stack name. Can also be set via
ATMOS_STACKenvironment variable. --force/-f- Force re-vendor even if the component directory already exists. Without this flag, the command skips vendoring if the directory exists.
--identity/-i- Identity to use for authentication when downloading from protected sources. Overrides the component's default identity.
Configuration
The component must have source configured in its stack manifest:
components:
terraform:
vpc:
source:
uri: github.com/cloudposse/terraform-aws-components//modules/vpc
version: 1.450.0
included_paths:
- "*.tf"
excluded_paths:
- "*.md"
- "tests/**"
Output
On success:
Vendoring component 'vpc' from source...
Downloading from github.com/cloudposse/terraform-aws-components//modules/vpc?ref=1.450.0
✓ Successfully vendored component to components/terraform/vpc
See Also
- Source-Based Version Pinning — Design pattern for per-environment version control
atmos terraform source— Parent command overviewatmos terraform source describe— View source configurationatmos terraform source list— List components with sourceatmos terraform source delete— Remove vendored source