Skip to main content

Imports

The imports key in vendor.yaml allows you to split the main vendor manifest into smaller files for maintainability, or organize them by their roles in the infrastructure.

Schema​

spec:
imports:
- "vendor/networking"
- "vendor/security"
- "layers/data.yaml"
- "vendor/**/*" # Glob pattern to import all manifests

How It Works​

The imports section defines additional vendoring manifests that are merged into the main manifest. Hierarchical imports are supported at many levels (one vendoring manifest can import another, which in turn can import other manifests, etc.). Atmos processes all imports and all sources in the imported manifests in the order they are defined.

note

The imported file extensions are optional. Imports that do not include file extensions will default to the .yaml extension.

Relative paths in imported manifests​

A relative local source declared in an imported manifest is resolved against that imported manifest's own directory, so a manifest stays self-contained no matter which manifest imports it.

Relative targets behave differently on purpose: they describe where artifacts land in your project, so every source resolves them against the same root — the Atmos base_path when vendor.base_path is configured, otherwise the directory of the top-level manifest. Splitting a manifest into imports therefore never changes where components are vendored to.

Projects pinned to an edition earlier than 2026-12-04 resolve relative local sources in imported manifests, and relative targets, against the directory of the top-level manifest file. When vendor.base_path names a directory of manifests, that anchor is the directory's parent, not the directory itself.

Glob Pattern Support​

Import paths support POSIX-style glob patterns for matching multiple files:

* (single asterisk)
Matches any sequence of characters within a single directory level.
Example: vendor/*.yaml matches vendor/networking.yaml but not vendor/aws/networking.yaml.
** (double asterisk / globstar)
Matches across multiple directory levels recursively.
Example: vendor/**/*.yaml matches all .yaml files in vendor/ and all subdirectories.
? (question mark)
Matches exactly one character.
Example: vendor/layer?.yaml matches vendor/layer1.yaml, vendor/layerA.yaml.
{a,b} (brace expansion)
Matches any of the comma-separated patterns.
Example: vendor/{networking,security}.yaml matches both files.

Example: Import All Manifests in a Directory​

spec:
imports:
- "vendor/**/*" # Import all vendor manifests recursively

Example: Import by Pattern​

spec:
imports:
- "layers/*.yaml" # All YAML files in layers/
- "vendor/aws/**/*" # All manifests under vendor/aws/
- "vendor/{networking,security}" # Specific manifests

Example: Organizing by Infrastructure Layer​

Import separate manifests for networking, security, data management, CI/CD, and other layers:

imports:
- "layers/networking"
- "layers/security"
- "layers/data"
- "layers/analytics"
- "layers/firewalls"
- "layers/cicd"

Example: Hierarchical Imports​

Hierarchical imports are supported at many levels. For example, consider the following vendoring configurations:

vendor.yaml
apiVersion: atmos/v1
kind: AtmosVendorConfig
metadata:
name: example-vendor-config
description: Atmos vendoring manifest
spec:
imports:
- "vendor/vendor2"
- "vendor/vendor3"

sources:
- component: "vpc"
# Example image reference: replace with the OCI image containing the files you need.
source: "oci://registry.example.com/team/vpc:{{.Version}}"
version: "latest"
targets:
- "components/terraform/infra/vpc3"
- component: "vpc-flow-logs-bucket"
source: "github.com/cloudposse-terraform-components/aws-vpc-flow-logs-bucket.git?ref={{.Version}}"
version: "1.323.0"
targets:
- "components/terraform/infra/vpc-flow-logs-bucket/{{.Version}}"
vendor/vendor2.yaml
apiVersion: atmos/v1
kind: AtmosVendorConfig
metadata:
name: example-vendor-config-2
description: Atmos vendoring manifest
spec:
imports:
- "vendor/vendor4"

sources:
- component: "my-vpc1"
# Example image reference: replace with the OCI image containing the files you need.
source: "oci://registry.example.com/team/vpc:{{.Version}}"
version: "1.0.2"
targets:
- "components/terraform/infra/my-vpc1"
vendor/vendor4.yaml
apiVersion: atmos/v1
kind: AtmosVendorConfig
metadata:
name: example-vendor-config-4
description: Atmos vendoring manifest
spec:
imports:
- "vendor/vendor5"

sources:
- component: "my-vpc4"
source: "github.com/cloudposse-terraform-components/aws-vpc.git?ref={{.Version}}"
version: "1.319.0"
targets:
- "components/terraform/infra/my-vpc4"

When you execute the atmos vendor pull command, Atmos processes the import chain and the sources in the imported manifests in the order they are defined:

  • First, the main vendor.yaml file is read based on search paths
  • The vendor/vendor2 and vendor/vendor3 manifests (defined in the main vendor.yaml file) are imported
  • The vendor/vendor2 file is processed, and the vendor/vendor4 manifest is imported
  • The vendor/vendor4 file is processed, and the vendor/vendor5 manifest is imported
  • Etc.
  • Then all the sources from all the imported manifests are processed and the artifacts are downloaded into the paths defined by the targets

After selecting an OCI image containing the files you need, pull progress can look like the following illustrative output:

> atmos vendor pull

Processing vendor config file 'vendor.yaml'
Pulling sources for the component 'my-vpc6' from 'github.com/cloudposse-terraform-components/aws-vpc.git?ref=1.315.0' into 'components/terraform/infra/my-vpc6'
Pulling sources for the component 'my-vpc5' from 'github.com/cloudposse-terraform-components/aws-vpc.git?ref=1.317.0' into 'components/terraform/infra/my-vpc5'
Pulling sources for the component 'my-vpc4' from 'github.com/cloudposse-terraform-components/aws-vpc.git?ref=1.319.0' into 'components/terraform/infra/my-vpc4'
Pulling sources for the component 'my-vpc1' from 'registry.example.com/team/vpc:1.0.2' into 'components/terraform/infra/my-vpc1'
Pulling sources for the component 'my-vpc2' from 'github.com/cloudposse-terraform-components/aws-vpc.git?ref=1.320.0' into 'components/terraform/infra/my-vpc2'
Pulling sources for the component 'vpc' from 'registry.example.com/team/vpc:latest' into 'components/terraform/infra/vpc3'
Pulling sources for the component 'vpc-flow-logs-bucket' from 'github.com/cloudposse-terraform-components/aws-vpc-flow-logs-bucket.git?ref=1.323.0' into 'components/terraform/infra/vpc-flow-logs-bucket/1.323.0'