aws-amicleaner icon indicating copy to clipboard operation
aws-amicleaner copied to clipboard

Support for AWS Lambda Python 3.6

Open egeloen opened this issue 5 years ago • 4 comments

Hey!

First, thanks for your library, it saves me some times :)

For the background, we have integrated this library in a Lambda function triggered periodically. To do it, we use: https://gist.github.com/egeloen/6fb87773a6e0b548b02a0394f4d4851a with a CloudWatch event.

Everything is working fine when using Python 2.7 but when trying to upgrade to Python 3.6, we faced an issue. Basically, on the Python 2.7 runtime, AWS have compiled Python with curses but for Python 3.6 they didn't. So, we can't upgrade as this library relies on blessings which relies on curses.

Since I'm not a Python guy, I'm not sure what is the best option here. What would you advice?

egeloen avatar Sep 13 '18 18:09 egeloen

Hello, I wrote also the amicleaner as a Lambda function.

I use python 3.6 with no issues. The catch here is that the blessings library is used for colored logs. In the case of a Lambda function, logs are written to Cloudwatch and so not colored.

I removed the blessings library and implentations and it works juste fine !

I also added options to filter ressources --include-mapping-values, statistics (number of gb to be removed) and also the logging of what will be deleted, i'm working on uploading my fork soon if you're interested.

All the resources are deployed via a Cloudformation stack, with parameters of the concerned mapping values, retention days, excluding mapping values, dryrun and more

MacPower avatar Oct 02 '18 10:10 MacPower

@MacPower did you ever upload your fork?

anjo-swe avatar Dec 24 '18 18:12 anjo-swe

@anjo-swe I did not for now, but I'll soon

MacPower avatar Jan 07 '19 16:01 MacPower

I have to check with my company rules before, but I did not forget !!

MacPower avatar Jan 15 '19 17:01 MacPower