我正在尝试通过 cloudformation 模板为 AWS API Gateway 启用 cloudwatch 日志,但它没有启用。我已经尝试在阶段描述和方法设置中将日志记录级别设置为 INFO。知道我错过了什么吗?
当我通过 UI 手动启用日志记录时,它可以工作。当我尝试通过如下 cloudformation 模板启用时无法正常工作 -
注意:我只是使用普通的 cloudformation 模板,并且我已经在我的帐户中添加了有权访问 API Gateway 的角色 ARN 以记录 cloudwatch
TestDeployment:
Type: AWS::ApiGateway::Deployment
Properties:
Description: API Deployment
RestApiId: testApi
StageName: 'dev'
StageDescription:
Description: Stage - DEV
LoggingLevel: INFO
MethodSettings:
- ResourcePath: "/testresource"
HttpMethod: "POST"
LoggingLevel: INFO