-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cloudwatch): use string
for DimensionHash
#14978
Conversation
The [CloudWatch metric dimension object specifies that dimension values are strings](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Dimension.html). This is caught at build time by the CDK which throws the following if you pass a numeric value as a dimension: ``` CfnSynthesisError: Resolution error: Supplied properties not correct for "CfnAlarmProps" dimensions: element 0: supplied properties not correct for "DimensionProperty" value: 429 should be a string. ``` But we should catch it at dev time with the correct type hint
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Hey @cheruvian thanks for your patience on this PR! After looking into this, I don't think it will be possible to change the DimensionHash type to support the kind of dev-time type-checking you want without introducing backwards compatibility and/or JSII compilation issues. An alternative approach would be to introduce a new property with a new type, and deprecate this one. Here is a PR doing that - #15097, let me know what you think. |
Closing this PR in favor of PR #15097 |
The CloudWatch metric dimension object specifies that dimension values are strings.
This is caught at build time by the CDK which throws the following if you pass a numeric value as a dimension:
But we should catch it at dev time with the correct type hint
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license