# Serverless Stack Update: Using AWS CDK

**URL:** <https://discourse.sst.dev/t/serverless-stack-update-using-aws-cdk/2103>\
**Category:** General\
**Created:** [October 8, 2020, 5:36pm UTC](https://discourse.sst.dev/t/serverless-stack-update-using-aws-cdk/2103 "2020-10-08T17:36:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [October 8, 2020, 5:36pm UTC](https://discourse.sst.dev/t/serverless-stack-update-using-aws-cdk/2103/1 "2020-10-08T17:36:01Z")

</div>

We’ve now updated Serverless Stack to use [AWS CDK](https://aws.amazon.com/cdk/) instead of CloudFormation YAML. This is a big change! And it makes configuring your Serverless infrastructure a lot easier.

So defining our Notes table in DynamoDB looks like this:

```diff
- Resources:
- NotesTable:
- Type: AWS::DynamoDB::Table
- Properties:
- TableName: ${self:custom.tableName}
- AttributeDefinitions:
- - AttributeName: userId
- AttributeType: S
- - AttributeName: noteId
- AttributeType: S
- KeySchema:
- - AttributeName: userId
- KeyType: HASH
- - AttributeName: noteId
- KeyType: RANGE
- # Set the capacity to auto-scale
- BillingMode: PAY_PER_REQUEST

+ const table = new dynamodb.Table(this, "notes", {
+ partitionKey: { name: 'userId', type: dynamodb.AttributeType.STRING },
+ sortKey: { name: 'noteId', type: dynamodb.AttributeType.STRING },
+ billingMode: dynamodb.BillingMode.PAY_PER_REQUEST,
+ });

```

All the chapters in the [**Deploying The Backend to Production**](https://serverless-stack.com/chapters/getting-production-ready.html) section have now been updated.

We also added a chapter to help you get started with AWS CDK. So have a look and let us know what you think!

> **[What is AWS CDK?](https://serverless-stack.com/chapters/what-is-aws-cdk.html)**
>
> AWS CDK (Cloud Developer Kit) is an Infrastructure as Code tool that allows you to use modern programming languages to define and provision resources on AWS. It supports JavaScript, TypeScript, Java, .NET, and Python.

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [October 8, 2020, 5:36pm UTC](https://discourse.sst.dev/t/serverless-stack-update-using-aws-cdk/2103/2 "2020-10-08T17:36:40Z")

</div>

Pinned globally on October 8, 2020, 5:36pm UTC


