New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DeadLetterConfig support #3609
DeadLetterConfig support #3609
Conversation
40ec011
to
a0c8042
Compare
Just a quick update on this one. Debugged it today and it seems like the The initial deployment (from scratch) will suceed, however changing an existing stack errors out since the IAM Role is not updated. The weird part is that the generated CloudFormation template is correct and the CloudFormation console tells you that everything was updated correctly. But if you look into the policies for the role in the IAM console you can see that it was not updated. 🤔 Don't know what's wrong here. A @eahefnawy do you have any idea what might be missing here? Step-by-step list to reproduce the behavior above (:top:) [0. Make sure that you use a brand new service]
|
a0c8042
to
b2e21b6
Compare
I did another deep dive into this. IMHO this is definitely smth. on AWS end. The weird thing is that the update of the Another indicator for a problem on AWS end is that you'll see the correct inline-policy if you look into the compiled CloudFormation template which is uploaded to the deployment bucket and used during the stack update process. Not quite sure how we should proceed here... We could use permission resources we merge into the template. I tested this but it's also not working flawlessly on my machine and it looks like it's not the best practice when dealing with DLQ setup through CloudFormation (see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-deadletterconfig.html). Do you have an idea how we can make this work @eahefnawy ? |
Couldn't it just be that we set a fixed name for the inline policy? Did you try to change the inline policy name to have some unique appendix? IMO the update might work if the inline policy gets a different name on each build. The inline policy name is set here: |
@HyperBrain that's a good hint. Thanks for that! 👍 The only thing which makes me curious is that we also add other inline policies (e.g. for |
b2e21b6
to
48a4167
Compare
48a4167
to
0db25b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just updated the code so that only SNS topic arns are supported.
Tested everything again and it's working fine. Will merge after the build passed
Couldn't find the ticket related to supporting SQS. Could that ticket be kindly link here for tracking? What's the current status on supporting SQS as a dead letter queue? Is it recommended to implement the corresponding cloudformation instructions? Thanks! |
@pmuens - silly question - was the code generating the cloudformation template by referring to the return value of the SQS resource? I ran into similar symptoms as described earlier in the ticket. The return value of the SQS resource is the http endpoint! 🙄 One would have to refer to the Simply adding the following to my serverless.yml, I was able to configure a Dead Letter Queue for my lambda function using Cloudformation within serverless.yml:
|
@neowulf thank you for sharing your solution, it worked well for me! Even removed This part from the
|
…mbda handlers - EUBFR-204 (#160) # PR description The goal of this pull request is to solve the hard limitations in execution time in AWS Lambda. PR overview: - new service `@eubfr/ingestion-dead-letter-queue` is a regular serverless service which provides an SQS Dead Letter Queue for general use of other services. The service exposes a dead letter SQS queue (it also exports a value in CF outputs) to which other services push messages when they fail because of time limitation. - new service `@eubfr/compute-ecs` which is not a serverless service, but a general node project with a Docker container which can be deployed to AWS ECS. The role of the container is to execute a `runner.js` node script which simply downloads the code of a dynamically input lambda function and executes it without time limitations. - service changes: all business critical services have been updated to be able to make use of the new setup. The way dead letter queues are "attached" is by `Resources` section and not serverless' `onError`, because of [this](serverless/serverless#3609 (comment)).
What did you implement:
Closes #2982
Add config variable for function-based DeadLetterConfig support.
How did you implement it:
Add the
onError
config variable for functions.How can we verify it:
Deploy this service. Make your Lambda error out.
Todos:
Is this ready for review?: YES
Is it a breaking change?: NO