A complete starter kit to get your project live on AWS in minutes and a CICD pipeline to allow you to move quickly
Get live in minutes with a complete stack: react front end, lambdas, infrastructure and CICD pipeline.
Everyone wants to focus on the idea and not setup / config fiddling. A react front end with lambda backend is a common pattern for building web applications / startups. However, there is hours/days of setup to create a complete and robust setup.
Awsboilerplate attempts to provide a complete and integrated boilerplate solution:
Live Demo includes the react front end calling a 'hello world' lambda. This application is deployed via the CICD pipeline.
AWSBoilerplate can be run locally.
cd awsboilerplate/app/lambda_hello_world; sam local start-api
cd awsboilerplate/www; npm start
virtualenv -p python3.8 .venv
pip install -r requirements.txt
cdk synth
to test the tools are installed correctlycdk bootstrap --trust <AWS ACCOUNT ID> --cloudformation-execution-policies arn:aws:iam::aws:policy/AdministratorAccess
(this command sets up cdk on your account)aws secretsmanager create-secret --name awsboilerplate-github-oath-token \
--description "awsboilerplate Git Auth Token" \
--region us-east-1
--secret-string <YOUR OATH TOKEN>
aws route53 list-hosted-zones
. Take the hosted zone ID and domain name and enter them in awsboilerplate_config.py
hosted_zone_name = "<your domain name i.e. example.com>"
website_domain_name = "<Your Hosted Zone ID>"
awsboilerplate/www/internals/webpack/webpack.prod.babel.js
new webpack.EnvironmentPlugin({
SERVER_URL: 'https://api.<Your domain name>' // <-- Keep https://api prefix. An API Gateway will be created for this URL
}),
cdk deploy
. CDK will create the pipeline defined in awsboilerplate/pipeline/cdk_pipeline_stack.py
.
When this pipeline runs it will create all of the infrastructure defined in awsboilerplate/infra and app
.You can develop the react front end or lambdas locally then deploy.
When ready to push simply run
-- usual git add, git commit --
git push origin master
The CICD will pick up the changes to both the application code and infrastructure and mutate both. Once the pipeline runs you can hit the domain name to see the new changes (remember cloudfront cache may be enabled).
The project implements the serverless web application pattern.
awsboilerplate has some novelty. The project leverages CDK and a recently released feature: CDKPipelines.
awsboilerplate includes a custom pipeline build ontop of these technologies.
- Every element (front end, back end, cicd, infrastructure, monitoring) is implemented in code, in a single mono repository.
- It is possible to commit a change to any element and the pipeline should auto-magically make it happen (including changes to the pipeline itself)
We are calling this pattern 'Everything is Code' which is further detailed here
awsboilerplate assemble and integrates multiple technologies into a full architecture/toolkit. The only novelty is stretching CDK to support a single mono-repository and combined pipeline.
Acknowledgements
Other Reading
All contributions greatly appreciated. Trying to follow the edict from Reid Hoffman.
If you are not embarrassed by the first version of your product, you’ve launched too late
The launch version of the project is 'good enough' and solves many hours of development time for people starting new project.
There are many many features which could be added. Please submit a pull request. Also see the features page for open features/issues.
Released under the MIT license. Copyright 2021 geod