jckuester / awsweeper

A tool for cleaning your AWS account
Mozilla Public License 2.0
468 stars 45 forks source link

Add Check for AWS Account ID Before Running #58

Open jaloren opened 4 years ago

jaloren commented 4 years ago

A common scenario in AWS deployments is to have a production account and a test account. To ensure that the deployment is only run against the test account, it would be really helpful if the awsweeper could check the account id passed in on the command line or environment variable and then verify that the credentials its using are for that account. If they don't match, then fail before executing.

If this feature sounds worthwhile, I'd be happy to submit a PR for it.

jckuester commented 4 years ago

Hi @jaloren :wave: Sounds like good idea! Go ahead if you like and do a PR.

I usually have account profiles in ~/.aws/credentials with the name prod or dev. This isn't sufficiently safe for you?