Is it acceptable to use a golang struct return AND error return in a lambda triggered by SQS ?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start with the AWS Lambda Go SQS deployment example linked in the issue and compare it with the shown handler signatures. Verify the untested error-return behavior for an SQS-triggered invocation; done means the repository or its documentation clearly states whether the additional response value is accepted and how it affects SQS processing.
Written by the indexing model from the issue text.
Description
Hi,
Lambda return signature to SQS in the example is :
func handler(ctx context.Context, sqsEvent events.SQSEvent) error {
Just a simple error return, with no struct.
However, to allow a lambda written in golang to provide more data when invoked outside of SQS, my code is returning an APIGatewayProxyResponse and an error. It is a feature of go to have multple return values, including an error.
I can invoke the lambda manually and see return values, rather than just nil, or have logs to go to Cloudwatch.
My interest in this is for testing - The lambda can return 'success data values or status', and an error for 'failure'.
func handle(ctx context.Context, sqsEvent events.SQSEvent) (events.APIGatewayProxyResponse, error) {
This is all working (error returns to SQS not tested, but not causing a problem either, I will test).
Thanks,
Marc
- Dominant language
- Go
- Stars
- 3.8k
- Forks
- 578
- Avg merge
- 16h 56m
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/aws-lambda-go
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
aws/aws-lambda-go#634 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
aws/aws-lambda-go#597 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
aws/aws-lambda-go#556 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
aws/aws-lambda-go#610 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
aws/aws-lambda-go#598 ·
All issues in aws/aws-lambda-go
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100