aws

http://status.aws.amazon.com/ https://www.expeditedssl.com/aws-in-plain-english
cfleming 2019-12-01T23:03:58.225900Z

Hi everyone, I’m running some CLJS in AWS Lambda, and I’m keen to automate my deployment using either serverless or AWS SAM. I’ve spent some time looking at them, and they both seem to have problems. My current attempt is using serverless, cljs-lambda (which I was already using) and serverless-cljs-plugin. This seems to work ok, except that serverless-cljs-plugin isn’t invoked when using serverless offline.

cfleming 2019-12-01T23:04:47.226600Z

I’ve tried to patch the plugin to make that happen but I can’t make it work, and there’s very little support available for serverless. Their forums and slack channel are very quiet.

cfleming 2019-12-01T23:06:29.227400Z

So I looked at AWS SAM, but from what I can tell, sam build is totally non-extensible, so I can’t even figure out how to make it compile CLJS before packaging.

cfleming 2019-12-01T23:06:43.227800Z

Has anyone done anything similar and could share some ideas?

lloydshark 2019-12-02T10:10:02.232600Z

Hi Colin, This was our experience (from a couple of years ago so things may have changed). Here's a super short summary. We used SAM. We kept our lambda build separate and published direct to S3 using standard clojurescript build tooling. We produced a separate build artefact for the SAM artefacts also published to a well defined S3 location. For the SAM template we parameterised the lambda location in S3 (based on the version number). So then for deployment we wrote some simple scripts to call cloud formation directly and reference the SAM template and the lambdas we had previously published to S3. We were in quite corporate environment so this gave us a good way to control / separate the build, deployment and promotion between environments. This system worked pretty well for us as the pieces were pretty simple. Main drawbacks with SAM was the fact that it is cloudformation so you suffer the normal issue which is needing to split up your stacks to avoid problems if you need to destroy one. ie If your critical data stores are also wrapped up in the same stack then you could be in for some trouble. This might be a lot more than you were after - but hey maybe some of this is of use depending on your context.

lloydshark 2019-12-02T10:15:28.232800Z

Tooling for SAM / Cloudformation authoring was also a bit of an issue.

mj_langford 2019-12-02T20:48:22.233200Z

@steveb8n that's a fascinating stack. Thanks for sharing, and please share with the channel the blog article if you have time to after you write it

cfleming 2019-12-02T23:24:51.233400Z

Thanks for the replies everyone, I’ll read through all that. There are tons of different approaches here, and it’s hard to figure out the pros and cons without trying them all.