How can I configure a deadletter queue for my lambda function?
I followed https://docs.amplify.aws/react/build-a-backend/add-aws-services/custom-resources/ to create an SQS queue. I followed https://docs.amplify.aws/react/build-a-backend/functions/set-up-function/ to setup my function.
Now I am trying to connect the queue ot the function in my backend.ts, but assigning is not allowed, what I am trying to do is:
lambdaStreamUsage.deadLetterQueue = sqsDeadLetterQueue;
lambdaStreamUsage i get from backend.dbStreamUsageFunction.resources.lambda as Function;
The error I get is: Cannot assign to 'deadLetterQueue' because it is a read-only property.ts(2540)
Maybe a more general question, as I ran into this now quite often: I think a lot of things in CDK are only configurable in the constructor. But amplify creates those things already, so after creation it is hard to change things like the DLQ? Am I correct? How is this supposed to work for developers like me that want to extend things? Are there any tricks?