The AWS AWS::ApiGateway::Deployment StageDescription docs don't seem to reference the option "Log full requests/responses data" in the API gateway stage settings. I want to ensure it is turned off in cloudformation, how can I do this?
This shows the option I am refering to:
To view event logs for the stack, right-click the stack's name. The AWS Toolkit for JetBrains displays the event logs in the CloudFormation tool window. To hide or show the CloudFormation tool window, on the main menu, choose View, Tool Windows, CloudFormation.
Enabling logging in API Gateway for your stage is fairly easy. You go into the Console, setup a role for API Gateway to use for logging, find the stage and enable logs. It will enable logging for all methods within that stage.
Provides a settings of an API Gateway Account. Settings is applied region-wide per provider block. Note: As there is no API method for deleting account settings or resetting it to defaults, destroying this resource will keep your account settings intact.
On the Logs/Tracing tab, under CloudWatch Settings, do the following to turn on execution logging: Choose the Enable CloudWatch Logs check box. For Log level, choose INFO to generate execution logs for all requests. Or, choose ERROR to generate execution logs only for requests to your API that result in an error.
The MethodSetting
are not property of AWS::ApiGateway::Deployment
. Instead, they are property of AWS::ApiGateway::Stage
- MethodSetting:
The MethodSetting property type configures settings for all methods in a stage.
The DataTraceEnabled is the setting on the screenshot. Thus if you don't want it, set it to false
:
Indicates whether data trace logging is enabled for methods in the stage. API Gateway pushes these logs to Amazon CloudWatch Logs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With