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
asked 2 months ago282 views
1 Answer
1
Accepted Answer

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
answered 2 months ago
profile picture
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions