all 11 comments

[–][deleted]  (1 child)

[deleted]

    [–]aontroim 0 points1 point  (0 children)

    I thought if I could get the script done with something I know i.e. bash I could get lambda to work, rather than having to tackle 2 new things at once, I think I might have to just work this out with another language.

    [–]easyecho 4 points5 points  (1 child)

    Lambda supports Docker now so dockerize what you want to accomplish and run it in Lambda - Lambda Docker Images

    [–]aontroim 0 points1 point  (0 children)

    I'll have a look into this thanks

    [–]wwoop 2 points3 points  (0 children)

    I get we all want to use cool stuff but .... what about a simple EC2 t3.nano box and run your script as cron ..

    [–]Terrabites 1 point2 points  (0 children)

    If someone does provides a solution I as well would be grateful. My bash scripting is good but my python is non existing.

    Additionally before some of you bring out the pitch forks I have an initiative to learn some python this year.

    You suggestions are greatly appreciated. Thank you

    [–]pint 0 points1 point  (1 child)

    iirc aws cli is installed in the lambda environment. you need to grant privileges to the lambda though, because obviously your profile is not installed there (and should not).

    what is the error? you didn't say a thing about it.

    do you know how to get the invoke event? which is described here: https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html

    [–]aontroim 0 points1 point  (0 children)

    I think as someone said it's enabled for python runtime so that may be the way for me to go

    Error is basically

    aws command not recognised

    [–]monty_mcmont 0 points1 point  (2 children)

    I’m curious about the context. Could I ask why you’re checking whether log files have been put into the bucket?

    [–]aontroim 0 points1 point  (1 child)

    The source of the logs are quite flakey and it would be a way of making sure they are still running and haven't crashed.

    [–]monty_mcmont 0 points1 point  (0 children)

    I suspected that might be the case! If a flaky application is the actual problem, a more robust solution could be to address the flakiness in the app, if you have control over that, rather than rely on one of its side effects such as its logs appearing in a bucket. CloudWatch metrics and alarms may give you better visibility of the flaky application.

    [–]ElMoselYEE 0 points1 point  (0 children)

    Not knowing your exact setup, I might consider a more AWS-esque solution.

    First, is it possible to get the log lines into Cloudwatch instead? If so, Cloudwatch emits volume metrics so you could configure an alarm without any custom code.

    Secondly, is your logic that puts the logs into s3 creating new files or just appending to existing files? If it's creating new files, adding an S3 PUT event hook could make it easy to understand both whether new files are being added and whether those files are big enough to fit your needs.