Bring Existing Terraform Under Management
Bring Existing Terraform Under Management
Goal: infrastructure you already run with Terraform gets the same modules, policies and drift checks as anything new built in StackGen.
Without StackGen, existing Terraform stays in scattered repositories with its own conventions, and nobody checks it against current policy.
With StackGen, you import its state into an appStack. From then on it is checked against policy, managed from the canvas, and watched for drift.
Before you begin
- A Terraform state file (
.tfstate) for the infrastructure. - The StackGen CLI, installed and signed in.
Steps
-
Import the state. Use the StackGen CLI to import a state file into an appStack. See stackgen import state. To import a whole Terraform project, see Terraform Importer.
noteIn the earlier StackGen UI, you can also import from the appStack menu with Import (.tfstate, .json). See Import IaC.
-
Review the result. Open the appStack and check the canvas and the IaC tab. Fix any policy violations the import surfaced. See Import logs.
-
Manage it from now on. Make changes in StackGen and deploy them, or push the Terraform back to Git. See Plan & Deploy.
-
Watch for drift. Run drift detection to find changes made outside StackGen. See Drift detection.
What you get
- Existing infrastructure on the same modules and policies as new work.
- One place to see and change it.
- Alerts when someone changes it by hand.