Prerequisite: The same prerequisites that are required to deploy the infrastructure are also needed on the machine from which you plan to remove the infrastructure, see Setup requirements.
CAUTION:
Prior to destroying the infrastructure, ensure that you have a backup, as all components, including data, will be destroyed when you run the destroy command.
- Navigate to the
infra/aws/config
folder.Note: If you want to destroy the infrastructure from the first deployment that you created, but you have created subsequent deployments that you do not want to destroy, run the following command before completing step 2:terraform state rm module.eb.aws_elastic_beanstalk_application.dqplus
- Run the following command:
terraform plan -destroy -out=destroyplan --var-file=
dqplus.tfvars
vars.auto.tfvars
&& terraform apply destroyplan
Note: If you are not using the same machine that you used to create the infrastructure, ensure that you are running the destroy command in theinfra/aws/config
directory, and that you have copied the four files that were created after deploying the infrastructure into this location (see step 7 in the "Creating the infrastructure" topic). - When asked if you want to proceed, type
yes
.
Tip: If you receive an error, try repeating the above steps to rule out the possibility of a transient network issue.