Lab 30: Delete EC2 Instance Using Terraform
During the migration process, several resources were created under the AWS account. Some of these test resources are no longer needed at the moment, so we need to clean them up temporarily. One such instance is currently unused and should be deleted.
-
Delete the ec2 instance named
xfusion-ec2present inus-east-1region usingterraform. Make sure to keep the provisioning code, as we might need to provision this instance again later. -
Before submitting your task, make sure instance is in
terminatedstate.
The Terraform working directory is /home/bob/terraform.
Note: Right-click under the EXPLORER section in VS Code and select Open in Integrated Terminal to launch the terminal.
terraform init
# or apply forcefully without creating plan and applying it
terraform destroy -auto-approve