Passing HTTP Headers from API Gateway HTTP API to Step Function?

0

I'm using SAM and I want to connect an HTTP POST endpoint from API Gateway to an AWS Step Function. I'm able to forward the request body but I'm unable to also pass the headers. This is my YAML definition:


  /cancelOrder:
    post:
      responses:
        default:
          description: "zzzz"
      x-amazon-apigateway-integration:
        integrationSubtype: "StepFunctions-StartExecution"
        credentials:
          Fn::GetAtt: [zzzz, Arn]
        requestParameters:
          Input: "$request.body"
          StateMachineArn:
            Fn::GetAtt: [zzzz, Arn]
        payloadFormatVersion: "1.0"
        type: "aws_proxy"
        connectionType: "INTERNET"
        timeoutInMillis: 10000

This works but I'm only able to receive the HTTP POST body, not the headers. Input: "$request.body" is, I suppose, the part that's parsing the JSON and sending it to my function. But I need both the Body and the HTTP headers.

Is there a way to do this?

1 回答
1

What you want is not supported by HTTP API. You can achieve this with REST API and request mapping.

profile pictureAWS
专家
Uri
已回答 2 年前
profile picture
专家
已审核 1 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则