-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
By default every new RestApi instance replaces the single CloudWatch Role on API Gateway #7140
Comments
You are correct, in that this is confusing behaviour. The problem is exacerbated by the fact that this property is configured on an instance of Since the API has been out there for a long time and our API Gateway module is stable, we cannot change this default. It will change the behaviour on all new CDK deployments, and customers will not know that this has changed. A better approach may be to deprecate this property, and add a new property (either in RestApi or as a separate construct) with the correct default and behaviour. |
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. |
I think this could be closed as a dup of #10878? |
|
We discovered that our API Gateway cloudwatch role was being overwritten by deployments of
RestApi
constructs. The CloudWatch Role is associated with the API Gateway's Account resource. The API Gateway only supports 1 role for providing it the permissions required to write to CloudWatch so it seems strange to assume that every RestApi deployed is going to want to create that role and update the API Gateway Account automatically.The
cloudWatchRole
property ofRestApiProps
should default to false.Reproduction Steps
In an AWS account that has already setup API Gateway's CloudWatch Role (by whatever means) run:
Note the
cloudwatchRoleArn
and deploy a new stack that uses theRestApi
construct without providing a value for thecloudWatchRole
property. When you runaws apigateway get-account
again you will see that theRestApi
construct creates a new role and overwrites the role association that was previously established with API Gateway's Account resource.Error Log
In our case we found that when the role was replaced our existing api gateway deployments were no longer able to write to cloudwatch logs. Our workaround is to do our best to ensure that nobody creates a
RestApi
construct without setting thecloudWatchRole
property tofalse
.Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: