-
Notifications
You must be signed in to change notification settings - Fork 232
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
domain manager fails to work when an api gateway resource is defined (only) #221
Comments
After lots of playing with #217, with 2 apis and one gateway definition as above, for some reason it doesn't work adding the domain manager to the api-gateway definition and have no domain-manager plugin in the two api definitions (deploy works, resolution for both apis doesn't work). |
@rddimon Do you know if this issue is resolved? I.e., is it now possible to use domain manager on a naked gateway without lambdas? |
@rddimon After a lot of playing I noticed a key issue: As soon as the serverless file that defines the shared api gateway gets a function definition for the dummy handler, it will create a second api gateway in addition to the one in resources, which will then receive domain manager's full attention. The way to avoid that is to "self-reference" the resources api gateway in the api gateway file using a section like this inside
Then only things start to stay in sync. Would it be possible to change the domain manager logic so the dummy lambdas and all this additional complexity can be avoided? |
@rddimon I note an additional issue which is blocking for this workaround: The above accidentally worked when playing with an existing api gateway stack. However when creating a new stack, deployment of the dummy endpoint fails with this error:
..which seems correct as there is no stack yet to import the values from. They are from this section:
To work around this, I need a convoluted deploy process:
..to avoid the error
.. and finally, it works! Is this how the separate gateway is expected to work? |
Hi @bebbi It's no activity for a long time and hope you have found a solution! Closing it but feel free to reopen it in case of any related issues |
Hi @rddimon, it's been a while since I started that issue. I believe I was on "^5.1.0" while on that last issue comment. Something that would help might be a simple example of how to add this plugin to a serverless config that has no endpoints (just preparing its config for other, separate api configs). Thanks in any case! |
Hi @bebbi You can a look at the Also, in case you have any kind of solution for the issue, which you solved, you can create a PR with changes. |
Community Note
Bug Report
Error Description
If I have a separate serverless file with only an api gw definition and exports, why am I not able to run serverless-domain-manager on it? It seems confusing to me that it requires a lambda be present: the base-path mapping seems to live on the gateway and once I have it, other services importing the gateway will be reachable under the same domain.
It appears to be a bug to me that I cannot add the base path mapping to an api gateway if there is no lambda definition in there, because it breaks clean modularization.
Reviving #217 here because I thought about the dummy lambda but it seemed like a work-around than a resolution.
@sampsasaarela Very fortunately I'm not on latest yet and #219 didn't happen to me 😅.
Command Run
When deploying with the domain manager plugin with an api gateway resource but no lambdas such as in the linked example,
sls create_domain
workssls deploy
complains about missing deployment.Domain Manager Configuration
Versions
The text was updated successfully, but these errors were encountered: