Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploying an alias with authorizers overwrites dev alias. #96

Closed
crobot83 opened this issue Jan 24, 2018 · 5 comments
Closed

Deploying an alias with authorizers overwrites dev alias. #96

crobot83 opened this issue Jan 24, 2018 · 5 comments
Labels
Milestone

Comments

@crobot83
Copy link

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.

@HyperBrain
Copy link
Member

@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.

@zachboyd
Copy link
Contributor

zachboyd commented Jan 24, 2018

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.

@HyperBrain
Copy link
Member

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

@HyperBrain HyperBrain added the bug label Jan 24, 2018
@crobot83
Copy link
Author

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

zachboyd pushed a commit to zachboyd/serverless-aws-alias that referenced this issue Jan 25, 2018
@HyperBrain HyperBrain added this to the 1.6.0 milestone Jan 25, 2018
HyperBrain added a commit that referenced this issue Jan 26, 2018
Added support to append ${stageVariables.SERVERLESS_ALIAS} to authorizers of type REQUEST #96
@HyperBrain
Copy link
Member

Released with 1.6.0

defnotrobbie pushed a commit to 1stdibs/serverless-aws-alias that referenced this issue Nov 14, 2022
defnotrobbie pushed a commit to 1stdibs/serverless-aws-alias that referenced this issue Nov 14, 2022
…est-fix

Added support to append ${stageVariables.SERVERLESS_ALIAS} to authorizers of type REQUEST serverless-heaven#96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants