Support cross-account visibility on Metric and Log Widget Objects by allowing customers to specify the AWS Account ID that the data (logs or metrics) originates from. For more information, see Cross-Account Cross-Region CloudWatch Console.
CloudWatch docs shows that accountId is supported in CloudFormation for Logs Widget Objects and Metric Widget Objects.
Description of changes
Added an optional accountId property to LogQueryWidgetProps and MetricWidgetProps. This allows you to set an Account ID on LogQueryWidget and the four different metric widgets:
AlarmWidget
GaugeWidget
GraphWidget
SingleValueWidget
Description of how you validated changes
Unit Tests
In graph.test.ts, I added the accountId property to existing tests on each of the five Widget types mentioned above, validating that they appear in the synthesized stack.
Integ Tests
Same as above, I added accountId property to existing integ tests (integ.math-alarm-and-dashboard.ts and integ.alarm-and-dashboard.ts) on each of the five Widget types, updated the snapshots and successfully deployed the integ tests.
Closes #26105
Reason for this change
Support cross-account visibility on Metric and Log Widget Objects by allowing customers to specify the AWS Account ID that the data (logs or metrics) originates from. For more information, see Cross-Account Cross-Region CloudWatch Console.
CloudWatch docs shows that
accountId
is supported in CloudFormation for Logs Widget Objects and Metric Widget Objects.Description of changes
Added an optional
accountId
property toLogQueryWidgetProps
andMetricWidgetProps
. This allows you to set an Account ID onLogQueryWidget
and the four different metric widgets:AlarmWidget
GaugeWidget
GraphWidget
SingleValueWidget
Description of how you validated changes
Unit Tests
In
graph.test.ts
, I added theaccountId
property to existing tests on each of the five Widget types mentioned above, validating that they appear in the synthesized stack.Integ Tests
Same as above, I added
accountId
property to existing integ tests (integ.math-alarm-and-dashboard.ts
andinteg.alarm-and-dashboard.ts
) on each of the five Widget types, updated the snapshots and successfully deployed the integ tests.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license