You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is kind of annoying but having an issue here that doesnt play well with Serverless. I have a DynamoDB table and using the jest dynamodb package to run a local DDB when running unit tests. I am using version 1.8.1, I have a table that has a StreamSpecification set, which deploys fine using serverless (although I DO see StreamEnabled property on AWS docs). But when I run unit tests, I get this error:
await serverless.init();
const service = await serverless.variables.populateService();
const resources = service.resources.Resources;
let tables = Object.keys(resources)
.map((name) => resources[name])
.filter((r) => r.Type === 'AWS::DynamoDB::Table')
.map((r) => r.Properties);
// This is a workaround, there is some bug that says we need a property called `StreamEnabled` on tables with `StreamSpecification` but that will error out serverless.
// It's also not in the docs, so I am erroring on the side of Serverless since it seems they are adhering to rules
// https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-streamspecification.html
// So the workaround, is for local, we dont need streams anyways, remove this property to not get error.
tables = tables.map(table => {
const { StreamSpecification } = table;
if(StreamSpecification) {
delete table.StreamSpecification;
}
return table;
})
return {
tables,
port: 8000,
};
So basically just remove any tables with StreamSpecification in your jest dynamodb config, not the best but works.
This is kind of annoying but having an issue here that doesnt play well with Serverless. I have a DynamoDB table and using the jest dynamodb package to run a local DDB when running unit tests. I am using version
1.8.1
, I have a table that has a StreamSpecification set, which deploys fine using serverless (although I DO seeStreamEnabled
property on AWS docs). But when I run unit tests, I get this error:MissingRequiredParameter: Missing required key params.StreamSpecification
so I add it, tests run fine. Then when I try to deploy using serverless I get this error:
serverless Encountered unsupported property StreamEnabled
I assume this is a bug, but any workarounds?
The text was updated successfully, but these errors were encountered: