-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[ApiGateway] RestApi updates account level role used for ApiGateway CloudWatch logging #10878
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-apigatewayRelated to Amazon API GatewayRelated to Amazon API GatewaybugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp1
Description
This code in RestApi
| const resource = new CfnAccount(this, 'Account', { |
will update the account level role for cloudwatch logging used for all ApiGateways.
The problem we are seeing is that each new API we create will replace the role used for the account with the new role created.
If the stack that last updated the account level role gets deleted for some reason then the account level role will no longer exist and all apigateway cloudwatch logging is broken for the account 😱
Reproduction Steps
- create a new RestApi without passing a cloudWatchRole prop
- Deploy the new API - see the account level role change to the role associated with this new API
- Delete the stack
- All account level API logging no longer works because the role is deleted.
What did you expect to happen?
I would expect each apigateway logging role to be only used for a given API Gateway
or I would want the apigateway account level role to be rolled back to the previous role on deletion
What actually happened?
Described above
Environment
- CLI Version :
- Framework Version:
- Node.js Version:
- OS :
- Language (Version):
Other
Is passing a role into each API the best option to resolve this?
This is 🐛 Bug Report
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-apigatewayRelated to Amazon API GatewayRelated to Amazon API GatewaybugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp1