AWS endpoint not being deployed to stages when using Serverless

Viewed 57

I'm trying to add a new endpoint to an existing service, and while it shows on the API Gateway Resources page, it's not showing on the Stages page. Hitting the endpoint returns the header x-amzn-ErrorType as IncompleteSignatureException and an error that includes the JWT token and not a valid key=value pair (missing equal-sign) in Authorization header.

Our setup uses a swagger file to define the endpoints, and uses x-amazon-apigateway-integration to link the endpoint to the lambda function. On first deployment of the new endpoint, we had some problems as this integration was setup wrong, but has since been corrected to match the others (suspect this is where the problem lies).

I've tried making sure that the new endpoint config matches that of other working endpoints; I've removed the endpoint, redeployed, added it back and redeployed; I've renamed the lambda. None of these have worked.

The swagger file looks like:

  /companies/{id}/info:
    get:
      consumes:
        - application/json
      produces:
        - application/json
      responses:
        "200":
          description: successful operation
          headers:
            Access-Control-Allow-Origin:
              type: string
      x-amazon-apigateway-integration:
        uri:
          Fn::Join:
            - ""
            - - Fn::Join:
                  - ""
                  - - "arn:aws:apigateway:"
                    - Ref: AWS::Region
                    - ":lambda:path/2015-03-31/functions/"
              - Fn::GetAtt:
                  - GetCompanyInfoLambdaFunction
                  - Arn
              - "/invocations"
        httpMethod: POST
        type: aws_proxy
    post:
      #... this method works fine with same config but different lambda

Any ideas as to how to fix this? Thanks

0 Answers
Related