We've decided to venture into e-commerce. A software development team has been assembled that'll soon start working on an e-commerce backend application.
Your task is to have the infrastructure needed to deploy the application ready in AWS. Contained within this repository is some Typescript AWS CDK code with our current stack. Unfortunately it doesn't actually do very much as yet. Your task is to extend this infrastructure code with the following features.
Note this repository uses v1 of CDK, reference: https://docs.aws.amazon.com/cdk/api/v1/
- The entire infrastructure should be in a new VPC.
- The application should be highly available. Therefore, we should be able to replicate the infrastructure (when logical) in two Availability Zones in the future (Hint: This is precisely what you need to do for the Bonus below!). You should setup the networking while keeping this end in mind.
- The backend team needs an AWS EC2 instance to serve as an application server. This should be publicly accessible via the internet.
- They also require an RDS instance, but it should be hidden away from public access, with only the application EC2 instance having access to the RDS instance.
- The team would also need two copies of the same environment, a prod and a staging env.
- The team thinks they'd probably want to re-use the networking infrastructure for other future projects. They'd also like to re-use the database infrastructure for other applications in the future as well. You should write the CDK templates/code in a way that makes it easy to do this in the future.
- All the instances should be kept safe behind relevant firewall configs.
- For enabling high availability, it would be nice to have the EC2 servers set to autoscaling within the two AZ. This may warrant a way to direct traffic between these autoscaled instances.
- Similarly, it would be nice to have an RDS standby in the other AZ.
- The team would ideally want the DBs to have one way access to the Internet for auto-updates. They aren't sure how to go about doing it since the RDS DB instances shouldn't be public.
The cdk.json
file tells the CDK Toolkit how to execute your app.
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
Please send a zip archive containing your code (without the node_modules directory) to webb at whitelabel-loyalty dot com.