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

Make alarm creation optional #85

Closed
dscpinheiro opened this issue Oct 8, 2020 · 1 comment
Closed

Make alarm creation optional #85

dscpinheiro opened this issue Oct 8, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@dscpinheiro
Copy link
Contributor

dscpinheiro commented Oct 8, 2020

For a few services (Kinesis Data Streams, Elasticsearch, and Step Functions), Constructs automatically creates some CloudWatch alarms. However, even though they're available as properties, it's not possible to modify them:

// Deploy best practices CW Alarms for Kinesis Stream
this.cloudwatchAlarms = defaults.buildKinesisStreamCWAlarms(this);
const someAlarm = this.cloudwatchAlarms[0];

// I can get the metric configuration, but that doesn't allow me to change anything (such as thresholds)
// This metricConfig object only contains metadata about the metric, such as which stat (avg, max, etc) was used
const metricConfig = someAlarm.metric.toMetricConfig();

// Other than adding actions, there's not a lot I can do on the alarm itself either
someAlarm.addAlarmAction();

Use Case

Customers might have different requirements to the defaults used by Constructs (for example, they might want to be alerted when IteratorAge goes above 1 hour - instead of 12). They'd create this custom alarm on their CDK project, and would not want any duplication.

Proposed Solution

In all constructs that add alarms, add an option customers can set to false to disable their creation:

/**
 * Whether to create recommended CloudWatch alarms
 *
 * @default - Alarms are created
 */
readonly createCloudWatchAlarms?: boolean

This is a 🚀 Feature Request

@dscpinheiro dscpinheiro added feature-request A feature should be added or improved needs-triage The issue or PR still needs to be triaged labels Oct 8, 2020
@hnishar hnishar self-assigned this Oct 9, 2020
@hnishar hnishar added enhancement New feature or request and removed feature-request A feature should be added or improved needs-triage The issue or PR still needs to be triaged labels Oct 9, 2020
@hnishar
Copy link
Contributor

hnishar commented Oct 9, 2020

Pushed out in the latest release v1.67.0

@hnishar hnishar closed this as completed Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants