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

stackgen import

The stackgen import command imports infrastructure configuration from supported sources (for example Terraform state).

Usage

stackgen import [flags]
stackgen import [command]

Flags (parent)

FlagTypeDescription
--appstack-idstringAppstack id to import into an existing appstack (creates a new appstack version).
--appstack-namestringAppstack name to create when importing into a new appstack (must be unique).
-f, --filestringPath to the source file (required when the flow uses a file).
-h, --helpHelp for import.

For import state, this site documents --cloud-provider, -m / --mode, and the file or appStack selectors on the import state page.

Subcommands

Here's an overview of the available subcommands:

state

Parses a Terraform state file (.tfstate) and imports the infrastructure configuration into a new or existing appStack. This subcommand automates the process of keeping your infrastructure in sync with your Terraform-managed resources by creating a new appStack or a new version of an existing one directly from the CLI. Ideal for CI/CD pipelines, it reduces manual work, ensures compliance, and supports seamless version control without needing to access the UI. Use this command to integrate Terraform-managed infrastructure into StackGen workflows efficiently.