[fixed] how to create log group?

I think this is a simple job.

$ serverless create --template aws-nodejs --path my-service
$ cd my-service

# add a new resource `AWS::Logs::LogGroup` into `serverless.yml`

$ cat serverless.yml

service:  my-service

  name: aws
  runtime: nodejs6.10

    handler: handler.hello

      Type: AWS::Logs::LogGroup
        LogGroupName: /aws/apigateway/${self:service}-AccessLogs

When run sls deploy, there is no any error. But I don’t see the log group /aws/apigateway/my-service-AccessLogs is created.

Check the cloudformation template cloudformation-template-update-stack.json, two logs groups need be created.

"HelloLogGroup": {
  "Type": "AWS::Logs::LogGroup",
  "Properties": {
    "LogGroupName": "/aws/lambda/my-service-dev-hello"

"AccessLogs": {
  "Type": "AWS::Logs::LogGroup",
  "Properties": {
    "LogGroupName": "/aws/apigateway/my-service-AccessLogs"

but why I can’t see it in cloudwatch?

Any hints for me?

I finally saw an error when click its resource from the related cloudformation stack:

There was an error loading Log Streams. Please try again by refreshing this page.


I fixed it with the answer from aws:


Could you try going through the process at https://portal.aws.amazon.com/billing/signup?type=resubscribe and then verify if you still see the error?
The problem might be that accounts created long time ago would not subscribe to new services automatically. Going through above process will make the account subscribed to all existing services and future new services.
Similar post: https://forums.aws.amazon.com/message.jspa?messageID=618428

This is my first time to know this resubscribe feature. Good to know.

Another fix

Furthermore, I met the same problem in another aws account, which need an extra step:

here is the link to activate the services on the account:
Once the services are activated and support, the EULA is signed.

Seems the owner to apply the account forgot to active EULA (End user license agreement). After actived EULA and resubscribe, the problem is fixed.

are you able to figure out why two log groups are being created? even you have give only one to create

Serverless will automatically create a log group, so this config is creating an additional one. You can disable the automatic one with disableLogs: true

Can you help me config Serverless cloudWatch?
My config
handler: lambda/index.functionLogsLB
- cloudwatchLog: ‘/aws/logs/name-logs’
But I have an error: he specified log group does not exist. (Service: AWSLogs; Status Code: 400; Error Code: ResourceNotFoundException; Request ID: <id>; Proxy: null).
Can help me if I mistake something

1 Like