https://serverless-stack.com/ logo
#help
Title
# help
g

Garret Harp

03/01/2022, 6:33 PM
Anyone know how to set reportBatchItemFailures to true on a version of the cdk that doesnt support it yet? (for sqs consumer)
f

Frank

03/01/2022, 6:34 PM
is it supported in a more recent CDK version?
g

Garret Harp

03/01/2022, 6:34 PM
It is yes, the only docs it lets me view it is supported
I'm still on 1.126.0 right now though
Figured it out:
Copy code
// eslint-disable-next-line no-extra-parens
const eventSource = redriveQueue.consumerFunction?.node.children.find(child => (child.node.defaultChild as cdk.CfnResource)?.cfnResourceType === 'AWS::Lambda::EventSourceMapping')

// eslint-disable-next-line no-extra-parens
;(eventSource?.node.defaultChild as CfnEventSourceMapping).addPropertyOverride('FunctionResponseTypes', ['ReportBatchItemFailures'])
3 Views