Skip to content

Issue when creating Global table for DynamoDB with GlobalSecondaryIndexes property #59

@austeny

Description

@austeny

I am running into a similar issue that was posted in #18.

Same error.

CreateGlobalTable: Failed to setup global table. Error There were 2 validation errors:
* UnexpectedParameter: Unexpected key 'NumberOfDecreasesToday' found in params.GlobalSecondaryIndexes[0].ProvisionedThroughput
* UnexpectedParameter: Unexpected key 'NumberOfDecreasesToday' found in params.GlobalSecondaryIndexes[1].ProvisionedThroughpu

The dynamoDb.createTable() will fail since the dynamoDb.describeTable() returns properties in ProvisionedThroughput that are not taken as input parameters in createTable(). The ProvisionedThroughput property includes the NumberOfDecreasesToday property which is not taken as an input.

eg. GlobalSecondaryIndexes from describeTable()

{
    IndexName: 'test-index',
    KeySchema: [ [Object], [Object] ],
    Projection: { ProjectionType: 'INCLUDE', NonKeyAttributes: [Array] },
    IndexStatus: 'ACTIVE',
    ProvisionedThroughput: {
      NumberOfDecreasesToday: 0,
      ReadCapacityUnits: 0,
      WriteCapacityUnits: 0
    },
    IndexSizeBytes: 0,
    ItemCount: 0,
    IndexArn: '...'
  },

The logic also has to take into consideration if ProvisionedThroughput is not defined in the GlobalSecondaryIndexes index since it is an optional parameter https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-table-globalsecondaryindex.html. The example above was taken from a table where the GlobalSecondaryIndexes did not have a ProvisionedThroughput defined however the ProvisionedThroughput property is still returned from the describe.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions