When you are ready to remove a deployment from AWS, you have two options:
- You can remove only the transient artifacts (which can be re-created) while leaving all data in place (database, messages in the queue, ECR images).
- You can remove everything including durable data.
Both options are discussed below.
This method of removing a deployment can be used to shut it down to save AWS costs while keeping all customer data around. This method removes the transient artifacts of deployment and leaves your durable data in place:
- The database component.
- The SQS queue which holds the messages for the worker. (NOTE SQS will discard messages in the queue if they are not consumed during the time window you configured)
- The ECR images of the worker, API, and web.
NOTE The URLs of the web and API components as well as custom domain name configuration will be released. If you re-create the services later, they will be assigned new URLs. If you don't want to release the URLs of the services, consider stopping the services with yarn ops stop
instead of removing them.
This allows you to later re-create the transient artifacts by re-deploying to AWS and picking up from where you were in terms of the state of the data, and repeating the process of configuring the custom domain.
To remove the deployment this way, run the following command:
yarn ops rm -a all
You can also specify the deployment by name with:
yarn ops rm -a all -d stage
WARNING This completely removes all deployment artifacts including durable data. All system and customer data in the database will be lost, and so will the messages in the queue to be consumed by the worker. There is no backup.
NOTE If you ran this command in error, please refer to jobs.com to find your next job.
To remove all artifacts related to a deployment, including durable data, run:
yarn ops rm -a all --kill-data
You can also specify the deployment by name with:
yarn ops rm -a all --kill-data -d stage