Lambda Function works but Step Function Fails

0

I am working with a Lambda Function that receives the below payload. I run this in test for my Lambda function and it runs successfully. When I run my Step Function it errors with the below error message. This is confusing me because I am expecting my testing in Lambda Function to work in Step Function as well.

What am I missing?

Error Message from Step Function: "errorMessage": "the JSON object must be str, bytes or bytearray, not list". Payload from Step Function Input "[{"AWSDT": "2024-03-06 04:00:00", "DATALOADCONFIGID": 1, "PROC": "info.usp_Load_F7", "TABLENAME": "Info.F7", "FILENAME": "F7_202403060400.csv"}]"

Test Payload: "[{"AWSDT": "2024-03-06 04:00:00", "DATALOADCONFIGID": 1, "PROC": "info.usp_Load_F7", "TABLENAME": "Info.F7", "FILENAME": "F7_202403060400.csv"}]"

Execution Results from Lambda Function: Test Event Name (unsaved) TestInt

Response null

Function Logs
[INFO]	2024-03-06T04:20:11.600Z		Found credentials in environment variables.
[INFO]	2024-03-06T04:20:11.768Z		SUCCESS: Connection to RDS for MySQL instance succeeded
START RequestId: aae1f5bf-2ba3-45c8-b972-e12f86176e86 Version: $LATEST
[INFO]	2024-03-06T04:20:11.771Z	aae1f5bf-2ba3-45c8-b972-e12f86176e86	loading event data
[{"AWSDT": "2024-03-06 04:00:00", "DATALOADCONFIGID": 1, "PROC": "info.usp_Load_F7", "TABLENAME": "Info.F7", "FILENAME": "F7_202403060400.csv"}]
[INFO]	2024-03-06T04:20:11.771Z	aae1f5bf-2ba3-45c8-b972-e12f86176e86	Length of dictionary = 163
[INFO]	2024-03-06T04:20:11.771Z	aae1f5bf-2ba3-45c8-b972-e12f86176e86	setting variables
[INFO]	2024-03-06T04:20:11.771Z	aae1f5bf-2ba3-45c8-b972-e12f86176e86	Variables loaded
[INFO]	2024-03-06T04:20:11.772Z	aae1f5bf-2ba3-45c8-b972-e12f86176e86	Values used ['info.usp_Load_F7'],[1],['Info.F7'],['F7_202403060400.csv'],['2024-03-06 04:00:00'],
END RequestId: aae1f5bf-2ba3-45c8-b972-e12f86176e86
REPORT RequestId: aae1f5bf-2ba3-45c8-b972-e12f86176e86	Duration: 14.08 ms	Billed Duration: 15 ms	Memory Size: 128 MB	Max Memory Used: 89 MB	Init Duration: 660.16 ms
Monty
已提问 2 个月前292 查看次数
1 回答
1
已接受的回答

If you are using python for your lambda, this could be coming from using json.loads to parse the input, if that is the case try switching that out for json.dumps and it may solve your issue.

AWS
Gillian
已回答 2 个月前
profile picture
专家
已审核 2 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则