Copilot-cli: storage init: DDB with no LSE includes empty LSE section in the template

Created on 30 Jun 2020  Â·  2Comments  Â·  Source: aws/copilot-cli

If I run storage init for a DDB table:

[rear-window-fe] copilot storage init                                                                                             master  ✗ ✭ ✱
Only found one service in workspace, defaulting to: fe
Storage type: DynamoDB
Storage resource name: game
Partition key: game_id
Partition key datatype: String
Sort key? No
✔ Wrote CloudFormation template for DynamoDB Table game at copilot/fe/addons/game.yml

The generated CF looks like this:

  game:
    Type: AWS::DynamoDB::Table
    DeletionPolicy: Retain
    Properties:
      TableName: !Sub ${App}-${Env}-${Name}-game
      AttributeDefinitions:
        - AttributeName: game_id
          AttributeType: "S"
      BillingMode: PAY_PER_REQUEST
      KeySchema:
        - AttributeName: game_id
          KeyType: HASH
      LocalSecondaryIndexes:

The empty LocalSecondaryIndexes isn't valid and causes the deployment to fail.

areaddon typbug

All 2 comments

I thought this was fixed with: https://github.com/aws/copilot-cli/pull/1057, did you pull the latest changes?

Yea - my latest commit is a0af829de916b7b85596cd34126c38ac751761ca - I'm wondering if this is because in this table, there's no range key at all?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bpottier picture bpottier  Â·  3Comments

srrengar picture srrengar  Â·  3Comments

kohidave picture kohidave  Â·  4Comments

efekarakus picture efekarakus  Â·  3Comments

fullstackdev-online picture fullstackdev-online  Â·  3Comments