Skip to content

Commit

Permalink
fix(aws-cloudwatch): metric id should be started with a lowercase letter
Browse files Browse the repository at this point in the history
fixes #13434
  • Loading branch information
BLasan committed Mar 12, 2021
1 parent d3f4284 commit 24e012b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-cloudwatch/lib/alarm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class Alarm extends AlarmBase {
return dispatchMetric(metric, {
withStat(stat, conf) {
self.validateMetricStat(stat, metric);

const id = 'm_' + stat.metricName
if (conf.renderingProperties?.label == undefined) {
return dropUndefined({
dimensions: stat.dimensions,
Expand All @@ -283,7 +283,7 @@ export class Alarm extends AlarmBase {
stat: stat.statistic,
unit: stat.unitFilter,
},
id: stat.metricName,
id: id,
label: conf.renderingProperties?.label,
returnData: true,
} as CfnAlarm.MetricDataQueryProperty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"Properties": {
"Metrics": [
{
"Id": "Metric",
"Id": "m_Metric",
"Label": "Metric [AVG: ${AVG}]",
"MetricStat": {
"Metric": {
Expand All @@ -28,7 +28,7 @@
"Properties": {
"Metrics": [
{
"Id": "Metric",
"Id": "m_Metric",
"Label": "Metric [AVG: ${AVG}]",
"MetricStat": {
"Metric": {
Expand Down

0 comments on commit 24e012b

Please sign in to comment.