Zappa icon indicating copy to clipboard operation
Zappa copied to clipboard

Allow configuration of custom stage prefix

Open 0x4d4e opened this issue 2 years ago • 2 comments

Context

We are using Zappa to host a Django app on Lambda, but are managing our API-GW outside of Zappa using the static prefix /v1/ on all APIs instead of the /stage/ prefixes expected by Zappa.

However, Zappa assumes that it is always running with the default /stage/ prefix (see. https://github.com/zappa/Zappa/blob/73ee393dd48500d321d65e92aba31a5fd83e93ab/zappa/handler.py#L554). As a result, any redirects returned by Django contain the incorrect /stage/ prefix instead of /v1/.

I have not found a configuration option for this? While we will be switching to custom domains anyways, it would still be nice to be able to override the default api prefix.

0x4d4e avatar Jan 13 '23 12:01 0x4d4e

I'm not clear on what the issue is.

It sounds like you're setting your api gateway stage to v1, but have your zappa stage set to stage, is that correct?

Is there an issue with setting your zappa defined stage to the desired, v1?

monkut avatar Feb 02 '23 04:02 monkut

We have multiple environments/stages in the same Zappa config (dev,test,staging, prod) with different configuration (mostly events from SNS/SQS. So just using v1 as stage would not work. We have bypassed the issue by setting up custom domains, which we did not use for the non-prod environments previously. Now the stage prefixes are no longer a problem.

I mainly opened this issue since we noticed some invalid redirect paths and were surprised by the assumption in Zappa to simply prefix the stage name to the request path without the ability to change it.

I understand that this is probably low priority and can be easily mitigated by using a custom domain.

0x4d4e avatar Feb 02 '23 07:02 0x4d4e

Hi there! Unfortunately, this Issue has not seen any activity for at least 90 days. If the Issue is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.

github-actions[bot] avatar Apr 03 '24 18:04 github-actions[bot]

Hi there! Unfortunately, this Issue was automatically closed as it had not seen any activity in at least 100 days. If the Issue is still relevant to the latest version of Zappa, please open a new Issue.

github-actions[bot] avatar Apr 13 '24 20:04 github-actions[bot]