serverless-heaven/serverless-aws-alias

Deploying an alias with authorizers overwrites dev alias.

crobot83 opened this issue · 5 comments

Example:
Deploy a "newAlias" with an existing "dev" alias. The Authorizers of type "REQUEST" will overwrite the existing "dev" alias authorizers.

Appending a stage variable as a suffix to the lambda for authorizer should fix the situation.

Workaround appears to be going into API Gateway -> Instance -> Authorizers -> Edit authorizer and save.

@crobot83 Thanks for reporting.

Do you mean, that the function itself gets overwritten or the authorizer definition in the APIG?
Or is the workaround to just add the alias name to the target lambda name (like my-auth-lambda:${SERVERLESS_ALIAS}) ?

Please explain it in more detail, so that it is clear what exactly happens.

Based on the description above, I think the core issue is that authorizers of type REQUEST do not have the stage variable appended.

i.e

REQUEST type authorizer -> my-custom-lambda
TOKEN type authorizer -> my-custom-lambda:${stageVariables.SERVERLESS_ALIAS}

I have also seen an issue where you do have to "Edit" and then "Save" the REQUEST type authorizers within AWS console so that they function correctly. However, this may be unrelated to the issue referenced above.

Thanks, yes that makes sense. I agree that the handling should be the same.

Sorry for my lack of clarity, @zachboyd is correct.

Released with 1.6.0