⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

lambda-durable-scheduled-tasks-sam: Fix empty taskId in async API Gateway response#2919

Open
kakakakakku wants to merge 1 commit intoaws-samples:mainfrom
kakakakakku:lambda-durable-scheduled-tasks-sam
Open

lambda-durable-scheduled-tasks-sam: Fix empty taskId in async API Gateway response#2919
kakakakakku wants to merge 1 commit intoaws-samples:mainfrom
kakakakakku:lambda-durable-scheduled-tasks-sam

Conversation

@kakakakakku
Copy link
Contributor

Issue #, if available:
N/A

Description of changes:
Hi😀 Thanks for the useful patterns!

While testing lambda-durable-scheduled-tasks-sam, the API response returns blank taskId. Because Lambda functions with asynchronous invoke does not return response directly.
https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-integration-async.html

$ curl -X POST ${API_ENDPOINT}/tasks \
  -H "Content-Type: application/json" \
  -d '{
    "config": {
      "reportType": "weekly",
      "dataSource": "analytics",
      "notifyEmail": "[email protected]"
    }
  }'
{
  "taskId": "",
  "status": "INITIALIZED",
  "message": "Task started successfully"
}

But README is mentioned with taskId response.

Response:
```json
{
"taskId": "TASK-1733328000000",
"status": "INITIALIZED",
"message": "Task started successfully"
}
```

Check

I fixed mapping template and it works good.

$ curl -X POST ${API_ENDPOINT}/tasks \
  -H "Content-Type: application/json" \
  -d '{
    "config": {
      "reportType": "weekly",
      "dataSource": "analytics",
      "notifyEmail": "[email protected]"
    }
  }'
{
  "taskId": "TASK-1769224879385",
  "status": "INITIALIZED",
  "message": "Task started successfully"
}
image

Thank you😀


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants