3. Delete Resources
If we want to destroy the instance that we created, we can use the command
terraform destroy
Keep in mind that by default it destroys all the resources specified in the config file
To delete a single resource, specific flags must be passed to the command
In the previous example, if we want to delete the ec2 instance without using
terraform destroy
command, then, we will comment out the ec2 resource and re apply the config. Terraform will figure it out and delete the ec2 instance for us
Last updated