Skip to content
Software Engineering Stories
Go back

Aurora for serverless Laravel

Aurora for serverless Laravel

Production Showcase ยท Source Code

The why, the how and the what

An open source, alternative to Laravel Vapor. For instructions for how to set this up, see https://stories.rdok.co.uk/posts/serverless-laravel/#setup

Use this repository to automate creating a serverless Laravel with Aurora MySQL environment.

It uses AWS SAM with GitHub CI/CD actions to create the AWS resources, including the Aurora & Laravel Lambdas.

Aurora

Aurora has the capability to auto pause after a given amount of time with no activity. During testing, it took around 30s for it to resume after paused.

Private Link VPC endpoints are a better alternative to NAT Gateways. Laravel lambdas use said private links to connect to Aurora, S3, and Secrets Manager AWS resources.

Secrets

Using IAM auth the Laravel lambda would not need to use a password when connecting to the database. This would also remove the need to rotate the database secrets. However, Aurora does not support IAM auth. Instead, SecretsManager are used.

Secrets rotation goes outside the scope of this repo. It requires creating a lambda to do so.

CI/CD

Costs


Share this post:

Previous Post
Serverless Laravel