Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@architect/destroy

architect7.5kApache-2.04.0.5

Destroy projects created with Architect

readme

@architect/destroy

Architect serverless framework module for destroying projects created with Architect

GitHub CI status

Architect Destroy destroys Architect-generated projects. More specifically, it destroys your projects' CloudFormation Stacks, CloudWatch Log Groups, S3 bucket used during deployment, SSM Parameters added by arc env, and if called with --force (or the force param via API), destroys your DynamoDB (@tables) databases and S3 bucket housing your static assets (@static).

API

destroy({ appname, stackname, env, force, now, retries }, callback)

Destroys all infrastructure associated to your Architect app.

  • appname: the name of the Architect app in question as defined in your app.arc file.
  • stackname: the custom stack name (if specified during deployment, e.g. arc deploy --name foo)
  • env: the stage or environment name to destroy, typical values are staging or production
  • force proceeds to destroy your app even if it contains DynamoDB tables and / or an S3 bucket containing @static assets.
  • now: (boolean) immeditely destroy the app (instead of waiting the requisite 5 seconds)
  • retries: while waiting for a CloudFormation Stack to be destroyed, how many times do we ping the CloudFormation API checking if the Stack has been removed? This API is pinged every 10 seconds. If retries is exhausted, callback will be invoked with an error.

changelog

Architect Destroy changelog


[4.0.5] 2024-04-29

Changed

  • Updated dependencies
  • Updated package.json engines.node property to reflect changes from v4

[4.0.3 - 4.0.4] 2024-03-25

Changed

  • Updated dependencies

Fixed

  • Fixed error destroying an app that did not deploy correctly the first time

[4.0.0 - 4.0.2] 2024-01-08

Changed

  • Transitioned from aws-sdk to aws-lite
  • Added Node.js 20.x to test matrix
  • Breaking change: removed support for Node.js 14.x (now EOL, and no longer available to created in AWS Lambda)

[3.0.13] 2023-08-14

Changed

  • Updated dependencies

[3.0.10 - 3.0.12] 2023-04-22

Changed

  • Updated dependencies

[3.0.9] 2023-01-18

Changed

  • Updated dependencies

[3.0.8] 2022-11-24

Added

  • Added Node.js 18.x to test matrix

Changed

  • Updated dependencies

[3.0.6 - 3.0.7] 2022-09-07

Changed

  • Updated dependencies

[3.0.5]

Fixed

  • Deleting a named stack no longer deletes staging environment SSM params

[3.0.4] 2022-07-26

Changed

  • Updated dependencies

Fixed

  • Fixed issue where destroying an environment with >9 env vars would fail; fixes #1351, thanks @pgte!

[3.0.3] 2022-05-10

Changed

  • Updated dependencies; sub-dep lambda-runtimes adds nodejs16.x.

[3.0.2] 2022-03-31

Changed

  • Updated dependencies

[3.0.1] 2022-02-24

Fixed

  • Fix error reporting when run from arc (and not as standalone)

[3.0.0] 2022-01-23

Changed

  • Breaking change: bare CLI arguments (e.g. destroy force) as aliases to flags are no longer used
  • Stop publishing to the GitHub Package registry
  • Updated dependencies

[2.0.3] 2021-11-16

Changed

  • Updated dependencies

[2.0.2] 2021-10-12

Changed

  • Updated dependencies

[2.0.0 - 2.0.1] 2021-07-22

Changed

  • Breaking change: removed support for Node.js 10.x (now EOL, and no longer available to created in AWS Lambda) and Node.js 12.x
  • Breaking change: the --name flag can no longer be used in place of --app to destroy apps; --app must now be used to destroy apps, while --name may only be used to destroy stacks; fixes #1165
  • Updated dependencies

[1.2.5 - 1.2.6] 2021-06-21

Changed

  • Updated dependencies

[1.3.0] 2021-06-22

Added

  • Added a --no-timeout flag, which causes destroy to wait until the CloudFormation Stack is deleted before exiting

Changed

  • destroy now pings the CloudFormation API to check for Stack deletion every 10 seconds (instead of increasingly backing off starting from 10 seconds to 60 seconds)

[1.2.4] 2021-06-09

Changed

  • If the CloudFormation DeleteStack operation detects that the Stack has a status of DELETE_FAILED, it will now report this, along with the status reason, and exit with a non-zero code rather than wait for the destroy command timeout to run out; this fixes #1156
  • destroy will now exit with a non-zero code if any errors are raised during its execution

[1.2.3] 2021-06-04

Fixed

  • Fixed failing destroy operations when CloudFormation Stack was already deleted; this fixes #1155

Changed

  • Detection of resources that require use of the --force flag is now done sooner, so as to fail faster in the case the flag is needed

[1.2.2] 2021-05-24

Added

  • Use of latest architect inventory for plugins support.

[1.2.1] 2021-05-24

Fixed

  • Fixed failing destroy operations when app doesn't have any SSM parameters (which is unusual, but possible in certain circumstances)

[1.2.0] 2021-04-30

Added

  • Added support for custom stage names (aka stack names), fixes #1055; thanks @filmaj + @ryanbethel!
  • Added --now CLI flag in case you just like really need to destroy stuff right. now.

Changed

  • Specifying the app to destroy, formerly the --name CLI flag, should now be used as --app
    • --app and --name can now be used together

[1.1.1] 2021-04-12

Fixed

  • Made S3 bucket removal idempotent: if buckets do not exist when attempting to clear/remove them, don't throw an exception.

[1.1.0] 2021-02-28

Added

  • destroy now wipes out any CloudWatch logs, SSM Parameters added by arc env (for the specific environment being destroyed) and wipes and deletes the deployment bucket used during CloudFormation deploys.

[1.0.5] 2021-02-26

Changed

  • Emptying out S3 bucket contents now supports buckets that contain more than 1,000 objects.

[1.0.4] 2020-12-04

Changed

  • Updated dependencies

[1.0.3] 2020-11-22

Changed

  • Implemented Inventory (@architect/inventory)
  • Updated dependencies

[1.0.2] 2020-06-22

Added

  • Say hello to @architect/destroy!
  • Fixed src/cli to export a function
  • Fixed src/cli to only show banner if being run standalone

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.