0

I have an S3 bucket that will trigger invoking a lambda function based on the put event type. Then the lambda function will trigger the Glue workflow. In the Glue workflow, I have created one glue job that converts XLSX files to CSV. This is the overall scenario. Now I will fetch uploaded object names(XLSX files) based on the lambda event. But how can I pass these object names to the Glue job once lambda trigger to the Glue workflow? Can I pass object names one after another to the job dynamically once the workflow starts so that all the files will convert at one shot?

Thanks!

Srinivas
  • 51
  • 4

1 Answers1

0

Lambda function handler's one of parameter is event and other is context. Event parameter structure is depend on invoking Service. For S3 service you can find event structure at here.

event.Records[0].s3.object.key

is your needs.

Mehmet Güngören
  • 2,383
  • 1
  • 9
  • 16
  • Thank you for the time to reply. But here my concern is different. As I mentioned earlier in my question that I can get the list of object names from the lambda event. After getting those list of object names, how can I pass that list as a parameter to glue workflow? – Srinivas Jan 06 '23 at 06:59
  • You need to trigger workflow. See: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/glue.html#Glue.Client.create_trigger `create_trigger` take `Actions.Arguments` take parameters. Full example: https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-python-calling.html – Mehmet Güngören Jan 06 '23 at 09:57