Hello,
In AWS, we’ve added a DynamoDB stream to trigger a Lambda function using the enclosed serverless.yml configuration. We are able to get all the DynamoDB Stream properties set and work except the following property.
functionResponseType: ReportBatchItemFailures
(Set that property as per the following documentation https://www.serverless.com/framework/docs/providers/aws/events/streams/#setting-the-functionresponsetypes)
We are getting the following error while sls deploy to AWS
(ran the sls deploy using cicd/Jenkins
- serverless-domain-manager@5.1.3
added 21 packages from 70 contributors and audited 21 packages in 3.134s)
Serverless: Configuration warning at ‘functions.<lambda_function>.events[0].stream’: unrecognized property 'functionResponseType’
As per the AWS documentation ( AWS::Lambda::EventSourceMapping - AWS CloudFormation (amazon.com), this property is a List value and also the property name itself is plural.
i.e., functionResponseTypes: [‘ReportBatchItemFailures’]
So, I’ve tried the serverless.yml config with following possible combinations and still got the same error as listed above.
functionResponseType: ReportBatchItemFailure
functionResponseType: [‘ReportBatchItemFailures’]
functionResponseTypes: ReportBatchItemFailures
functionResponseTypes: [‘ReportBatchItemFailures’]
As per the following PR feat(AWS Stream): Add support for custom checkpoint by imewish · Pull Request #9056 · serverless/serverless · GitHub
the following syntax should work, but it’s not working.
functionResponseType: ReportBatchItemFailure
This is the only property giving problem out of all DynamoDB stream properties.
Here is our serverless.yml DynamoDB Stream Event mapping for Lambda (obscured some of the values):
lambdaName:
events:
- stream:
type: dynamodb
arn: ${self:custom.StreamARN}
enabled: true
batchSize: 100
batchWindow: 20
parallelizationFactor: 5
functionResponseType: ReportBatchItemFailures
# functionResponseType: [‘ReportBatchItemFailures’]
# functionResponseTypes: ReportBatchItemFailures
# functionResponseTypes: [‘ReportBatchItemFailures’]
maximumRecordAgeInSeconds: -1
destinations:
onFailure:
arn: ${self:custom.StreamQueueARN}
type: sqs
maximumRetryAttempts: 10
bisectBatchOnFunctionError: true
startingPosition: TRIM_HORIZON
runtime: java11
handler: com.xxxx.yyyy.lambda.config.lambda_function
name: ${self:custom.lambda_function}
I’ve already spent lot of time troubleshooting this issue. Appreciate if you could please help.
Thanks,
@boxed