Zappa
Zappa copied to clipboard
Allow configuration of custom stage prefix
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.
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?
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.
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.
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.