Skip to main content
⏳ Estimated read time: 3 min read

download-iac

download-iac

The stackgen appstack download-iac command downloads Infrastructure as Code (IaC) files for an appStack. Use them for local development, deployment, or CI/CD.

Usage

stackgen appstack download-iac [appstack] [flags]

Flags

FlagTypeDescription
--appstackstringappStack UUID or name to download. Use stackgen appstack list, show, or ls.
--appstack-namestringName of the appStack to download.
--destinationstringDestination directory for zipped IaC. Appends .zip if not present. If omitted, the CLI uses its default output path.
--env-profilestringName of the environment profile to download.
-h, --helpHelp for download-iac.
--unpackUnpack the downloaded zip file (default false).
--latestDownload IaC for the latest appStack version (default false). Legacy versioning flag. See note below.
--versionint32Download IaC for a specific appStack version number. Legacy versioning flag. See note below.
note

StackGen moved day-to-day appStack history to Snapshots. Prefer downloading IaC for the current appStack (omit --version and --latest) unless you intentionally need a legacy versioned download. --version and --latest remain in the CLI for older versioned appStacks.

Examples

stackgen appstack download-iac --appstack app-1234abcd5678efgh --destination ./my-iac-files.zip

This command will:

  • Download the IaC files for the specified appStack,
  • Save the files to ./my-iac-files.zip.

Download IaC by appStack name

stackgen appstack download-iac --appstack-name my-production-app --destination ~/projects/infrastructure.zip

This command will:

  • Download the IaC files for the appStack named my-production-app,
  • Save the files to ~/projects/infrastructure.zip.

Legacy: download a specific appStack version

stackgen appstack download-iac --appstack app-1234abcd5678efgh --version 2 --destination ./v2-deployment.zip

Use this only when the appStack still has legacy versions. For current workflows, prefer Snapshots instead of --version.

Legacy: download the latest appStack version

stackgen appstack download-iac --appstack app-1234abcd5678efgh --latest --destination ./latest-deployment.zip

Use this only for legacy versioned appStacks. Prefer omitting --latest for the current appStack, or use snapshots for history.

note
  • The downloaded file is a ZIP archive containing the Terraform files for that appStack.
  • You may need to extract and configure provider credentials before applying the IaC.
  • If no destination is specified, files go to the CLI default output path.
  • Use stackgen appstack list, show, or ls to list appStacks and ids.