serverless-dynamodb-local icon indicating copy to clipboard operation
serverless-dynamodb-local copied to clipboard

Unexpected key `ContributorInsightsSpecification`

Open coderhglee opened this issue 2 years ago • 2 comments
trafficstars

Dynamodb support ContributorInsightsSpecificationoptions. The options used to enable or disable CloudWatch Contributor Insights.

When running serverless offline start, the following error occurs.


MultipleValidationErrors: There were 4 validation errors:
* UnexpectedParameter: Unexpected key 'ContributorInsightsSpecification' found in params.GlobalSecondaryIndexes[0]
* UnexpectedParameter: Unexpected key 'ContributorInsightsSpecification' found in params.GlobalSecondaryIndexes[1]
* UnexpectedParameter: Unexpected key 'ContributorInsightsSpecification' found in params.GlobalSecondaryIndexes[2]
* UnexpectedParameter: Unexpected key 'ContributorInsightsSpecification' found in params: DynamoDB - Error -

If ContributorInsightsSpecification option is declared in Table Properties and GlobalSecondaryIndexes, you should ignore it.

coderhglee avatar Jan 14 '23 03:01 coderhglee

FYI: This package (serverless-dynamodb-local) doesn't appear to be maintained, with no new releases to NPM in over 2 years.

Solution: You can use serverless-dynamodb, a maintained fork, instead. (Disclaimer: I am a contributor to this fork). It is a drop-in replacement for this package, and is updated to fix this bug (see https://github.com/raisenational/serverless-dynamodb/pull/1). This is a drop-in replacement for serverless-dynamodb-local, so to upgrade simply:

  1. Uninstall serverless-dynamodb-local, e.g. npm uninstall serverless-dynamodb-local
  2. Install serverless-dynamodb, e.g. npm install serverless-dynamodb
  3. Update references in your code, including your serverless config, from serverless-dynamodb-local to serverless-dynamodb (quite possible that you won't have any, as you just refer to it from your serverless config)
  4. (optional) Update your serverless config custom dynamodb key to serverless-dynamodb

Of course, it's all still open-source and MIT licensed. Ownership of this new package sits with a registered charity, that is committed to maintaining the package into the future and is open to contributions from the community.

There's an explanation as to the intentions behind this fork, and how it compares to other forks in the README.

In any case would be open to feedback on the fork - can drop create an issue in that repository or email me (address on profile).

domdomegg avatar Jul 04 '23 01:07 domdomegg

Thanks @domdomegg I will change to your package and contribute there.

coderhglee avatar Jul 04 '23 03:07 coderhglee