Closed sigurdknippenberg closed 5 years ago
I have the same question . The table keeps on growing . Is there a reason to keep it like that ?
I stuck the following right at the end of the lambda_handler()
function (line 267), looks to be doing the job for now:
# Clean up DynamoDB after deleting records
if state != 'running':
table.delete_item(
Key={
'InstanceId': instance_id
}
)
Fixed in #29
I noticed that when an instance is shutdown or terminated that the script doesn't remove the record from DynamoDB after it has removed the records from route 53 and the table slowly keeps growing with instance ids that are no longer used.
Is there a particular reason that the records are not removed? Or is this an oversight?