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

download-iac

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

Usage

stackgen appstack download-iac [appstack-id] [flags]

Flags

FlagTypeDescription
--appstack-idstringAppStack id to download. Use stackgen appstack list, show, or ls to look it up (older wording may call this a uuid).
--appstack-namestringName of the appStack to download.
--destinationstringDestination directory for zipped IaC. Appends .zip if not present. If omitted, the CLI picks a default path on your machine.
--env-profilestringName of the environment profile to download.
-h, --helpHelp for download-iac.
--latestDownload IaC of the latest version of the specified appStack (default false).
--unpackUnpack the downloaded zip file (default false).
--versionint32Version of the appStack to download.

Examples

Download IaC by appStack ID

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

This command will:

  • Download the IaC files for the specified appStack ID,
  • 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.

Download a specific version of an appStack

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

This command will:

  • Download the IaC files for version 2 of the appStack with the specified id,
  • Save the files to ./v2-deployment.zip.

Download the latest version of an appStack

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

This command will:

  • Download the IaC files for the latest version of the appStack with the specified ID,
  • Save the files to ./latest-deployment.zip.
note
  • The downloaded file is a ZIP archive containing all necessary terraform files.
  • You may need to extract and configure provider credentials before applying the IaC.
  • If no destination is specified, files go to the CLI default path on your machine.
  • Use stackgen appstack list, show, or ls to list appStacks and ids.