Step function passing parameters

0

Hi there,

I am trying to do some experiments to migrate from the data pipeline to the step function. I call the step function from the lambda function by passing a couple of parameters (name, env). My question is, how do I pass these parameters and clusterID (from the emr) to all next steps and use it? Also, is it possible to change the name of the cluster to the parameter I passed from the lambda function? Like

"Parameters": {         "Name": "$.name",....?

Please see the attached picture. sample step function

질문됨 일 년 전3220회 조회
1개 답변
0

Hello there!

In order to pass the parameters from one state to the next, ensure that you are using the Pass state.

Let's say I have the parameters ClusterName and ClusterId and I need to pass it to the next state. In my state machine definition, it will like the following:

    "GetInputFromLambda": {
      "Comment": "This state gets the parameters from the Lambda function",
      "Type": "Pass",
      "Parameters": {
        "ClusterID.$": "$.ClusterId", (this allows me to get the value defined in the Lambda function)
        "ClusterName.$" : "$.ClusterName",
      },
      "Next": "DoSomethingWithLambdaInputState"

If I defined "ClusterID.$" as "ClusterID", I will get the literal string "$.ClusterId", have a look at the example listed here. The values that I get from Lambda are passed on to the next state "DoSomethingWithLambdaInputState"

So if you change the name of the EMR cluster in your Lambda function, remember the key value pair so you can access it in the state machine.

AWS
JB
답변함 일 년 전
  • Thanks JB,  So, will this one pass those parameters for the next step or all subsequent steps?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠