My experiment of deploying my website via AWS Lambda and Hugo has been abandoned and chalked up as a productive failure. Instead of AWS Lambda, I’ve moved to a more traditional CI/CD (Continuous Integration/Continuous Delivery) pipeline using Atlassian Pipelines.
Lambda seems to be quite reliable for the right tasks. The more short lived, but the better it is. I trust it would make 10,000 function executions a day without a sweat. It was my code which wasn’t reliable. At first I implemented it using state stored in a file on S3. Functions are best when stateless so introducing state introduced complexity.
Lambda has a ways to go when it comes to client side development environments. As far as I know, a develop cannot reliably spin up a container which is identical to the Lambda containers and execute it locally for testing. Instead, I was using serverless which helped quite a bit, but didn’t support all of the Lambda features.
CodeCommit is fine as a Git repository. If I had to use it full time, I’m sure it would get the job done. But GitHub, GitLab, and BitBucket all are better websites. CodeCommit does shine when it comes to integration with AWS products though.
If performance of the Lambda function was good, I probably would make it work. But I found file transfers to be slow. Lambda function execution itself is fast. But a full deployment workflow did four transfers: CodeCommit to Lambda, Lambda to S3, S3 to Lambda, and Lambda to S3. My function execution timeout was set to 60 seconds for the first two transfers which seemed ridiculous.
Atlassian Pipelines is simple to setup as long as you have a couple of hours for experimentation. You create a
bitbucket-pipelines.yml file in the repository root and enable the feature in the BitBucket website. The interface could use some work. For example, discovery variable options isn’t great. But in a couple of hours, I had a fully operational, albeit short, CI/CD pipeline. This is also my first foray into CI/CD so it’s a good learning experience, just as Lambda was.
I’m not opposed to using Lambda for other projects in the future. I am confident a task will come up which is short lived and appropriate. But for now, the website is created on BitBucket and uploaded to S3.