Cloud Asset Discovery
Cloud Asset Discovery
Overview
Discover your existing cloud infrastructure before creating an appStack. StackGen supports Day-0 Resource Discovery, so you can inspect existing resources from a Terraform state (.tfstate) file before you create an appStack.
Create appStack from this Discovery (steps 4 and 5 below) depends on matching custom modules in your Module Catalog. Read the callout before step 4 before you create the appStack.
Pre-appStack Creation: Day-0 Resource Discovery
Cloud Asset Discovery can be performed before creating an appStack to ensure that the imported infrastructure aligns with its intended configuration.
-
Access Cloud Asset Discovery
-
From the StackGen Home Page, click Cloud Asset Discovery from the navigation panel on the left.
-
Click Start Discovery to begin importing your infrastructure.
noteAfter the first discovery, the UI will change to show a + New button.

-
-
Import a Terraform State File (
.tfstate): Upload an existing.tfstatefile to retrieve infrastructure details. You can either drag your deployment file or click the Click to upload IaC files panel to upload your file, then click Proceed.
noteStackGen supports both UI and CLI-based imports.
-
StackGen will identify all the resources within your
.tfstatefile.
Modules required before you create an appStackSteps 4 and 5 map discovered Terraform resource types to modules in your catalog. For that mapping to work, you need custom modules that declare:
- How each Terraform resource type from state maps to a module
- How references are formed in
.stackgen/stackgen.yaml
That discovery-oriented metadata lives in the separate discovery-modules repository. See the README for mappings,
stackgen.yamlreferences, and upload examples.These modules are not the same as the general-purpose modules in stackgen-modules. Use discovery modules for this flow. Use
stackgen-moduleswhen you want the broader StackGen-maintained catalog (see Module Catalog).Situation What to expect New environment Upload the discovery-oriented modules and assign them to your project before you click Create appStack from this Discovery. If no matching modules are available, appStack creation from discovery will not work. Partial coverage Some resource types may not have a matching module yet. The flow can still proceed for resources that match. StackGen errors only when there are not enough modules to create the appStack. Built-in modules Relying on platform built-in modules for this path is being phased out. Prefer custom modules from your catalog. For how to upload them, see Module Catalog and stackgen upload custom-modules. -
Click Create appStack from this Discovery to create your appStack.
-
You can select all resources or a few and then click the forward arrow → to create your appStack.
-
To unselect a resource, select the resources and click the back arrow ←.

-
-
Click Create appStack, you will be redirected to the Topology Canvas.

-
You can edit the appStack name and description via the Edit appStack Details dialog.

-
Modify Resource Selection After Creation
At any point in time, if you want to go back and select or deselect resources from your appStack:
-
Click the Source icon from the appStack details menu.

-
You can select the resources you want and click the forward arrow → to include them in your appStack.
noteYou cannot remove resources added while creating the base appStack.
-
Click Update Topology. Your appStack will be updated with the selected resources.

Push Terraform state to a remote backend
For appStacks created from a Cloud Discovery workflow, StackGen exposes a UI action in state backend settings to push the segregated appStack Terraform state file to its mapped remote backend (for example Amazon S3 or Google Cloud Storage).
Previously, this push was available through the CLI (stackgen state push). Now, Cloud Discovery appStacks can run the same kind of push from the web UI.
Key Features
- UI Push Action - Use the action in state backend settings to push the appStack state to the configured remote backend.
- Cloud Discovery Only - Manually built appStacks do not show this control. It is unique to appStacks generated from Cloud Discovery.
- Failure Checks - StackGen aborts with an error if credentials are expired, cloud permissions are wrong, or the backend storage config is misconfigured.
- CLI Still Available - Use
stackgen state pushwhen you prefer a terminal workflow.
Destructive data overwrite: A push writes the remote state file immediately and entirely overwrites the destination state. There is no intermediate prompt to block an unintended overwrite. Confirm you intend to replace remote state before you push.
Cloud Discovery deletion dependency: Source state view, download, and remote push controls depend on the parent Cloud Discovery record. If you delete that discovery from history, those controls are permanently removed from the appStack UI. Do not delete the discovery until you are sure you will not need to push or manage that appStack's state again.
See v2026.6.12 and IaC from Cloud Discovery.
Post-appStack Creation: Continuous Drift Monitoring
You can now run Day 0 drift on the selected resources in your appStack and continue to monitor for drift on an ongoing basis. Check out the Drift Detection document to learn more.
You can also create appStacks from your .tfstate discoveries. Refer to the IaC from Cloud Discovery and Importing IaC articles for detailed steps.