-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
cloudwatch: GaugeWidget with annotations produces invalid JSON #25496
Comments
Yes I can reproduce this with the following code: export class Demo2Stack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
const dashboard = new cloudwatch.Dashboard(this, 'Dashboard');
const widget = new cloudwatch.GaugeWidget({
title: "My gauge widget",
metrics: [ new cloudwatch.Metric({
namespace: "AWS/VPN",
metricName: "TunnelState",
dimensionsMap: {
TunnelIpAddress: "123.123.123.123",
},
statistic: "Minimum",
})],
leftYAxis: {
min: 0,
max: 1,
},
annotations: [
{
color: "#b2df8d",
label: "Up",
value: 1,
fill: cloudwatch.Shading.ABOVE,
},
],
statistic: "Minimum",
period: Duration.minutes(1),
width: 6,
height: 6,
});
dashboard.addWidgets(widget);
}
} And I got the error on cdk deploy:
|
Yep, the same for me when I add horizontal annotations for gauge widget: AWS support team confirmed the bug as well. |
Same for me. If you drop the annotations everything works fine. But this gives us not the possibility to add areas for a DevOps dashboard. |
Same for me! |
Same for me, its broken. |
Creating a gauge widget on the console and looking at the source shows that the annotations do not have a yAxis property. This looks like it should not have been added in the first place. Will open a PR to fix this. |
Hi there! Thanks to all the people that commented, but if your comment is just that you are having a similar problem, please instead use the 👍 reaction on the top comment. Sorting by reactions is one data point we use to prioritize our issue backlog. We're working on this one now :) |
…ailures (#27720) A badly formed annotation was being added when annotations were set for gauge widgets (`yAxis: 'annotations'`). This caused errors on deployment. This change removes that extra annotation. Closes #25496. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…ailures (#27720) A badly formed annotation was being added when annotations were set for gauge widgets (`yAxis: 'annotations'`). This caused errors on deployment. This change removes that extra annotation. Closes #25496. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the bug
Hey folks,
Consider the following GaugeWidget:
This will be converted to the following JSON:
The "yAxis" value is "annotations" as a result of:
aws-cdk/packages/aws-cdk-lib/aws-cloudwatch/lib/graph.ts
Line 237 in 4038274
Expected Behavior
The JSON should've been generated with a value that's accepted by CloudWatch.
Current Behavior
See above - the annotations contain an invalid yAxis.
Reproduction Steps
See snippet above.
Possible Solution
Add test cases for GauageWidget with annotations. Emit a valid yAxis.
Additional Information/Context
No response
CDK CLI Version
2.75.0 (build 37c53d6)
Framework Version
No response
Node.js Version
v18.16.0
OS
MacOS 13.3.1
Language
Typescript
Language Version
No response
Other information
#22213
The text was updated successfully, but these errors were encountered: