- 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.
- 同仁眼整形眼眶病診療手冊(cè)
- 腫瘤營(yíng)養(yǎng)診療規(guī)程
- 2021中國(guó)腫瘤登記年報(bào)(漢英)
- 角膜上皮細(xì)胞功能障礙診療圖解(眼表疾病臨床系列)
- 慢性腎臟病診療與保健
- 臨床檢驗(yàn)一萬(wàn)個(gè)為什么:病原檢驗(yàn)分冊(cè)
- 醫(yī)院醫(yī)療質(zhì)量標(biāo)準(zhǔn)化管理手冊(cè)
- 前列腺癌標(biāo)準(zhǔn)數(shù)據(jù)集(2021版)
- 結(jié)核病影像學(xué)
- 媽媽寶寶口腔保健
- 會(huì)保養(yǎng)的女人年輕20歲
- 口腔微距攝影速成
- 與癌共舞
- 臨床急癥介入治療學(xué)
- 中國(guó)腫瘤心理臨床實(shí)踐指南(2024)