Destroy one resource

Destroy one resource and leave everything else alone

terraform destroy -target=module.vpc.aws_vpc.main

tool
terraform43 commands
tags
terraform

More terraform commands

  • terraform taint module.eks.aws_instance.node

    Mark a resource for replacement on the next apply

  • terraform state rm module.path.resource_type.name

    Forget a resource in state without destroying it in the cloud

  • terraform refresh -var-file=prod.tfvars

    Update the state file to match the real infrastructure

  • terraform graph | dot -Tsvg > graph.svg

    Draw the resource dependency graph as SVG (needs Graphviz)

  • terraform state list | grep <pattern>

    Filter the resources in state by a pattern

all 43 terraform commands