LoginSignup
0
0

More than 1 year has passed since last update.

API GatewayとStep Functionsの連携で GETエンドポイントを使用してリクエスト受信する。

Posted at

備忘録

注意点、この記事は備忘録でありHHKB 入力の練習でもある。

概要

APIGatewayとStep Funcitionsを連携させる際、APIGatewayはPOSTメソッドを使う事が基本的だが、どうしてもGETで使用したかったのでGETでも行った。

おおまかなややり方や、Step Funcitionsの内容を下記のページと同じである
https://masayuki031.com/api-gateway-lambda-stepfunction/

一番のポイント

APIGatewayのマッピングテンプレートを下記のようにセットする

#set($allParams = $input.params())
{
    "input" : "{#foreach($type in $allParams.keySet()) #set($params = $allParams.get($type)) \"$type\" : { #foreach($paramName in $params.keySet()) \"$paramName\" : \"$util.escapeJavaScript($params.get($paramName))\" #if($foreach.hasNext),#end #end } #if($foreach.hasNext),#end #end }",
    "stateMachineArn" : "Step FuncitionsのARN"
}

input部分は、改行すると「SerializationException」になってしまうので、この形式にしている。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0