stacktape dev network delete deletes the dev network of an AWS account and region: the VPC and the small EC2 instance, the dev box, that connect deployed dev functions to the databases on your machine. Delete it when nobody in the account uses stacktape dev in that region anymore, or when a failed network blocks dev mode.
Usage
stacktape dev network delete --region eu-west-1Delete the dev stages that use the network first, with stacktape delete --stage <stage>. While dev functions still run in the network, the command refuses and lists them, because their network interfaces keep the subnets in use. The deletion takes about 2 minutes and also removes the relay port leases. When dev functions were deleted shortly before, it can take up to about 20 minutes: AWS releases their network interfaces with a delay, and CloudFormation waits for that before it deletes the subnets. The command reports its progress once a minute meanwhile. The next stacktape dev that needs a dev network creates it again.
The command asks for confirmation first. With --json, or outside a terminal, it cannot ask: pass --yes.
The command also refuses while someone else depends on the network:
- While a
stacktape devsession uses it. The command asks the running dev box for its sessions and lists them. A box that has just started may not answer for about a minute; the command then refuses too.--forcedeletes the network anyway, and those sessions lose their connection. - While a
stacktape devsession creates or updates the network. Run the command again when CloudFormation has finished.
A stacktape dev that starts while the network is being deleted waits for the deletion to finish and then creates a new network.
When creating the network failed
The first stacktape dev deploys its dev stage into the network while CloudFormation still creates the network's last parts. When one of them fails, CloudFormation cannot delete the network again while the stage's functions use its subnets, and the network stays behind in DELETE_FAILED. stacktape dev and stacktape dev network then report the failure and the steps that remove it:
- Delete the dev stages that use the network, with
stacktape delete --stage <stage>. - Wait a few minutes: Lambda releases the network interfaces of deleted functions only after a while.
- Run
stacktape dev network delete. It deletes the failed network by its stack name and refuses while dev functions still use it. - Run
stacktape devagain; it creates a new network.
Options
stacktape dev network delete10 optionsAWS Region
Allowed values:us-east-2us-east-1us-west-1us-west-2ap-east-1ap-south-1ap-northeast-3ap-northeast-2ap-southeast-1ap-southeast-2ap-northeast-1ca-central-19 more
eu-central-1eu-west-1eu-west-2eu-west-3eu-north-1me-south-1sa-east-1af-south-1eu-south-1More about --region
The AWS region for the operation. For a list of available regions, see the AWS documentation.
Inside a project whose config declares
region, the flag is optional and overrides the config.-y, --yesbooleanAuto-Confirm Operation
More about --yes
Confirms an operation that would otherwise ask first: deleting a stack, an update that may delete stateful resources, creating a project that does not exist yet, and the other deletions that ask. Without a terminal to ask in (CI,
--agent, machine-readable output), such an operation fails withCONFIRMATION_REQUIREDunless this flag is set.--agentdoes not confirm anything.--aws-accountstringAWS Account
More about --aws-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_PROFILEor AWS credentials in environment variables, then by your saved default, then by your organization's only connected account.--aws-accounttakes precedence over all of them, but AWS credentials in environment variables must then belong to that account.--forcebooleanForce
More about --force
Deletes the dev network even while
stacktape devsessions use it, or when the command cannot check for them. Those sessions lose their connection to deployed functions. Dev functions still in the network block the deletion even with this flag.-h, --helpstringShow Help
More about --help
If provided, the command will not execute and will instead print help information.
--log-level"info" | "debug" | "error"Log Level
More about --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
More about --profile
The AWS profile to use for the command. You can manage profiles using the
aws-profile:*commands and set a default profile withdefaults set.For commands that use a connected AWS account,
--profile(orAWS_PROFILE) selects the connected account the profile belongs to, unless--aws-accountis set. The command fails if that account is not connected.--projectstringProject Name
More about --project
The name of the Stacktape project for this operation.
Commands that target a stack take it from
projectNamein the project's config when the flag is absent.--quietbooleanQuiet
More about --quiet
Hide progress, banners, success messages and hints. Command output, warnings and errors are still printed.
-s, --stagestringStage
More about --stage
The stage for the operation (e.g.,
production,staging,dev-john). You can set a default stage using thedefaults setcommand. 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.
Related commands
dev network— See the dev network, its dev box and the sessions that use it.delete— Delete a dev stage before deleting the network.dev— Start dev mode, which creates the dev network again when it needs one.