How to enable cloud watch logs for API Gateway using Serverless

When I followed the setting and add the new resource ApiGatewayStage, I got this error.

 An error occurred: ApiGatewayStage - dev already exists.

Do you know how to fix it?

I didn’t set stage in provider, so it uses the default stage, dev, do I have to set other name to avoid the error?

update #1

After I remove and deploy again, this issue is gone, now have another:

An error occurred: ApiGatewayStage - CloudWatch Logs role ARN must be set in account settings to enable logging.

But I have set the iamRoleStatements:

  iamRoleStatements:
    - Effect: Allow
      Action:
        - cloudwatch:*
        - logs:*
      Resource:
        - "*"

update #2

I have added the role in provider part, but still get same error

 role: arn:aws:iam::xxxx:role/serverless-lambda-role
1 Like