mlevit / aws-auto-cleanup

Programmatically delete AWS resources based on an allowlist and time to live (TTL) settings
MIT License
496 stars 55 forks source link

Update DynamoDB whitelist Table #95

Closed DesAWSume closed 2 years ago

DesAWSume commented 2 years ago

Whitelist table seem to be adding but not able to remove For example, Adding new resource to the whitelist works fine, but if we update the resource through json, it did not seem to be updated

mlevit commented 2 years ago

Hey @DesAWSume, when you say you update the resource through JSON, what exactly do you mean? Can you please give an example with screenshots to help me understand?

DesAWSume commented 2 years ago

Hey @mlevit, thank you for the prompt reply,

Through the whitelist JSON file, we can define what resource we skip. As the time changed, we might have different requirement where we need to update those,

For example: We can add a iam role iam:role:xxxxxx

and we push the update to AWS, this will add a item in DynamoDB

But if we remove a whitelist resource from whitelist, we comment out the block and then pushed the update DynamoDB whitelist table still keep the old resource.

I am thinking maybe we need to add a logic to also update the dynamoDB whitelist table like the settings as well

what is your thought on this?

mlevit commented 2 years ago

Ah right. The auto-cleanup-whitelist.json file that you're modifying is a one time use for the setup of the whitelist table. It should not be used to then add resources to the whitelist.

Instead, you need to install the API and WEB components of AWS Auto Cleanup. This will enable you to add, update, and delete all whitelist operations through an easy to use web interface.