Hi, I was just wondering if it is possible to configure access logs for AWS apigateway through serverless framework. The behaviour which I noticed is
-
If you do not have apigateway config in provider section of serverless.yml file then serverless creates required apigateway stage as well as “access logging” by default unless explicitly turned off.
-
If you do have apigateway config in provider section which is our case then serverless ignores any configuration. we have provider section something like this -
provider:
name: aws
logs:
restApi:
role: arn:aws:iam::#{AWS::AccountId}:role/api-gateway-role
roleManagedExternally: true
runtime: nodejs10.x
stage: ${opt:stage}
apiGateway:
description: API Gateway for ${self:provider.stage}
restApiId: ${ssm:/prefix/${self:provider.stage}/API_GATEWAY_ID}}
restApiRootResourceId: ${ssm:/prefix/${self:provider.stage}/API_GATEWAY_ROOT_RESOURCE_ID}}
metrics: true
Please suggest.
Thanks!