Skip to main content

Destroy Cloud Infrastructure

What you’ll learn
  • how to destroy cloud infrastructure previously deployed for project applications (possibly into multiple environments)

The destroy Command#

This command lets you destroy cloud infrastructure previously deployed within a project application.

As its first argument, the destroy command receives the path to the project application folder. You also need to specify the environment into which the cloud infrastructure was previously deployed, which is specified via the --env argument.

The following destroy commands destroy cloud infrastructure deployed for three project applications, all previously deployed into the dev environment:

yarn webiny destroy api --env dev
yarn webiny destroy apps/admin --env dev
yarn webiny destroy apps/website --env dev


Destroying my project takes a long time to finish#

We're aware of this fact, and this is mainly because of the Amazon ElasticSearch Service. While other cloud infrastructure resources get destroyed reasonably fast, this service can take anywhere from 15 to 30 minutes to destroy itself. In rare cases, we've even seen the service still present in user's account for days.

Unfortunately, this is a well-known issue for quite some time, and until the present, there haven't been any positive improvements.

Last updated on by Adrian Smijulj