Skip to main content

atmos terraform generate varfiles

Purpose

Use this command to generate the Terraform varfiles (.tfvar) for all Atmos terraform components in all stacks.

Usage

Executes terraform generate varfiles command.

atmos terraform generate varfiles [options]

This command generates varfiles for all Atmos terraform components in all stacks.

tip

Run atmos terraform generate varfiles --help to see all the available options

Examples

atmos terraform generate varfiles --file-template {component-path}/{environment}-{stage}.tfvars.json
atmos terraform generate varfiles --file-template /configs/{tenant}/{environment}/{stage}/{component}.json
atmos terraform generate varfiles --file-template /{tenant}/{stage}/{region}/{component}.yaml
atmos terraform generate varfiles --stacks orgs/cp/tenant1/staging/us-east-2,orgs/cp/tenant2/dev/us-east-2
atmos terraform generate varfiles --stacks tenant1-ue2-staging,tenant1-ue2-prod
atmos terraform generate varfiles --stacks orgs/cp/tenant1/staging/us-east-2,tenant1-ue2-prod
atmos terraform generate varfiles --components <component1>,<component2> --file-template <file_template>
atmos terraform generate varfiles --format hcl --file-template <file_template>
atmos terraform generate varfiles --format json --file-template <file_template>
atmos terraform generate varfiles --format yaml --file-template <file_template>

Flags

FlagDescriptionAliasRequired
--file-templateVarfile template (path, file name, and file extension).
Supports absolute and relative paths.
Supports context tokens: {namespace}, {tenant}, {environment},
{region}, {stage}, {base-component}, {component}, {component-path}.
All subdirectories in the path will be created automatically
yes
--stacksOnly process the specified stacks (comma-separated values).
The names of top-level stack manifests and Atmos stack names are supported
no
--componentsGenerate varfiles only for the specified Atmos components
(comma-separated values)
no
--formatVarfile format: hcl, json, yaml (json is default)no
--dry-runDry runno