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:
- Working with OpenAPI definitions for HTTP APIs.
- x-amazon-apigateway-integration object
- x-amazon-apigateway-integration.requestParameters object
- Working with AWS service integrations for HTTP APIs
- StepFunctions-StartExecution
- StartExecution
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.