3

I have created a Integration Request, I am trying to add headers to that request using AWS cloudshell:

aws apigateway update-integration --rest-api-id abcdefgh --resource-id abcdefghj --http-method POST --request-parameters {"integration.request.header.X-mobile":"context.authorizer.mobile"}

But it is not working, I have tried PUT integration as well, It was giving the below error:

An error occurred (BadRequestException) when calling the PutIntegration operation: Enumeration value for HttpMethod must be non-empty

HMT
  • 2,093
  • 1
  • 19
  • 51

2 Answers2

0

Try add those command options:

  • --integration-type eg. AWS_PROXY
  • --integration-method eg. POST
  • --integration-uri eg. arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${LambdaForSimpleProxy.Arn}/invocations

Here you will find values exmple: Lambda Proxy

I had similar issue in cloudformation, when you are using integration some options are conditional AWS::ApiGateway::Method Integration

Unfortunately aws cli docs doesn't mention this.

robertbeb
  • 1,520
  • 1
  • 10
  • 13
0

Adding --integration-http-method POST solved it for me when doing this with AWS CLI.

As per the documentation:

For Lambda integrations, you must use the HTTP method of POST for the integration request, according to the specification of the Lambda service action for function invocations.