Remote Stack Imports
This example demonstrates how to import stack configurations from remote sources using [go-getter](https://github.com/hashicorp/go-getter) URL schemes.
Try it out
- Install Atmos
- Try the example
Copy the example into a new directory and make it your own:
atmos init examples/remote-stack-imports
cd remote-stack-imports
Follow the README for prerequisites and next steps.
See it in action
RECORDED DEMO Remote Stack Imports Example
This example demonstrates how to import stack configurations from remote sources using go-getter URL schemes.
Overview
Atmos supports importing stack configurations from various remote sources:
- HTTP/HTTPS URLs - Raw files from web servers
- Git repositories - Using
git::prefix or platform shorthand - S3 buckets - Using
s3::prefix - Google Cloud Storage - Using
gcs::prefix
Example Structure
remote-stack-imports/
├── atmos.yaml # Atmos configuration
├── components/terraform/myapp/ # Simple mock component
└── stacks/
├── catalog/base.yaml # Local base configuration
└── deploy/demo.yaml # Stack with remote imports
Try It
cd examples/remote-stack-imports# View the stack configuration (includes remote imports)atmos describe stacks# Describe the componentatmos describe component myapp -s demo
Remote Import Examples
HTTP/HTTPS URL
import:- https://raw.githubusercontent.com/cloudposse/atmos/main/tests/fixtures/remote-imports/shared.yaml
Git Repository
import:# HTTPS with specific ref- git::https://github.com/acme/infrastructure.git//stacks/catalog/vpc?ref=v1.2.0# GitHub shorthand- github.com/acme/infrastructure//stacks/catalog/rds?ref=main
Nested Imports from the Remote Source
Remote files can contain their own import: section. By default, those nested imports resolve from your local stacks.base_path. Use nested_imports: remote when the remote file and its imports should be resolved together from the same remote source:
import:- path: git::https://github.com/acme/infrastructure.git//stacks/orgs/acme/_defaults.yaml?ref=v1.2.0nested_imports: remote
With this setting, a nested import like catalog/_defaults resolves to stacks/catalog/_defaults.yaml in the remote repository.
S3 Bucket
import:- s3::https://s3.amazonaws.com/my-bucket/stacks/catalog/vpc.yaml
Best Practices
- Pin Versions - Always use
?ref=with a specific tag or commit SHA for Git imports - Cache Considerations - Remote imports are cached locally
- Authentication - Configure credentials for private repositories via environment variables
- Fallback to Local - Consider vendoring critical imports for offline access
- Choose Nested Import Resolution - Use the default
nested_imports: localfor remote files that expect local extension points, andnested_imports: remotefor self-contained remote stack libraries