From the course: HashiCorp Certified: Terraform Associate (003) Cert Prep by KodeKloud

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Create, update, and destroy infrastructure

Create, update, and destroy infrastructure

- [Instructor] Let us now do a quick recap on how to update or destroy infrastructure resources with Terraform. Let us use the same example of the local file resource. Now to update this resource, all we need to do is to update the configuration file. In this case, we have added an extra argument to update the permission of the file to 0700. Next, we run the terraform plan to see the execution plan. A quick pointer here, terraform plan is an optional step, as the same execution plan is also displayed when we run the terraform apply command. In the execution plan, the -/+ symbol in the beginning of the resource name in the plan implies that it'll be deleted and recreated. And the line with the command that rates forces replacement shows the reason for the deletion and recreation of the resource. And in this example, this is caused by the file permission argument that we added to the configuration file. And since Terraform adheres to the concept of immutability, when we run the…

Contents