current status: learning how to deploy a serverless function directly to aws lambda to save money 😅
37 replies
-
@cthos appreciate it!
@zachleat haha I’ve done the same. It’s crazy how many dev tooling subscriptions can be replaced by getting good with GitHub actions & scripting.
@chrisarter whew, yeah! lots of amazon resellers out there, too
@zachleat Have you looked at serverless framework? https://www.serverless.com/
Really handy.
Unless by 'directly to lamdba' you don't want a middleman... In which case ignore this.
@jamesdoc no—hard to know if it will save me money or not based on the pricing page
@zachleat That is one of the hardest questions in serverless.
Serverless framework doesn't need the paid element; it's a yml config which sets up lambda, deploys, etc. You can trigger it locally, or through a GitHub action, etc.
@jamesdoc ah yeah—I’m currently in the “I have a production project that is costing more than I’d like due to usage levels and I want to try to reduce costs” phase
in order to upload a file to amazon you need to create an s3 bucket, sure.
the one thing we know for sure is that uploads over 10MB will tax the amazon upload process beyond scalable comprehension
in order to use that file from your bucket in your lambda as a layer it needs to be in the same aws region, sure.
the one thing we know for sure is that servers are not allowed to communicate outside of their municipality
-
@cory ISOMORPHIC NODE_MODULES coming soon in jordan peele’s newest film
S3
C
Rules
Everything
Around
Me
@zachleat I went down this rabbit hole before and it's definitely a slog to get something working and AWS does nothing to help along the way, but cloudformation was an ok way to make progress and document the service.
Once I got it working it was fairly reliable.
@matt well where was this advice an hour ago 😅
(I’ll have a look, thank you!)
@zachleat This is my basic ass project that has a few lambda functions: https://github.com/gauntface/focus-api/blob/main/template.json
If you find any nicer options / improvements please let me know.
@zachleat the “inf” directory of https://git.genehack.net/genehack/auto-tooter has a minimal terraform configuration that does exactly that. Happy to answer questions about it.
@zachleat just so I understand this: you’ve historically used paid-for services which deploy to AWS for you? There is a useful middle ground between this and using SAM and the AWS sdk directly; stuff which runs on your machine. (Apologies if this is condescendingly obvious and you know it!) I used to use sls, but they increasingly want you to use their service: instead, I recommend architect at https://arc.codes. It’s nice, and the team (@brianleroux, @macdonst) are helpful :)
@brianleroux @sil @zachleat gawd yes! As someone who has been banging his head up against cloud formation for 2 days please let us help save you that pain.
@macdonst @brianleroux @sil I will definitely be learning more about this approach! I’m learning the painful way first because I’m broken inside 😅
@zachleat @brianleroux @sil same 😂