Skip to content

Commit ebe2adf

Browse files
authored
fix(cloudwatch): allow up to 30 dimensions for metric (#29341)
### Issue # (if applicable) Closes #29322. ### Reason for this change [AWS::CloudWatch::Alarm](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudwatch-alarm.html) allows up to 30 dimension items, while the L2 [construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.Metric.html#dimensions) for Metric allows up to 10. ### Description of changes Increased hard limit from 10 -> 30 ### Description of how you validated changes Updated unit test, added new integration test ### Checklist - [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 7205143 commit ebe2adf

11 files changed

+587
-6
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/aws-cdk-cloudwatch-metric-dimensions.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"Resources": {
3+
"queue": {
4+
"Type": "AWS::SQS::Queue"
5+
},
6+
"Alarm7103F465": {
7+
"Type": "AWS::CloudWatch::Alarm",
8+
"Properties": {
9+
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
10+
"DatapointsToAlarm": 2,
11+
"Dimensions": [
12+
{
13+
"Name": "BlankD1",
14+
"Value": "value1"
15+
},
16+
{
17+
"Name": "BlankD10",
18+
"Value": "value10"
19+
},
20+
{
21+
"Name": "BlankD2",
22+
"Value": "value2"
23+
},
24+
{
25+
"Name": "BlankD3",
26+
"Value": "value3"
27+
},
28+
{
29+
"Name": "BlankD4",
30+
"Value": "value4"
31+
},
32+
{
33+
"Name": "BlankD5",
34+
"Value": "value5"
35+
},
36+
{
37+
"Name": "BlankD6",
38+
"Value": "value6"
39+
},
40+
{
41+
"Name": "BlankD7",
42+
"Value": "value7"
43+
},
44+
{
45+
"Name": "BlankD8",
46+
"Value": "value8"
47+
},
48+
{
49+
"Name": "BlankD9",
50+
"Value": "value9"
51+
},
52+
{
53+
"Name": "QueueName",
54+
"Value": {
55+
"Fn::GetAtt": [
56+
"queue",
57+
"QueueName"
58+
]
59+
}
60+
}
61+
],
62+
"EvaluationPeriods": 3,
63+
"MetricName": "ApproximateNumberOfMessagesVisible",
64+
"Namespace": "AWS/SQS",
65+
"Period": 300,
66+
"Statistic": "Average",
67+
"Threshold": 100
68+
}
69+
}
70+
},
71+
"Parameters": {
72+
"BootstrapVersion": {
73+
"Type": "AWS::SSM::Parameter::Value<String>",
74+
"Default": "/cdk-bootstrap/hnb659fds/version",
75+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
76+
}
77+
},
78+
"Rules": {
79+
"CheckBootstrapVersion": {
80+
"Assertions": [
81+
{
82+
"Assert": {
83+
"Fn::Not": [
84+
{
85+
"Fn::Contains": [
86+
[
87+
"1",
88+
"2",
89+
"3",
90+
"4",
91+
"5"
92+
],
93+
{
94+
"Ref": "BootstrapVersion"
95+
}
96+
]
97+
}
98+
]
99+
},
100+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
101+
}
102+
]
103+
}
104+
}
105+
}

packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/cdk.out

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/integ.json

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/manifest.json

+119
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/metricwithdimensionstestDefaultTestDeployAssert1196DF0F.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-cloudwatch/test/integ.metric-with-dimensions.js.snapshot/metricwithdimensionstestDefaultTestDeployAssert1196DF0F.template.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)