This project harnesses CDK technology (v1.60) for basic VPC, RDS, Elastic Beanstalk, CloudFront with Lambda@Edge stack creation.
To run this, please rename example.env
to .env
and change the values
As you can see in lib/app.ts
, some stacks depend on one or more stacks.
Elastic Beanstalk Java SE listens to port 5000, not 8080. Please bear this in mind.
Simple AWS VPC Stack. You might want to change maxAzs and so on for your needs. (Will put this in env file too in the near future)
Aurora RDS Database cluster. If you wish to use serverless
option, please refer aws-rds module. Addtionally, should you wish to change the default database name, please change in the java project and rds-stack.ts
(it is set as test
)
Standard Java SE 11 environment. You need to build your own project and submit jar file OR use the one in demo/target
. Should you wish to run this in your local environment, you need your own mysql database running.
Cloudfront creates two origins: s3
for static web hosting and elb
from elastic beanstalk. The stack deploys static files from website
folder. Please change the url to the cloudfront elb origin
CloudFront pushes access logs to s3. Glue and Athena helps the user to pull out useful insights from it without provisioning additional infrastructure
CI/CD CDK pipeline. Simply deploy the stack and git commit
push
to see if it deploys the stack with changes.
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template
npm run build && cdk synth && cdk deploy "*"
does magic.cdk destroy "*"
destroys them.
Should you wish to select which stacks to deploy, please use cdk deploy VpcStack RdsStack ElasticBeanstalkStack
and so on.
- Improve overall code quality
- Find better ways to manage environment variables in both code and cdk projects
Spring-Jpa Best Practices for general Spring Best Practices
Complete AWS Elastic Beanstalk Application through CDK (TypeScript) for overall elastic beanstalk CDK
AWS CDK Part 3: How to create an RDS instance for creating Aurora RDS instance using CDK
Multiple Cloudfront Origins with Behavior Path Redirection for awssome CloudFront + Lambda@Edge
Implementing Default Directory Indexes in Amazon S3-backed Amazon CloudFront Origins Using Lambda@Edge for S3 Subdirectory Root Object with CloudFront issue
- Default files in S3 subdirectories using CloudFront and Lambda@Edge -> The previous one needs to have ending 'slash'. This takes care of it with querystrings.