6

I have a Type: AWS::Serverless::HttpApi which I am trying to connect to a Type: AWS::Serverless::StateMachine as a trigger. Meaning the HTTP API would trigger the Step Function state machine.

I can get it working, by only specifying a single input. For example, the DefinitionBody when it works, looks like this:

      DefinitionBody:
        info:
          version: '1.0'
          title:
            Ref: AWS::StackName
        paths:
          "/github/secret":
            post:
              responses: 
                default:
                  description: "Default response for POST /"
              x-amazon-apigateway-integration:
                integrationSubtype: "StepFunctions-StartExecution"
                credentials:
                  Fn::GetAtt: [StepFunctionsApiRole, Arn]
                requestParameters:
                  Input: $request.body
                  StateMachineArn: !Ref SecretScannerStateMachine
                payloadFormatVersion: "1.0"
                type: "aws_proxy"
                connectionType: "INTERNET"
                timeoutInMillis: 30000
        openapi: 3.0.1
        x-amazon-apigateway-importexport-version: "1.0"

Take note of the following line: Input: $request.body. I am only specifying the $request.body.

However, I need to be able to send the $request.body and $request.header.X-Hub-Signature-256. I need to send BOTH these values to my state machine as an input.

I have tried so many different ways. For example:

Input: " { body: $request.body, header: $request.header.X-Hub-Signature-256 }"

and

Input:
  $request.body
  $request.header.X-Hub-Signature-256 

and

Input: $request

Nothing seems to work. I am trying to follow the documentation here:

But nothing seems to point on how to pass multiple vars, only one.

I get different errors each time, but this is the main one:

Warnings found during import: Unable to create integration for resource at path 'POST /github/secret': Invalid selection expression specified: Validation Result: warnings : [], errors : [Invalid source: $request specified for destination: Input].

Any help on how to pass multiple values would so be appreciated.

1 Answer 1

1

According to this repost.aws post which describes a similar scenario:

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

So try using a REST API instead.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.