Skip to content
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

Feature Gap / Interface Mismatch: AlarmWidget, Alarm, and IAlarm #3068

Closed
Labels
@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch bug This issue is a bug.

Comments

@BBonifield
Copy link

I'm not sure if this is intended or an oversight, but AlarmWidgetProps is setup with readonly alarm: Alarm; rather than readonly alarm: IAlarm;. This prevents you from referencing alarms via Cloudwatch.Alarm.fromAlarmArn, which returns an IAlarm.

I ask because, for the underlying Cloudformation DashboadBody, I believe the following JSON structure is allowed, and it only requires the ARN:

{
  "type": "metric",
  "x": 0,
  "y": 6,
  "width": 6,
  "height": 3,
  "properties": {
    "title": "Availability (%)",
    "annotations": {
      "alarms": [
        "arn:aws:cloudwatch:some-specific-arn"
      ]
    },
    "view": "timeSeries",
    "stacked": false
  }
},

Thanks!

@eladb
Copy link
Contributor

eladb commented Jun 26, 2019

Confirming this is an issue. @shivlaks we should update our awslint rule to cover more than just props...

@rix0rrr rix0rrr added bug This issue is a bug. @aws-cdk/aws-cloudwatch Related to Amazon CloudWatch labels Jun 26, 2019
rix0rrr added a commit that referenced this issue Jul 5, 2019
This allows using an imported alarm.

Fixes #3068.
eladb pushed a commit that referenced this issue Jul 7, 2019
This allows using an imported alarm.

Fixes #3068.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment