👆 this is meant to be failing 🤭 the tests included in this repo will help you measure progress in the tasks below.
This example creates an AutoScalingGroup (containing a T2 Micro EC2 instance running Amazon Linux AMI) and an ApplicationLoadBalancer inside a shared VPC. It hooks up a listener from the Load Balancer to the Auto Scaling Group to indicate how many targets to balance between. While it's functional we need to make a few small improvements before it's ready.
We would like you to create a PR with the following changes:
- Update the instance type to something more modern
t3a
- Open up 3 additional ports outbound on the ec2 (
5432
,6379
,12001
) - Change the Autoscaling group to scale on CPU load.
- Add IAM role to read from the s3 bucket
arn:aws:s3:::cdk-alb-test
- Add a script in userdata to copy the
testFile.txt
file from s3 to the new instance.
Success can be measured by the tests passing and/or by the interview panel. A test exists for each of these tasks, be sure that each test passes before moving on.
To build this app, you need to be in this example's root folder. Then run the following:
npm install
npm run build
docker run -it \
--volume ${PWD}:/app \
--workdir /app \
node:lts \
npm install
docker run -it \
--volume ${PWD}:/app \
--workdir /app \
node:lts \
npm run build
This will install the necessary CDK version, then this example's dependencies, and then build your TypeScript files and your CloudFormation template. For the purpose of the assessment you won't need to compile down to javascript, both the linter and tests can process typescript.
We recommend using the current node LTS version, 16 at time of writing.
npm run lint
npm run test
docker run -it \
--volume ${PWD}:/app \
--workdir /app \
node:lts \
npm run lint
docker run -it \
--volume ${PWD}:/app \
--workdir /app \
node:lts \
npm run test
🤫 or just commit and push letting the GitHub Actions CI run do it for you (if you're doing this on your own fork you may need to setup GitHub Actions on your own account (it's free for public repos).
The aws-cdk docs are your best source for help. Also general googleing and stack overflow searching is allowed. We are as much interested in the process as in the results.
Additionally we find the ESLint and Jest plugins to VSCode to be excellent.