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

stackgen import

Usage

The stackgen import command allows you to import infrastructure configuration from different sources such as Terraform state files.

stackgen import [subcommand] [flags]

Common Flags

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

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.