# DynamoDB, serverless.yml

**URL:** <https://forum.serverless.com/t/dynamodb-serverless-yml/4594>\
**Category:** Serverless Framework\
**Tags:** lambda\
**Created:** [May 29, 2018, 10:24am UTC](https://forum.serverless.com/t/dynamodb-serverless-yml/4594 "2018-05-29T10:24:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vhaxha](https://avatars.discourse-cdn.com/v4/letter/v/898d66/32.png) [@vhaxha](https://forum.serverless.com/u/vhaxha)\
**Post date:** [May 29, 2018, 10:24am UTC](https://forum.serverless.com/t/dynamodb-serverless-yml/4594/1 "2018-05-29T10:24:23Z")

</div>

HI all,

Is it possible to create two or more tables in dynamoDB using single serverless.yml.  
I tried but unsuccessfully, if yes please simple example.

Thank you

Hi Jonsmirl  
It works, thank you very much for your time and help

---

<div class="post-metadata">

**Author:** ![jonsmirl](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/jonsmirl/32/776_2.png) [@jonsmirl](https://forum.serverless.com/u/jonsmirl)\
**Post date:** [May 29, 2018, 11:47am UTC](https://forum.serverless.com/t/dynamodb-serverless-yml/4594/2 "2018-05-29T11:47:11Z")

</div>

I made three tables in one YAML file with this:

```
eventsDynamoDbTable:
  Type: 'AWS::DynamoDB::Table'
  Properties:
    AttributeDefinitions:
      - AttributeName: Serial
        AttributeType: S
      - AttributeName: Timestamp
        AttributeType: N
    KeySchema:
      - AttributeName: Serial
        KeyType: HASH
      - AttributeName: Timestamp
        KeyType: RANGE
    ProvisionedThroughput:
      ReadCapacityUnits: 1
      WriteCapacityUnits: 1
    TableName: $<self:provider.environment.EVENT_TABLE>

ownerDynamoDbTable:
  Type: 'AWS::DynamoDB::Table'
  Properties:
    AttributeDefinitions:
      - AttributeName: Serial
        AttributeType: S
      - AttributeName: CogID
        AttributeType: S
    KeySchema:
      - AttributeName: Serial
        KeyType: HASH
      - AttributeName: CogID
        KeyType: RANGE
    ProvisionedThroughput:
      ReadCapacityUnits: 1
      WriteCapacityUnits: 1
    TableName: $<self:provider.environment.OWNER_TABLE>

userDynamoDbTable:
  Type: 'AWS::DynamoDB::Table'
  Properties:
    AttributeDefinitions:
      - AttributeName: CogID
        AttributeType: S
    KeySchema:
      - AttributeName: CogID
        KeyType: HASH
    ProvisionedThroughput:
      ReadCapacityUnits: 1
      WriteCapacityUnits: 1
    TableName: $<self:provider.environment.USER_TABLE>
```

---

<div class="post-metadata">

**Author:** ![vhaxha](https://avatars.discourse-cdn.com/v4/letter/v/898d66/32.png) [@vhaxha](https://forum.serverless.com/u/vhaxha)\
**Post date:** [July 18, 2018, 6:09pm UTC](https://forum.serverless.com/t/dynamodb-serverless-yml/4594/3 "2018-07-18T18:09:39Z")

</div>

Already managed to do it.
