question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[apigateway] Ability to specify custom cloudwatch role

See original GitHub issue

Take a look there: https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-apigateway/lib/restapi.ts#L505

Class SpecRestApi always invokes configureCloudWatchRole (in case if props.cloudWatchRole missed as well in case if props.cloudWatchRole specified)

https://github.com/aws/aws-cdk/blob/384f9cb5e90dba577a216d04cfc0f85a1fc94714/packages/%40aws-cdk/aws-apigateway/lib/restapi.ts#L394

Method configureCloudWatchRole unconditionally create new role.

As result, props.cloudWatchRole option does not make any sense

Reproduction Steps

new apigateway.LambdaRestApi(.... { cloudWatchRole: <some role>})

What did you expect to happen?

AWS::ApiGateway::Account uses my role

What actually happened?

AWS::ApiGateway::Account uses unconditionally created role from configureCloudWatchRole

Environment

  • CLI Version : does not matter
  • Framework Version:: 1.61.0
  • Node.js Version: does not matter
  • OS : does not matter
  • Language (Version): TypeScript (3.8.3)

This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
nija-atcommented, Oct 21, 2020

@alvyn279 - this CfnAccount cloudwatch role area has a few holes here that needs a proper re-think and re-design. We’ve got issues like https://github.com/aws/aws-cdk/issues/7140, https://github.com/aws/aws-cdk/issues/10722 and https://github.com/aws/aws-cdk/issues/10878 in our repo.

I would recommend picking something else up, if you’re looking to contribute to the CDK. On the other hand, the workaround I’ve provided above should work if you’re looking to fix this specific issue.

0reactions
github-actions[bot]commented, Jun 17, 2022

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Turn on CloudWatch logs for API Gateway REST APIs and ...
Create an IAM role for logging to CloudWatch ... 1. In the AWS Identity and Access Management (IAM) console, in the navigation pane,...
Read more >
How to enable CloudWatch logs for API Gateway
Navigate to Services -> IAM. · Click Roles. · Click Create a New Role Button. · Choose a name, I recommend the format:...
Read more >
The Missing Guide to AWS API Gateway Access Logs
To allow your API Gateway to write to a CloudWatch Logs log group, you need to associate an IAM role that has permissions...
Read more >
Enable CloudWatch logs for API Gateway - YouTube
In my this video you will learn how to enable CloudWatch Logs while troubleshooting your API Gateway API.Also I have discussed about a ......
Read more >
Configuring logging of AWS API Gateway - Stack Overflow
Create API Gateway -> go to Stages-> Logs/Tracing · Try to activate checkbox Enable CloudWatch Logs but got CloudWatch Logs role ARN must...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found