$ ./terraform plan
Refreshing Terraform state prior to plan...
aws_instance.example: Refreshing state... (ID: i-dbf2e9f0)
No changes. Infrastructure is up-to-date. This means that Terraform
could not detect any differences between your configuration and
the real physical resources that exist. As a result, Terraform
doesn't need to do anything.

インスタンス終了

インスタンスを破棄するときも、まずは plan を行う。今回は対象となる既存の環境を破棄 -destroy したいので、次のように作成。

$ ./terraform plan -destroy -out=./terraform.tfplan
Refreshing Terraform state prior to plan...
aws_instance.example: Refreshing state... (ID: i-dbf2e9f0)
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.
Your plan was also saved to the path below. Call the "apply" subcommand
with this plan file and Terraform will exactly execute this execution
plan.
Path: ./terraform.tfplan
- aws_instance.example