[apigateway] Ability to specify custom cloudwatch role
See original GitHub issueTake 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)
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:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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.
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.