serverless-components / aws-dynamodb

⚡ Easily provision AWS DynamoDB tables using Serverless Components.
https://www.serverless.com
Apache License 2.0
59 stars 11 forks source link

Global Secondary Index Support #7

Closed barrysteyn closed 4 years ago

barrysteyn commented 5 years ago

Global secondary indexes seems is very important. Here is an idea how it could be supported:

myTable:
  component: '@serverless/aws-dynamodb'
  inputs:
    name: nameOfTable # optional
    attributeDefinitions:
      - AttributeName: id
        AttributeType: S
    keySchema:
      - AttributeName: id
        KeyType: HASH
    region: us-east-1
    globalSecondaryIndexes:
      - IndexName: nameOfGSIndex
      - KeySchema:
         - AttributeName: id
            KeyType: HASH
eahefnawy commented 5 years ago

@barrysteyn absolutely! the config looks great. PR is welcome 😊

barrysteyn commented 5 years ago

He he - okay, give me a day or so, I will try have it out soon.