nib-health-funds / robin

AWS ECR cleaning super hero
MIT License
6 stars 3 forks source link

ECR Repositories should be configurable. #3

Open willfalconer opened 7 years ago

willfalconer commented 7 years ago

Load repositories from an env var

ramesius commented 7 years ago

What do we think about having robin be an 'opt-out' feature rather than 'opt-in'. We should be able to pull all repos from the api and just iterate over that. Than the config value could be an exclusion list for repos we do not want to delete images from.

willfalconer commented 7 years ago

I agree, that is probably the best way forward. Lets build a little confidence with the repos we are testing on. Then roll it across all repos by default.

The opt out list should be configurable outside of handler.js though. I was thinking maybe using Env vars or a separate config file that we can then reference inside the serverless.yml file.

ramesius commented 7 years ago

Agreed. A config file might be the way to go here. I am thinking a json file that contains an array of strings. Then the yml file having a reference to that config file.

exclusions.json

[ "repo1", "repo2" ]

serverless.yml

environment:
    EXCLUSIONS: exclusions.json
willfalconer commented 7 years ago

that sounds ideal

willfalconer commented 7 years ago

Maybe this configuration file could also contain things like the account id, aws region and slack webhook url?

ramesius commented 7 years ago

Yeah, I wouldn't mind doing something along the lines of loading config from env vars as well as a config.json, just need to choose which takes precedence.