Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CloudWatch log role ARN

I am trying to setup a really basic API with the AWS API Gateway product and it seems I can not find any policies which will suffice for it to log and for that matter even leave the first page of the settings screen. I am stuck here:

URL: https://eu-west-1.console.aws.amazon.com/apigateway/home?region=eu-west-1#/settings

and my desperations has led to the following permissions being granted to the role:

enter image description here

I've also added the following bespoke policy:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "logs:CreateLogGroup",
        "logs:CreateLogStream",
        "logs:PutLogEvents"
      ],
      "Resource": "arn:aws:logs:*:*:*"
    }
  ]
}

All to no avail. Whenever I press the save button I get the following:

enter image description here

Any help would be greatly appreciated.

like image 451
ken Avatar asked Sep 29 '15 20:09

ken


People also ask

Does CloudWatch have an Arn?

For log groups, CloudWatch Logs supports identifying specific resources using the resource ARNs (also referred to as resource-level permissions) for some of the API actions.

How do I enable CloudWatch Logs for APIS in API gateway?

Turn on logging for your API and stage On the Stage Editor pane, choose the Logs/Tracing tab. 3. On the Logs/Tracing tab, under CloudWatch Settings, do the following to turn on execution logging: Choose the Enable CloudWatch Logs check box.

How do I check my CloudWatch Logs API gateway?

To view API Gateway logs, log in to your AWS Console and select CloudWatch from the list of services. Select Logs from the left panel. Select the log group prefixed with API-Gateway-Execution-Logs_ followed by the API Gateway id. You should see 300 log streams ordered by the last event time.


1 Answers

This is actually an error with API Gateway not being able to assume that specific role. This is probably due to your role's Trust Relationship policy not allowing the API Gateway Service to assume the role.

If you add the following Trust Relationship policy, it should work:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "Service": "apigateway.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
like image 66
Paddez Avatar answered Oct 14 '22 05:10

Paddez