The why, the how and the what
Use this repository when you want to automate creating a serverless Laravel environment.
It uses AWS SAM to create the AWS resources including:
- Route 53 entries && SSL certificates
- API Gateway for Lambda & Artisan
- Assets S3 bucket for static files
- Storage S3 bucket for internal files
It also makes use of GitHub actions for CI/CD automation.
- Fork rdok/serverless-laravel template
- Update the repository secrets with AWS credentials & others.
- Update environment variables of artisan.yml & deploy.yml.
- The IAM policies required for the CI/CD user are outside the scope of this post. However, you can reference the automated policies for the showcase here.
- Deploy using Deploy Github action.
- Run artisan commands using the Artisan GitHub action.
To automate the creation of the subdomain & it’s certificate.
An existing base domain & wild card certificate.
The following Laravel features will be supported in future posts:
- Aurora serverless MySQL database
- Broadcasting through SNS
- Job dispatching through SQS
- Scheduling through additional Lambda
Instruct Laravel how to load static assets & access storage bucket:
CloudFront only supports ACM certificates in the US East (N. Virginia) Region. As such, a separate stack is created in the
Instruct Laravel to properly get AWS credentials by adding the AWS session token:
CI/CD uses AWS SAM to build & deploy AWS resources: