-
Notifications
You must be signed in to change notification settings - Fork 4.5k
apigateway: StageOptions data_trace_enabled should not be used in production #17578
Description
link to reference doc page
Describe your issue?
When creating the StageOptions construct for a RestApi, there is a data_trace_enabled flag. This actually maps to the "Log full requests/responses data" checkbox in the console, which is not at all obvious. Furthermore, the console docs specifically mention this options should not be enabled in production. This warning ought to be added to the CDK documentation.
https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html
This can be useful to troubleshoot APIs, but can result in logging sensitive data. We recommend that you don't enable Log full requests/responses data for production APIs.
Furthermore, while the docs claim that the default value is false, this is not entirely true. If you first deploy with data_trace_enabled=True, and then remove the property entirely, then it is left enabled.