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

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.

  1. Access Cloud Asset Discovery

    1. From the StackGen Home Page, click Cloud Asset Discovery from the navigation panel on the left.

    2. Click Start Discovery to begin importing your infrastructure.

      Start Discovery

      note

      After the first discovery, the UI will change to show a + New button.

      New Button

  2. Import a Terraform State File (.tfstate): Upload an existing .tfstate file 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.

    Upload tfstate

    note

    StackGen supports both UI and CLI-based imports.

  3. StackGen will identify all the resources within your .tfstate file.

    Discovered Resources

    Modules required before you create an appStack

    Steps 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.yaml references, 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-modules when you want the broader StackGen-maintained catalog (see Module Catalog).

    SituationWhat to expect
    New environmentUpload 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 coverageSome 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 modulesRelying 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.
  4. 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 .

      Select Resources

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

    appStack from Discovery

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

      Edit appStack Name

Modify Resource Selection After Creation

At any point in time, if you want to go back and select or deselect resources from your appStack:

  1. Click the Source icon from the appStack details menu.

    source

  2. You can select the resources you want and click the forward arrow to include them in your appStack.

    Add Resources

    note

    You cannot remove resources added while creating the base appStack.

  • Click Update Topology. Your appStack will be updated with the selected resources.

    Discovery appStack

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 push when you prefer a terminal workflow.
warning

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.

warning

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.