Skip to main content

Section 3 - Clean Up

After completing the above steps you should tear down all the resources created. This saves the business money and helps prevent floating resources.

To roll back, do the following.

  • To find your resources in the azure portal, look at the ‘plan’ step of your first successful terraform apply run. Your resources for the first part of the golden path are located here lab_rg_name = "labs-rg-YOURNAME-DATE"

Removing Part 1 resources (local terraform run):

  • If you ran the labs-azure-resource from your local machine, you have a local statefile. Execute the command below to tear the resources in your resource group
 terraform destroy

❗️Make sure your account is still set to the DTS-SHAREDSERVICES-SBOX subscription as described in Step 1 above

Removing Part 1 resources (AZDO Pipeline terraform run):

  • If you used the CI/CD pipeline then you can destroy via the devops pipeline or simply remove the terraform resources in the TF files and commit, then running ‘Apply’ will align the infrastructure to the new desired state (empty).

❗️Check the items being destroyed are the ones you intend to remove.

az login
kubectl get pods -n labs #shows pods in labs namespace
kubectl delete pod <NAME OF YOUR POD> -n labs
  • You need to disassociate the PIP Azure Firewall created from the firewall

Azure Firewall disassociate PIP AzFw disassociate pip

  • Verify that all the resources no longer exist.
This page was last reviewed on 4 August 2023. It needs to be reviewed again on 4 October 2023 by the page owner platops-build-notices .
This page was set to be reviewed before 4 October 2023 by the page owner platops-build-notices. This might mean the content is out of date.