Search code examples
amazon-web-servicesaws-lambdastate-machineaws-step-functions

How to specific the resource ARN (Amazon Resource Name) in the state machine


I follow this tutorial (https://aws.amazon.com/blogs/machine-learning/analyzing-contact-center-calls-part-1-use-amazon-transcribe-and-amazon-comprehend-to-analyze-customer-sentiment/) to create a workflow using the state machine (Step Functions) in AWS,

Step 7 in this tutorial talks about 'Invoke Step Functions', where they mentioned as I need to pass the ARN of the lamdba function which I am not clear

How to pass this resource ARN as parameter?

Reference : https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html#amazon-states-language-task-state-specifying-resource-arns

Thanks,
Harry


Solution

  • You can grab the lambda ARN from the lambda console and then follow this step as mentioned in the Step functions documentation. Change the params as per your config:

    In the State machine definition pane, add the following state machine definition using the ARN of the Lambda function that you created earlier, for example:

    {
      "Comment": "A Hello World example of the Amazon States Language using an AWS Lambda function",
      "StartAt": "HelloWorld",
      "States": {
        "HelloWorld": {
          "Type": "Task",
          "Resource": "arn:aws:lambda:us-east-1:123456789012:function:HelloFunction",
          "End": true
        }
      }
    }