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
전문가
검토됨 한 달 전

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

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

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

관련 콘텐츠