genevieve / leftovers

Go cli & library for cleaning up orphaned IAAS resources.
Apache License 2.0
149 stars 22 forks source link

Clarify logging when removing Route53 records #104

Open e1ven opened 3 years ago

e1ven commented 3 years ago

When leftovers detects a matching A record inside of a non-matching Route53 zone, the log is potentially ambiguous about what will be removed.

For example, if we create a zone example-shared-zone.com. Within that zone, we create an A record of single-record.example-shared-zone.com. 300 IN A 1.2.3.4

Leftovers will display the message:

$ leftovers --iaas=aws --filter single-record
[Route53 Hosted Zone: example-shared-zone.com.] Delete? (y/N): y
[Route53 Hosted Zone: example-shared-zone.com.] Deleting...
[Route53 Hosted Zone: example-shared-zone.com.] Deleted!
$ 

Similar behavior is demonstrated when running in --dry-run mode:

$ leftovers --dry-run --iaas=aws  --filter single-record
[Route53 Hosted Zone: example-shared-zone.com.]
$ 

The output could be interpreted as saying it will delete the whole zone, but from testing it will only delete the record (as desired/expected).