Skip to content

Renaming a Serverless::Function used by an Api Gateway does not deploy the Gateway #634

@jceloi

Description

@jceloi

Description:

Only renaming (no code change) a Serverless::Function using a FunctionName property does not trigger an Api Gateway stage deploy and the API Gateway stage still points to the previous lambda, which in that case does not exist anymore, generating an internal server error.

Manually triggering an API Gateway deploy does solve the problem, but according to me that should be done automatically when the FunctionName changes.

Steps to reproduce the issue:

  1. Using cloudformation, create an AWS::Serverless::Api pointing at a AWS::Serverless::Function . Deploy it, check that the calls are correctly triggering the lambda.
  2. Add a static FunctionName property to the Function, different than the one previously generated during the first deploy. Redeploy the stack.
  3. Try to call the lambda through the api gateway again.

Observed result:

  • Error 500, Internal Server Error code
  • No event is routed to the lambda function

Expected result:

  • Correct invocation of the lambda function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions