- Learning DevOps
- Mikael Krief
- 249字
- 2021-06-24 12:32:07
Using destroy to better rebuild
One of the steps in the life cycle of an infrastructure that is maintained by IaC is the removal of the infrastructure because, let's not forget that one of the objectives and benefits of IaC, is to be able to make rapid changes to an infrastructure but also create environments on demand. That is to say, we create and keep environments as long as we need them, and we will destroy them when they are no longer used and hence allow the company to make financial savings.
To accomplish this, it is necessary to automate the removal of an infrastructure in order to be able to rebuild it quickly.
To destroy an infrastructure previously provisioned with Terraform, execute the following command:
terraform destroy
The execution of this command gives the following output:

This command, just as for apply, requires confirmation from the user before applying the destruction:

Once validated, wait for the confirmation message that the infrastructure has been destroyed.
The destroy command only destroys the resources configured in the current Terraform code. Other resources (created manually or by another Terraform code) are not affected. However, if our Terraform code provides a resource group, it will destroy all of its content.
We have just seen that Terraform also allows us to destroy resources on the command line. Let's now look at how to format and validate your Terraform code.
- 兒童心理障礙診療學(xué)
- 同仁眼整形眼眶病診療手冊(cè)
- 門診患者健康教育手冊(cè)
- Hands-On RESTful Web Services with TypeScript 3
- 健康快車的故事
- 癲癇的診斷與治療:臨床實(shí)踐與思考
- 狡猾的細(xì)胞:癌癥的進(jìn)化故事與治愈之道
- 臨床醫(yī)學(xué)專業(yè)綜合改革的探索
- Mastering Metasploit
- 梅毒實(shí)驗(yàn)室診斷技術(shù)與質(zhì)量控制
- 重癥肌無力中西醫(yī)結(jié)合臨床實(shí)踐
- 膜性概念神經(jīng)外科學(xué)
- 循證老年病學(xué)
- Android Studio 4.0 Development Essentials(Java Edition)
- 臨床麻醉難點(diǎn)解析(第2版)