radius-project / samples

Radius samples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automate RDS snapshot cleanup

willdavsmith opened this issue · comments

Today, we deploy eshop on containers with RDS DBInstances as part of our automated testing. When these resources get deleted, they create snapshots, which will cause our tests to fail if there are too many. We should write a script to automatically delete these snapshots.

This takes about ~1hr of dev time a week because leaving these snapshots causes tests to fail, which means the on-call engineer has to diagnose and delete the snapshots along with the DBInstance resources.

AB#10899

@willdavsmith Can you point me to where we are calling instance delete? Instead of writing a script to delete the snapshots post instance deletion, we should just skip the snapshot upon deletion. RDS provides this option as a part of the delete API https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DeleteDBInstance.html - see SkipFinalSnapshot option.

@willdavsmith Can you point me to where we are calling instance delete? Instead of writing a script to delete the snapshots post instance deletion, we should just skip the snapshot upon deletion. RDS provides this option as a part of the delete API https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DeleteDBInstance.html - see SkipFinalSnapshot option.

Instance delete occurs when we delete the Radius app since the DBInstances are managed by recipe. So we're calling the CloudControl delete handler, which doesn't have SkipFinalSnapshot AFAIK. If you can find a way with cloudcontrol to not create the snapshots please let me know because that would remove the need to create this script.

@willdavsmith Can you point me to where we are calling instance delete? Instead of writing a script to delete the snapshots post instance deletion, we should just skip the snapshot upon deletion. RDS provides this option as a part of the delete API https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DeleteDBInstance.html - see SkipFinalSnapshot option.

Instance delete occurs when we delete the Radius app since the DBInstances are managed by recipe. So we're calling the CloudControl delete handler, which doesn't have SkipFinalSnapshot AFAIK. If you can find a way with cloudcontrol to not create the snapshots please let me know because that would remove the need to create this script.

Ah that's bizzare, but true unfortunately. Just looked through a few docs and doesn't look like cloud control api provides an option to set additional properties on the delete request as you mentioned, and this particular property can't be set during instance creation.