Can't pass querystring params through target of integration type http


I’ve done this through the AWS Console, but can’t seem to make it work via serverless.
I believe the problem lies in the fact that in serverless the http.integration is required to be a string, while CloudFormation expects it to be an Integration object which includes defining the RequestParameters list property.

The relevant section of my serverless.yml is:

    handler: applications/dummy.handler
      - http:
          path: /restapi/v1/search
          method: get
          cors: true
            arn: "arn:aws:cognito-idp:${self:custom.currentRegion}:############:userpool/${self:custom.userPoolId}"
          integration: http
            uri: "https://<cloudsearch-url-stuff>.<region>"
              'method.request.querystring.fq': false
              'method.request.querystring.pretty': false
              'method.request.querystring.q': true
              'method.request.querystring.q.cursor': false
              'method.request.querystring.q.options': false
              'method.request.querystring.q.parser': false
              'method.request.querystring.return': false
              'method.request.querystring.size': false
              'method.request.querystring.sort': false
              'method.request.querystring.start': false
                pattern: ''

The above successfully creates everything up to and including defining the querystring parameters on the API Gateway MethodRequest. But after sifting through the serverless source, I can’t find any way to define the required mapping in the IntegrationRequest.

Am I missing something?(probably)
Any help would be appreciated.


Playing around and figured out that if I sls package first:

  • sls package -s brett -p fubar

Then modify the fubar/serverless-state.json to include the Integration.RequestParameters it works:

  "Integration": {
	"IntegrationHttpMethod": "GET",
	"Type": "HTTP",
	"Uri": "https://<cloudsearch-url-stuff>.<region>",
	"RequestParameters": {
	  "integration.request.querystring.fq": "method.request.querystring.fq",
	  "integration.request.querystring.pretty": "method.request.querystring.pretty",
	  "integration.request.querystring.q": "method.request.querystring.q",
	  "integration.request.querystring.q.cursor": "method.request.querystring.q.cursor",
	  "integration.request.querystring.q.options": "method.request.querystring.q.options",
	  "integration.request.querystring.q.parser": "method.request.querystring.q.parser",
	  "integration.request.querystring.return": "method.request.querystring.return",
	  "integration.request.querystring.size": "method.request.querystring.size",
	  "integration.request.querystring.sort": "method.request.querystring.sort",
	  "integration.request.querystring.start": "method.request.querystring.start"
	"RequestTemplates": {

I I was trying to do this in cloudformation-template-update-stack.json, with no results. changing it in serverless-state.json made the params show up in aws.

Now the question is how can I make this work via setup in serverless.yml instead of manually mucking with the CF template?


I am looking for the similar and got this solution