Live data from Hacker News

Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

serverless.com

31–40 of 48 posts

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#31

Earlier quoted context omitted.

Yeah, they said its "serverless" but it requires an AWS lambda function. I use Jekyll for my blog but I simply commit, push, and run a script that copies the files to S3. https://www.tberra.com/aws/amazon/meta/2016/11/12/the-birth-... its not scheduled but I could easily tell linux to run that command once at whatever time I wanted.

AWS lambda functions __are__ serverless. There's no notion of uptime, provisioning or managing servers when using lambda.

> There's no notion of uptime, provisioning or managing servers when using lambda.

There's no notion of uptime, provisioning or managing Web sites when using Web sites; but the operators of the Web site certainly have to tackle such things.

Likewise, I'm sure the operators of AWS lambda are very much concerned about such things, even if the users aren't.

In that sense, wordpress.com is "serverless".

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#32
post #8

This solution is sort of weird to me. To me, the allure of a static site or a static blog is to simplify the stack; To bring it back to the basics. Static HTML served by a good ole-fashion web server. Adding the cognitive burden of "serverless" and/or lambda just to schedule seems to complicate something that isn't very complicated. Its almost like an invented problem. That said, long live this static site generator…

A possible goal is to have the serving stack be as simple as possible.

After all, you can argue that the publishing-side stack is anyway very complex: it includes e.g. the Github UI, if one makes edits using the Github UI.

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#33
post #18

Instead of hourly polling, which I find quite inelegant, couldn't you trigger creation of new schedule rule with the correct time that then triggers the publishing?

Hey zokier. Thanks for the comment. In theory yes. I could provision a new function with an exact cron schedule to run once and then tear itself down. In practice, this is a lot of extra logic to write to achieve this and would also potentially make own AWS account rather messy. The hourly cron runs about 720 times a month which is far below the 1,000,000 free invocations that lambda provides under their free tier.

How about using the new AWS Step Functions instead? This would allow a full push model while still keeping a nice and tight workflow:

1. fire off AWS Step function on new post to S3 bucket

2. read delay / schedule time in metadata from (assumable) markdown post

3. trigger AWS Step Function using the Wait State defined based on read value from 2.

4. As part of Step Function: After Wait State -> Execute Lambda to publish post.

Note: 3) requires setting variable time in Wait State based on environment. Haven't read up so don't know if that's possible, but guess it should be.

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#34

Earlier quoted context omitted.

Does this not seem excessive? Doesn't anyone care about simplicity, or elegance, or -- at minimum -- not relying on others?

>not relying on others Avoiding AWS based solutions to "not rely on others" is like using a kerosene lamp in the center of Manhattan. You may be more self sufficient, but.... why?

Recent AWS outages come to mind...

... as for self-sufficiency, why not? You're trading freedom and independence for serfdom in Amazon's little kingdom. They'll seduce you with shit exactly like this -- stringing together pointless, useless services to achieve an end that in actuality requires 999999999% less machinery than what they sold you -- to make sure your next project is with them and all their comfy little tools at something 2x to 3x the price. The collective knowledge of running servers represented by a federated, disparate group of specialists slowly drains away from public access, only to re-coalesce behind private walls to enrich a bunch of greedy, already-rich fucks instead of the general public. (You can already see this in the declining quality of google results for technical queries)

Meanwhile lots of good admin guys lose their jobs and the world of software development continues its transformation into a cesspool of spoiled brat devs begging, neigh CRYING for Bezos/Nadella/etc to wipe their ass for them.

Welcome to the future! I'll take my self-sufficiency...

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#35

Earlier quoted context omitted.

AWS lambda functions __are__ serverless. There's no notion of uptime, provisioning or managing servers when using lambda.

> There's no notion of uptime, provisioning or managing servers when using lambda. There's no notion of uptime, provisioning or managing Web sites when using Web sites; but the operators of the Web site certainly have to tackle such things. Likewise, I'm sure the operators of AWS lambda are very much concerned about such things, even if the users aren't. In that sense, wordpress.com is "serverless".

This is really just a semantic argument. You're free to call it Function as a Service or FaaS if you want.

Hosted WordPress is SaaS but not FaaS.

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#36
post #33

Earlier quoted context omitted.

Hey zokier. Thanks for the comment. In theory yes. I could provision a new function with an exact cron schedule to run once and then tear itself down. In practice, this is a lot of extra logic to write to achieve this and would also potentially make own AWS account rather messy. The hourly cron runs about 720 times a month which is far below the 1,000,000 free invocations that lambda provides under their free tier.

How about using the new AWS Step Functions instead? This would allow a full push model while still keeping a nice and tight workflow: 1. fire off AWS Step function on new post to S3 bucket 2. read delay / schedule time in metadata from (assumable) markdown post 3. trigger AWS Step Function using the Wait State defined based on read value from 2. 4. As part of Step Function: After Wait State -> Execute Lambda to publi…

This is the correct answer.

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#38
post #33

Earlier quoted context omitted.

Hey zokier. Thanks for the comment. In theory yes. I could provision a new function with an exact cron schedule to run once and then tear itself down. In practice, this is a lot of extra logic to write to achieve this and would also potentially make own AWS account rather messy. The hourly cron runs about 720 times a month which is far below the 1,000,000 free invocations that lambda provides under their free tier.

How about using the new AWS Step Functions instead? This would allow a full push model while still keeping a nice and tight workflow: 1. fire off AWS Step function on new post to S3 bucket 2. read delay / schedule time in metadata from (assumable) markdown post 3. trigger AWS Step Function using the Wait State defined based on read value from 2. 4. As part of Step Function: After Wait State -> Execute Lambda to publi…

Hey gbrits. Thanks for the comment.

This looks like a great alternative solution!

Haven't messed around with step functions yet but was looking into it today after I found this https://www.youtube.com/watch?v=9MKL5Jr2zZ4&t=226s

Are you using step functions for other flows?

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#39

Earlier quoted context omitted.

>not relying on others Avoiding AWS based solutions to "not rely on others" is like using a kerosene lamp in the center of Manhattan. You may be more self sufficient, but.... why?

Recent AWS outages come to mind... ... as for self-sufficiency, why not? You're trading freedom and independence for serfdom in Amazon's little kingdom. They'll seduce you with shit exactly like this -- stringing together pointless, useless services to achieve an end that in actuality requires 999999999% less machinery than what they sold you -- to make sure your next project is with them and all their comfy little t…

Pointing at a service with 99.99% uptime and claim the outages as a reason to go elsewhere? Host it yourself and hit that same uptime target. I'll be impressed.

AWS isn't built for little static sites. It is built to host Amazon. And others likewise as big. The ability to do neat toys like this at a low cost, utilizing far more machinery than you would ever need to for such small project, is a happy byproduct.

> Meanwhile lots of good admin guys lose their jobs

Don't go all union-y on me! Frictional Unemployment is unavoidable. The reality is that services like AWS free up all those clearly intelligent (by virtue of being "good") admins to utilize their intellect elsewhere. We live in the age of the STEM shortage. If you can work a computer and can be described as "good", I won't worry for you.

FWIW, it's "nay" not "neigh"

Re: Static Site Post Scheduler: Using AWS Lambda and Serverless to Schedule Blog Posts

#40
I used Serverless back in the v0.5 days, picked it up again yesterday for another project. I have to say, the current version has improved vastly, from project architecture to ease of use (remember all those `json` files?!) and also documentations! Not to mention the provider support it now has. I like the idea of Serverless, and now I love it even more!
Post reply on HN