This project contains the Infrastructure as Code for my Personal Website https://www.manuelenolli.ch using the AWS Cloud Development Kit (CDK).
- node: 20.16.0
- yarn: 1.22.22
yarn install
yarn deploy:first # will create the S3 buckets
Once NextJS is built and pushed to the S3 bucket (Just execute the Github action), you can deploy the rest:
yarn deploy
The website is hosted on AWS using the following services:
- Amazon S3: Static website hosting
- AWS Lambda: Serverless functions (Yes, NextJs Server Side Rendering on AWS Lambda 😄)
- Amazon API Gateway: API management
- Amazon CloudFront: Content delivery network
- Amazon Route 53*: Domain name management
- Amazon Certificate Manager*: SSL certificates
- Amazon WAF*: Web application firewall
- Amazon Simple Email Service: Manage email
* These services are not implemented in this project, the CDK stack creates until the CloudFront distribution, this is because the additional services are customisable and I added them manually.I personally followed this Developer Guide.
The AWS Infrastructure can be seen in the following diagram:
As mentioned above, some services are not implemented in this project, if you want to deploy the infrastructure as I did, you need to follow these steps:
- Create your domain in Route 53 as an Hosted Zone (you should configure the NS records in your domain provider)
- Create a certificate in ACM for your domain (you should validate the certificate by adding a CNAME record in Route 53)
- Enable WAF in CloudFront and configure the rules as you wish