Skip to main content

DebugApp

caution

This is the SST v1.x Constructs doc. SST v2 is now released. If you are using v2, see the v2 Constructs doc. If you are looking to upgrade to v2, check out the upgrade steps.

The DebugApp construct is used internally by SST to

It extends cdk.App. It's made available as the app in the debugApp() callback in the stacks/index.js of your SST app.

export function debugApp(app) {
new sst.DebugStack(app, "debug-stack");
}

Since it is initialized internally, the props that are passed to DebugApp cannot be changed.

Examples

Access Properties

export function debugApp(app) {
app.name;
app.stage;
app.region;
app.account;
}

Properties

An instance of DebugApp has the following properties.

account

Type : string

The AWS account the app is being deployed to. This comes from the IAM credentials being used to run the SST CLI.

name

Type : string

The name of the app. This comes from the name in your sst.json.

region

Type : string

The region the app is being deployed to. If this is not specified as the --region option in the SST CLI, it'll default to the region in your sst.json.

stage

Type : string

The stage the app is being deployed to. If this is not specified as the --stage option, it'll default to the stage configured during the initial run of the SST CLI.

Methods

An instance of DebugApp has the following methods.

logicalPrefixedName

logicalPrefixedName(logicalName)

Parameters

  • logicalName string

Use this method to prefix resource names in your stacks to make sure they don't thrash when deployed to different stages in the same AWS account. This method will prefix a given resource name with the stage and app name. Using the format ${stage}-${name}-${logicalName}.

DebugAppDeployProps

Deploy props for apps.

name

Type : string

The app name, used to prefix stacks.

region

Type : string

The region to deploy this app to.

stage

Type : string

The stage to deploy this app to.