-
Notifications
You must be signed in to change notification settings - Fork 68
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
Full AWS APIG stage configuration #57
Comments
Currently not, but sounds like a good idea. How would you see a possible configuration? I would see it somewhere at function and service level. |
Here is the documentation for the API Gateway Stage MethodSettings. Is there a way we should default to values (where applicable) from the main serverless.yml file? |
I inspected the available stage settings and came to the conclusion that the plugin should offer a possibility to configure all of the stage settings instead of only the CW log settings. To limit possible conflicts with Serverless (in case someone wnats to add this as basic feature to the framework somewhen - I don't really believe in that 😈 ) I'd suggest that the stage setting would reside in an object prefixed with "alias". So the following definition would be possible at the service, function and http event level. Having these 3 locations would let us configure it globally, per function (affecting all endpoints in the function) or only for a specific endpoint. The defaults, if no option is set at all would be the configuration as it currently is in the plugin). If an option is not explicitly specified in the stage configuration it will be omitted from the CF template. I think that's the expected behavior. The order of application of multiple configurations would be The configuration at all locations will then be specified as (YAML):
If everyone agrees with this proposal I will implement it exactly that way. |
There will be two additional settings that can only be set on the service level:
I'll add these for completeness to have any possible stage configuration available |
Enable CloudWatch Logs
for APIG stage
Excerpt from the new README. Explains the exact use of the new feature: Stage configuration (NEW)The alias plugin supports configuring the deployed API Gateway stages, exactly as The configuration can be done on a service wide level, function level or method level
The aliasStage configuration objectAll settings are optional, and if not specified will be set to the AWS stage defaults.
There are two further options that can only be specified on a service level and that
For more information see the AWS::APIGateway::Stage or MethodSettings documentation Sample serverless.yml (partial):
|
The feature is available in master now. If someone could give it a try before I release 1.3 it would be great. I tested it thoroughly with different configuration combinations. I will release 1.3 tomorrow. |
Released! |
Is there a way to set the settings
Enable CloudWatch Logs
andEnable Detailed CloudWatch Metrics
for the APIG stage?In Cloudformation that would be the params in
AWS::ApiGateway::Stage
->MethodSettings
.The text was updated successfully, but these errors were encountered: