State
Text size
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
| Flag | Description |
|---|---|
--appstack string | AppStack UUID or name in the current project. Use stackgen appstack list for names and ids. |
-e, --environment string | Environment profile name when exporting IaC (same as stackgen provision). |
--iac-tool string | IaC tool: terraform or tofu (default terraform). |
-h, --help | Help 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-appusing thedevenvironment profile. - Run
tofu initand push the appStack state to the remote backend.