The stage status command shows where a stage that uses sleep is: awake, asleep, going to sleep or waking up. It also shows since when and why, what the sleep stopped, what keeps billing, and when the stage changes next. It changes nothing.
Usage
Example output:
A stage with whenIdle that went to sleep because nobody used it says so:
and after a wake it names what woke it: The last wake (by a visit to its address, Tue 1 Dec 20:20 (UTC)) took 1 min 14 s.
On a stage without sleep the command says that the stage is always awake.
The amounts
The amounts are estimates. Stacktape computes them on your machine from the configuration the stage was last deployed with and from AWS list prices, without your bill. An amount covers only the charge its line names:
| Line | Amount |
|---|---|
| A resource that keeps running | Its whole fixed monthly price. |
| A stopped database | Its storage, where storage has a fixed price. Aurora bills storage by use, so an Aurora database has no amount. |
| A stopped NAT instance | Its public IP address. |
| A load balancer of a sleeping service | Its hourly price. |
A line has no amount when the charge is billed by use, when Stacktape cannot price the resource, or when the resource's size comes from a directive such as $Secret(). Public IP addresses of load balancers and discounts such as Savings Plans are not in any amount.
The amount next to the hours asleep is what those hours did not bill: the hours times the hourly list price of what the sleep stops (container tasks, database instances, NAT and bastion instances). It is a projection, not a measurement from your bill. A database that was busy when the stage went to sleep, for example, kept running. Without prices, or when a stopped resource's size comes from a directive, the line shows the hours only.
Flags reference
stacktape stage statusCLI options-r, --regionrequired"us-east-2" | "us-east-1" | "us-west-1" | "us-west-2" | "ap-east-1" | "ap-south-1" | "ap-northeast-3" | "ap-northeast-2" | "ap-southeast-1" | "ap-southeast-2" | "ap-northeast-1" | "ca-central-1" | "eu-central-1" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "me-south-1" | "sa-east-1" | "af-south-1" | "eu-south-1"AWS Region
The AWS region for the operation. For a list of available regions, see the AWS documentation.
For commands such as deploy, this flag overrides the project's configured region. If you omit it, Stacktape checks the project's config, AWS_DEFAULT_REGION, the default saved with defaults set, then the AWS profile.
-s, --stagerequiredstringStage
The stage for the operation (e.g., production, staging, dev-john). You can set a default stage using the defaults set command. Stage names use lowercase letters, numbers and dashes, with at least 2 characters. The project name, a dash and the stage form the CloudFormation stack name, which can have at most 128 characters. Stacktape shortens an AWS resource name that would be too long and adds a hash.
--aws-accountstringAWS Account
The name of the AWS account to use for the operation. The account must first be connected in the Stacktape Console.
Without it, the account is chosen by --profile, AWS_PROFILE or AWS credentials in environment variables, then by your saved default, then by your organization's only connected account. --aws-account takes precedence over all of them, but AWS credentials in environment variables must then belong to that account.
-c, --configstringConfig File Path
The path to your Stacktape configuration file, relative to the current working directory.
Without it, Stacktape uses the one stacktape.ts, stacktape.yml, stacktape.yaml or stacktape.js in the working directory. When there are several, the command stops and asks you to choose one with this option.
--cwdstringCurrent Working Directory
The working directory for the operation. All file paths in your configuration will be resolved relative to this directory. By default, this is the directory containing the configuration file.
-h, --helpstringShow Help
If provided, the command will not execute and will instead print help information.
--log-level"info" | "debug" | "error"Log Level
The level of logs to print to the console.
info: Basic information about the operation.error: Only errors.debug: Detailed information for debugging.
-p, --profilestringAWS Profile
The AWS profile to use for the command. You can manage profiles using the aws-profile:* commands and set a default profile with defaults set.
For commands that use a connected AWS account, --profile (or AWS_PROFILE) selects the connected account the profile belongs to, unless --aws-account is set. The command fails if that account is not connected.
--projectstringProject Name
The name of the Stacktape project for this operation.
Commands that target a stack take it from projectName in the project's config when the flag is absent.
--quietbooleanQuiet
Hide progress, banners, success messages and hints. Command output, warnings and errors are still printed.
JSON output
With --agent the command prints one JSON object:
| Field | Meaning |
|---|---|
contractVersion | 2. It changes when a field is removed or renamed, or state gets a new value. |
sleepConfigured | false for a stage without sleep. |
state | awake, going-to-sleep, asleep or waking. unknown when the record of what the sleep stopped is missing or unreadable. |
recordProblem | missing or unreadable when state is unknown, otherwise null. problem then says how to get the record back. |
since | When the stage entered this state (ISO 8601), or null. |
why | schedule, manual, deploy, queue, production, idle (nobody used it), visit (someone opened its address) or work (a message arrived in a worker's queue), or null. whyText says the same in a sentence. |
nextChange | { "at": "<time>", "to": "awake" | "asleep" }, or null when no change is planned. For a wake by the awake hours, upBy is their start: the stage is meant to be up then, and the wake starts earlier, at at. |
heldAwakeUntil | Set after a wake by hand or by a deploy: the stage stays awake until then. |
stopped | What the sleep stopped and nothing has started again: resourceName and kind. |
stillBilling | What keeps billing while the stage sleeps: resourceName, reason and monthlyUsd, an estimate of the fixed monthly charge the reason names (null when not known or billed by use). |
pricesAsOf | When the AWS list prices behind monthlyUsd and notBilledLast7DaysUsd were read (ISO 8601), or null when no amount could be estimated. |
asleepHoursLast7Days, lastWakeSeconds | Numbers, or null. |
notBilledLast7DaysUsd | What the hours asleep did not bill, projected from the AWS list prices of pricesAsOf, or null when the hours or the prices are not known. |
lastWake | The last wake of the stage after a sleep: by (what asked for it, as in why), at and seconds. null before the first. |
whenIdle | { "afterMinutes": <minutes> } for a stage with whenIdle, otherwise null. |
spotShortage | While a wake waits for Fargate Spot capacity that AWS does not have: since and resourceNames. Otherwise null. |
problem | The reason the last sleep or wake failed, or null. Stacktape retries by itself. |