O'Reilly logo

Getting Started with Terraform - Second Edition by Kirill Shirinkin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Destroying everything we've built

Destroying infrastructure with Terraform is as, easy as or even easier than, creating it. All you need to do is to run the terraform destroy command, as shown here:

    $> terraform destroy
    Do you really want to destroy?
      Terraform will delete all your managed infrastructure.
      There is no undo. Only 'yes' will be accepted to confirm.
      Enter a value: 

Terraform is nice enough to ask you for a confirmation, in case you typed the terraform destroy command by accident:

    aws_instance.hello-instance: Refreshing state... (ID: i-06f88fe6a2b4307b8)
    aws_instance.hello-instance: Destroying...
    aws_instance.hello-instance: Still destroying... (10s elapsed)
    aws_instance.hello-instance: Still destroying... (20s elapsed)

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required