Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Log full requests/responses data" in cloudformation

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:

like image 353
Morgoth Avatar asked Jul 06 '20 06:07

Morgoth


People also ask

Where can I find CloudFormation logs?

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.

How do I enable CloudWatch logs for API gateway using 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.

What is Aws_api_gateway_account?

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.

How do I enable execution logs in API gateway?

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.


1 Answers

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.

like image 79
Marcin Avatar answered Oct 07 '22 17:10

Marcin