aws-step-functions

How to integrate, by CloudFormation, Api Gateway with Step Functions

僤鯓⒐⒋嵵緔 提交于 2019-12-08 04:32:14
问题 I'm creating a CloudFormation template for the platform I'm working on. I need to integrate Api Gateway and Step Functions, to make one of my step functions be executed by a call to a Api Gateway Method. I'm not finding any documentation on this. I struggled to find the Integration/Uri, that should be arn:aws:apigateway:${region}:states:action/StartExecution but now I'm not sure on what to write in my RequestTemplates. I suppose that I could actually leave it empty, to make it act like a

Managing error flow in AWS step-functions

女生的网名这么多〃 提交于 2019-12-06 04:25:12
I have an AWS step-function/state-machine of Lambda functions written primarily in Javascript (although one is in Java) and I'd like to manage the error processing better. I have no problem with having an error condition being caught and then forwarded to another state in the flow. So for instance, the following state definition in my state machine passes execution to the NotifyOfError state where I am able to email and sms appropriately about the error state. Closure: Type: Task Resource: >- arn:aws:lambda:#{AWS::Region}:#{AWS::AccountId}:function:xxx-services-${opt:stage}-transportClosure

AWS Lambda chaining best practice

半世苍凉 提交于 2019-12-06 03:45:19
I'm looking a solution for my problem and maybe someone could give me some ideas. I have a API Gateway plugged to a aws lambda A. I have to handle cases like this: Lambda A should call lambda B and if there are any results, return to the API Gateway. Lambda A should call lambda B and if no results, it will call lambda C, and then return whatever the results are to the APi Gateway . So, my problem is how to chain these lambdas, because I don't want to have a huge lambda. At first, I thought about using Step Functions except that this works in a asynchronous mode, so no good for my case. I know

Passthrough input to output in AWS Step Functions

醉酒当歌 提交于 2019-12-05 07:48:09
How can I passthrough the input to a Task state in an AWS Step Functions to the output? After reading the Input and Output Processing page in the AWS docs, I have played with various combinations of InputPath , ResultPath and OutputPath . State definition: "First State": { "Type": "Task", "Resource": "[My Lambda ARN]", "Next": "Second State", "InputPath": "$.someKey", "OutputPath": "$" } Input: { "someKey": "someValue" } Expected Result I would like the output of the First State (and thus the input of Second State ) to be { "someKey": "someValue" } Actual Result [empty] What if the input is

How to invoke an AWS Step Function using API Gateway

强颜欢笑 提交于 2019-12-03 14:06:44
问题 How do I invoke an AWS Step Function using an API Gateway POST request, and the request's JSON payload to the Step Function ? 回答1: 1. Create your step function Quite obvious. I guess that if you're reading this you know how to do it. Otherwise, you can go have a look at the documentation here: What is AWS Step Functions?. 2. Create the IAM Role for your API It can be for either all Step Functions, or only this one. We'll only cover the first case, as explained in an Amazon tutorial: Creating

How to invoke an AWS Step Function using API Gateway

一曲冷凌霜 提交于 2019-12-03 04:03:39
How do I invoke an AWS Step Function using an API Gateway POST request, and the request's JSON payload to the Step Function ? 1. Create your step function Quite obvious. I guess that if you're reading this you know how to do it. Otherwise, you can go have a look at the documentation here: What is AWS Step Functions? . 2. Create the IAM Role for your API It can be for either all Step Functions, or only this one. We'll only cover the first case, as explained in an Amazon tutorial: Creating an API Using API Gateway . To create the IAM role Log in to the AWS Identity and Access Management console.

AWS Step Functions with multiple executions

狂风中的少年 提交于 2019-12-02 07:41:12
I have the following Step Function : { "Comment": "Test Lambda with Wait", "StartAt": "wait_using_seconds", "States": { "wait_using_seconds": { "Type": "Wait", "SecondsPath": "$.timer_seconds", "Next": "lambda_test" }, "lambda_test": { "Type": "Task", "Resource": "arn:aws:lambda:us-east-1:00000000000:function:XXXXXXXX", "End": true } } } This Step Function receives dynamic input data for the Lambda so it's enough flexible to be called for different purposes. I might have some Executions with 1 hour wait, others with 3 hours, and so on. Let's say I will have 5,000 Running Executions of the same

How to Invoke AWS step function using API gateway?

北城以北 提交于 2019-12-01 18:07:46
According to Amazon's documentation, step function can be invoked using HTTP API. Step Functions can be accessed and used with the Step Functions console, the AWS SDKs, or an HTTP API. I tried to search the detailed information, but can't seem to find any good ones. Does anyone know how to invoke AWS step function using API gateway, similar to the way it invokes Lambda functions? If you need to call StepFunction from API Gateway, it's now possible and described well in docs: https://docs.aws.amazon.com/step-functions/latest/dg/tutorial-api-gateway.html For Integration Type, choose AWS Service

How to Invoke AWS step function using API gateway?

人盡茶涼 提交于 2019-12-01 17:47:39
问题 According to Amazon's documentation, step function can be invoked using HTTP API. Step Functions can be accessed and used with the Step Functions console, the AWS SDKs, or an HTTP API. I tried to search the detailed information, but can't seem to find any good ones. Does anyone know how to invoke AWS step function using API gateway, similar to the way it invokes Lambda functions? 回答1: If you need to call StepFunction from API Gateway, it's now possible and described well in docs: https://docs

AWS Step Functions history event limitation

£可爱£侵袭症+ 提交于 2019-12-01 02:58:38
问题 I use step functions for a big loop, so far no problem, but the day when my loop exceeded 8000 executions I came across the error "Maximum execution history size" which is 25000. There is there a solution for not having the history events? Otherwise, where I can easily migrate my step functions (3 lambda) because aws batch will ask me a lot of code rewrite .. Thanks a lot 回答1: One approach to avoid the 25k history event limit is to add a choice state in your loop that takes in a counter or