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

AppStack Outputs

The appStack Outputs feature lets you define stack-level Terraform outputs on an appStack so users can view output data after the stack is applied. Just like variables, you configure outputs in Terraform Configuration on the Topology canvas. This guide walks you through the Outputs tab, from creating an output to reviewing outputs.tf in the IaC view.

When you design infrastructure on the Topology canvas, StackGen creates resources from your modules. Many deployment details (such as ARNs or resource IDs) are generated only after apply and are not shown on the canvas by default.

The Outputs tab in Terraform Configuration lets you choose which module attributes to expose as Terraform outputs. StackGen writes the matching blocks to outputs.tf in the generated IaC.

For where outputs.tf fits in the export layout, refer to IaC in StackGen. For variables, locals, and other Terraform blocks on the canvas, see Topology canvas, Terraform Config.

Why Define appStack Outputs

Defining outputs is an important step when you configure infrastructure on an appStack. Resources (for example, an AWS Athena database) are created by the platform, but their deployment-specific values stay hidden unless you define outputs.

When you configure outputs, you can:

  • Expose dynamically generated resource details (such as ARNs or IDs) that appear only after deployment.
  • Give users quick access to critical values in StackGen after apply, instead of searching cloud consoles or raw configuration files.
  • Export specific resource values so other workflows or stacks can reference them outside the immediate module.

Create an appStack Output

Click to view

Follow these steps to define a new output using the Topology canvas.

Open the Outputs Configuration

  1. In the top navigation bar on the canvas, click Add New.
  2. Hover over Terraform Config in the dropdown menu.
  3. Click Outputs in the secondary menu.

StackGen opens the Terraform Configuration modal on the Outputs tab.

Configure the Output Name

  1. Click + Create Output in the top right corner of the modal.
  2. In Output Name, enter an identifier (for example, query_id).
note

The field accepts alphanumeric characters, underscores, and hyphens. A real-time HCL preview panel on the right updates as you type.

Map the Value Expression

  1. Click inside Value expression to open autocomplete suggestions.
  2. Select module. from the suggested types.
  3. Select your resource instance from the list (for example, your Athena module instance, which may show an internal module string such as stackpen_f1263e32...).
  4. Select the attribute to output (for example, database_id or query_id).
  5. Click Create Output at the bottom right of the modal to save your configuration.

Verify Outputs in the IaC View

Once you configure outputs in the UI, you can confirm that StackGen generated the expected Terraform code.

Click to view

Follow these steps to review outputs.tf:

  1. Close the configuration modal. At the top center of the canvas, switch from Topology to IaC.
  2. In the left file explorer, open the terraform directory and click outputs.tf.
  3. Review the auto-generated HCL. Each output should map to the module attributes you selected:
output "database_id" {
value = module.stackpen_f1263e32-d7a3-4d6c-b880-cdf2644a9b06.database_id
}

output "query_id" {
value = module.stackpen_f1263e32-d7a3-4d6c-b880-cdf2644a9b06.query_id
}
tip

Module instance strings in generated code match your appStack when you save the output. If you rename or replace a module on the canvas, reopen Outputs and confirm expressions still point at the correct instance.

Benefits

  • You can surface post-deploy values (IDs, ARNs, and similar fields) without leaving StackGen.
  • The HCL preview and IaC tab help you validate output names and expressions before export or Plan & Deploy.
  • Stack-level outputs work alongside sharing infrastructure outputs when you need to reuse values across projects.

Best Practices

Click to view
  • Define outputs for values users need after apply, not for settings you already expose as variables.
  • Use clear output names (for example, database_id, query_id) that match how your team references resources in runbooks or automation.
  • After you add or change resources on the canvas, recheck outputs.tf in the IaC view before you export or deploy.
  • Use Plan & Deploy to confirm the stack applies cleanly before you rely on output values in downstream work.