This pipeline automates the deployment of a serverless infrastructure on AWS, leveraging:
- S3 for frontend hosting
- Lambda & API Gateway for backend services
- CloudFront for CDN and SSL termination
This setup provides a highly cost-effective and scalable full-stack application without the need to manage any servers.
Here's a visual overview of the architecture the pipeline will deploy:
Before you start, make sure you have:
- An AWS account.
- A user with sufficient permissions configured in your AWS CLI.
That's all you need!
Follow these simple steps to deploy your serverless infrastructure:
-
Create a Repository
Start by creating your own repository to test the pipeline. -
Clone the Repo & Set Up Credentials
Clone this repository and navigate to thesetup
folder. Run the script:./create_pipeline_creds.sh
This will create an AWS user following the principle of least privilege (PoLP), which you can use for your repository.
-
Configure GitHub Secrets
Once the script runs, it will output the necessary variables. Add these as GitHub Secrets in your repository. -
Configure the Infrastructure
Modify theinfra/variables.tf
file with your desired AWS region. By default this is set toeu-west-2
-
Push Your Code
Push the code to your repository, and watch the pipeline work!
A step by step tutorial available here.
The entire pipeline takes approximately 6.5 minutes to complete from start to finish.
Congratulations! You’ve successfully deployed a full-stack, serverless application. Feel free to use this as a template for your projects.
Enjoy building on AWS!