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

State

State

The stackgen state command is used to run OpenTofu or Terraform state operations against appStack IaC.

Usage

stackgen state [command]

Sub Commands

push

The stackgen state push command is used to initialize Tofu or Terraform configuration and push state to a remote backend.

stackgen state push [flags]

Flags

FlagDescription
--appstack stringAppStack UUID or name in the current project. Use stackgen appstack list for names and ids.
-e, --environment stringEnvironment profile name when exporting IaC (same as stackgen provision).
--iac-tool stringIaC tool: terraform or tofu (default terraform).
-h, --helpHelp for push.

See Global CLI flags for --interactive, --log, --output, --project, and --stackgen-home.

Examples

Usage 1: Push state for an appStack with OpenTofu

stackgen state push --appstack my-production-app --environment dev --iac-tool=tofu

The above command will:

  • Download IaC for my-production-app using the dev environment profile.
  • Run tofu init and push the appStack state to the remote backend.