23

I configure Custom Access Logging for Amazon API Gateway and I need to specify CloudWatch Group name, but when I put these just name of log group in format like "API-Gateway-Execution-Logs_3j5w5m7kv9/stage-name" I get such error:

Invalid ARN specified in the request. ARNs must start with 'arn:': API-Gateway-Execution-Logs_3j5w5m7kv9/stage-name

When I open page of this log group in CloudWatch I just see the same name there and don't see ARN value. How can I find it?

Yuri
  • 4,254
  • 1
  • 29
  • 46
Hleb
  • 7,037
  • 12
  • 58
  • 117

6 Answers6

41

Go to Cloudwatch logs, find your log group, open it and you'll see a list of log streams. There is settings icon on top right: enter image description here

Click it and you'll see an option to show stream arn:

enter image description here

Save the settings and you'll see stream arns. The part before semicolon looks like Log Group arn

jny
  • 8,007
  • 3
  • 37
  • 56
6

The CloudWatch Group ARN format is arn:aws:logs:{region}:{account-id}:log-group:API-Gateway-Execution-Logs_{rest-api-id}/{stage-name}, cf. https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html

holm50
  • 821
  • 8
  • 7
2
arn:aws:logs:region:account-id:log-group:log_group_name

See this documentation

Das_Geek
  • 2,775
  • 7
  • 20
  • 26
2

2022 Update

Select your log group:

enter image description here

Click Log Group Details:

enter image description here

Copy the ARN:

enter image description here

harrolee
  • 495
  • 5
  • 11
1

You can also use AWS CLI

aws logs describe-log-groups | grep <log_group_name> | awk '/arn/'

0

Or you could do a aws logs describe-log-groups | grep <name_of_group>

That works too.

krystan honour
  • 6,523
  • 3
  • 36
  • 63