This is a Graphql API built with AWS AppSync, DynamoDB and Lambda. The application was generated using the AWS CDK CLI and uses Typescript as the development langauge. For more information on using the AWS CDK with Typescript visit AWS Docs.
Download or clone the repository and run npm init. This will install the needed depencies on your machine. The lib directory constains the stack and its constructs.
export class BookStoreGraphqlApiStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
// Constructs
})
}
The lambda function are stored within the functions directory. 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