From the course: Introduction to Terraform on Azure

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Destroy resources with CI/CD

Destroy resources with CI/CD

- [Instructor] We've built powerful Terraform deployments with CICD pipelines. Now it's time to implement a safe way to tear down environments when needed, without accidentally destroying our production resources. The simplest approach, which is commenting our models, has a major flaw. Our pipeline will destroy resources in all environments, including production. So we need to implement a safe way to destroy our resources. Navigate to your Azure pipelines. And on the right side, click the LFCs and select the dates. I'll hide the assistant. And after the PR section, I'll pace two parameters. These dwell parameters ensure deliberate action. You must select an environment and type destroy in all caps to proceed with the terraform destroy oppression. Notice the environment to destroy parameter limits choices to only dev and staging, while production is deliberately excluded. This is done to prevent accidental execution. Now I'll scroll to the end of this file and create two new lines and…

Contents