You should explore the contents of this project. It demonstrates a CDK app with an instance of a stack (TypescriptCdkWorkshopStack
)
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
I'm not supporting the table view construct to show the dynamo db table since AWS is restricting old node versions in which that table view is builded.
Since Anthology is working with GitHub, I've preffered to use GitHub connections with the suggested connection function by AWS CDK official docs to avoid exposing OAuth tokens in code as indicated here.
Create a stack that implements and deploy necessary infrastructure to cover the following use cases (no manual configuration will be allowed):
-
As a user I would like to access a website that has a index page in it.
-
As a user I would like to hit an API call that execute a purchase process of a given item (no need for multiple items). This process should cover:
- Send the item to be processed to account payable
- Send the item to be processed by shipping.
- See the
lambda/index-page.js
file. - Lambdas:
lambda/pay-item.js
: Responsible for pay any item (just store in dynamo db).lambda/ship-item.js
: Responsible for shipping an existing item (updatingis_shipped
field of an existing item in dynamo db).