ad4469dc-7beb-4b7f-90b1-7de.../docs/07_cleanup.md

21 lines
595 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 7) Cleanup (5 min)
Always delete resources to avoid charges.
From each working directory you used:
```bash
terraform destroy -auto-approve || true
```
If you created the S3 bucket and DynamoDB table for backend testing, remove them **after** youve destroyed all Terraform-managed resources and the state is no longer needed.
Delete S3 (must be empty first):
```bash
aws s3 rm s3://my-terraform-state-lab --recursive
aws s3api delete-bucket --bucket my-terraform-state-lab --region ap-south-1
```
Delete DynamoDB table:
```bash
aws dynamodb delete-table --table-name terraform-locks
```