-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
ApiGatewayV1 and ApiGatewayV2 should be restructured to allow route specific settings (throttling etc.) #4501
Comments
hey @vvashisht I haven't tried this, but can you transform the stage to define route settings (ie. throttling), and also disable |
That's sort of what I ended up doing. I haven't taken into account the #4498 fix yet, but this is what I did: When creating I then add routes to this Finally, I 'deploy' this
I might be able to simplify the last two steps because of the fix for #4498. I had to resort to a dummy stage because I can neither prevent its creation when instantiating What I haven't tried (or forgot if I did; I was trying a lot of things) is to disable I'll say this though, I understand the convenience of auto-created
|
I tried what you suggested. Set It doesn't work, I get the same error: Apparently AWS doesn't care if a stage is deployed or not; if you're going to specify route specific settings in the stage, those routes need to be created first. It's hard to say that this is unreasonable. I didn't proceed further with this experiment for now. |
ApiGatewayV2 constructor creates the stage automatically and therefore adding route specific settings does not work as the intended route keys haven't been created yet. And route keys can't be created without ApiGatewayV2 itself. This creates an unnecessary cyclic dependency. This can be avoided by necessitating an explicit stage() / deploy() method after routes have been added. Additionally, routes would need to be exposed as nodes so that an explicit dependency can be added on them before staging/deploying.
ApiGatewayV1 does have an explicit deploy() method but does not expose the already created stage and routes in nodes. If it did, one could use aws.apigateway.MethodSettings to add route specific settings with an explicit dependency on stage and routes.
The text was updated successfully, but these errors were encountered: