-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Describe the feature
As software developer I would like to get the new created log group of an DatabaseInstance if the DatabaseInstance has the cloudwatchLogsExport property set, so that I can build metric filter based on that log group and I do not have to calculate the naming behavior like AWS does
Use Case
Currently in our database stack we get the log group of the DatabaseInstance by calculating the name by ourself which looks for the Metric filter Like this:
new MetricFilter(this, 'SomeID', {
logGroup: LogGroup.fromLogGroupName(this, 'SomeID', /aws/rds/instance/${this.databaseInstance.instanceIdentifier}/postgresql
),
filterPattern: FilterPattern.anyTerm('ERROR', 'Caused by', 'error'),
metricName: logMetrics.metricName,
metricNamespace: logMetrics.namespace,
defaultValue: 0,
metricValue: '1',
});
this indicates, that we always knew the DatabaseInstance identifier and the used engine. Also we rely here on the naming convention of AWS. This seems dangerous to me.
Proposed Solution
The DatabaseInstance has a method or Property which contains the log group name or ARN so that we can get it in other services.
Other Information
No response
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
CDK version used
2.23.0
Environment details (OS name and version, etc.)
Windows 10, Typescript