0

I have a Lambda code written in Python 3.6

  for record in event['Records']:
        filename_from_event = record['s3']['configurationId']
        filename = record['s3']['object']['key']
        bucket = record['s3']['bucket']['name']
        filename_folder = filename[0:filename.rfind("/")]
        filename_key = filename[filename.rfind("/")+1:]
        bucket_arr=bucket.split("-")
        path_arr=filename.split("/")
        proc=path_arr[0].upper()
        env=bucket_arr[2].upper()
        source=path_arr[2].upper()
        src_orch_json=proc+"/Common/Config/"+proc+"_"+source+"_Orch.json"
        input_json = get_step_input(bucket, src_orch_json)
        response = sf.start_execution(
            stateMachineArn='arn:aws:states:abc:stateMachine:xyz',
            name='xyz_' + env + '_' + proc + '_' + source,
            input=input_json
            )

Now, my objective is to pass arguments,i.e., proc, env and source to step function during start_execution.

How I can I do this and catch the arguments within the step function so that in turn it can pass again these parameters to the sequence of steps within it?

Parijat Bose
  • 380
  • 1
  • 6
  • 22

2 Answers2

0

presuming you have basic understanding of step functions. you should be returning a json object if you wants to pass multiple arguments to step function.

mkrana
  • 422
  • 4
  • 10
0

Within the input_json I have {"env":"dev","proc":"load"}, these two parameters must be parsed within the next step Lambda code.

Parijat Bose
  • 380
  • 1
  • 6
  • 22