Member-only story

Understanding the Terraform Destroy Process

How to execute the destruction plan using Terraform with Docker Nginx

Luca Berton
5 min readFeb 3, 2024

Introduction

In the realm of infrastructure as code, Terraform stands as a pivotal tool, enabling IT professionals to manage and provision infrastructure through code. A critical aspect of this lifecycle management is the ability to safely and effectively destroy resources that are no longer needed, ensuring cost-efficiency and alignment with organizational needs. This article delves into a practical example of using Terraform to destroy resources, specifically focusing on a Docker Nginx container and image.

Scenario Overview

In our case, Terraform is employed to manage Docker resources, namely a Docker container and image of Nginx, a popular web server. The output provided illustrates the process of destroying these resources using Terraform’s terraform destroy command. This command is a crucial aspect of infrastructure management, allowing for the removal of resources that were previously created using Terraform.

Execution Plan

Before any action is taken, Terraform generates an execution plan. This plan is essential for understanding what Terraform will do before making any changes. In our scenario…

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet