@infoxchange/make-it-so 2.17.2 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,6 +14,7 @@ type CloudWatchAlarmProps = Omit<CloudWatch.AlarmProps, "metric" | "treatMissing
14
14
  treatMissingData?: CloudWatch.AlarmProps["treatMissingData"] | ((option: typeof CloudWatch.TreatMissingData) => CloudWatch.TreatMissingData);
15
15
  comparisonOperator: CloudWatch.AlarmProps["comparisonOperator"] | ((option: typeof CloudWatch.ComparisonOperator) => CloudWatch.ComparisonOperator);
16
16
  actions?: AlarmActions;
17
+ toNotify?: string[];
17
18
  };
18
19
  export declare class IxCloudWatchAlarm extends Construct {
19
20
  constructor(scope: Construct, id: string, props: CloudWatchAlarmProps);
@@ -1 +1 @@
1
- {"version":3,"file":"IxCloudWatchAlarm.d.ts","sourceRoot":"","sources":["../../src/cdk-constructs/IxCloudWatchAlarm.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,4BAA4B,CAAC;AACpD,OAAO,GAAG,MAAM,aAAa,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AASvC,KAAK,YAAY,GAAG;IAClB,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;IAC5C,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;IAC/C,kBAAkB,CAAC,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;CAC3D,CAAC;AAEF,KAAK,oBAAoB,GAAG,IAAI,CAC9B,UAAU,CAAC,UAAU,EACrB,QAAQ,GAAG,kBAAkB,GAAG,oBAAoB,CACrD,GAAG;IACF,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,QAAQ,GAAG,WAAW,CAAC,GAAG;QAC7D,MAAM,CAAC,EACH,U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Q,sBAAgB;IAC/B,MAAM,CAAC,gBAAgB,qCAA+B;IACtD,MAAM,CAAC,kBAAkB,uCAAiC;CAC3D"}
@@ -11,8 +11,17 @@ import ixDeployConfig from "../deployConfig.js";
11
11
  export class IxCloudWatchAlarm extends Construct {
12
12
  constructor(scope, id, props) {
13
13
  super(scope, id);
14
+ if (props.toNotify && props.alarmDescription?.includes(". notify:")) {
15
+ throw new Error("Alarm description cannot include '. notify:' if using the toNotify property.");
16
+ }
14
17
  const normalizedProps = {
15
18
  ...props,
19
+ alarmDescription: [
20
+ props.alarmDescription,
21
+ props.toNotify ? `notify: ${props.toNotify.join(",")}` : null,
22
+ ]
23
+ .filter(Boolean)
24
+ .join("\n"),
16
25
  metric: {
17
26
  ...props.metric,
18
27
  period: typeof props.metric.period === "function"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infoxchange/make-it-so",
3
- "version": "2.17.2",
3
+ "version": "2.18.0",
4
4
  "description": "Makes deploying services to IX infra easy",
5
5
  "repository": "github:infoxchange/make-it-so",
6
6
  "publishConfig": {
@@ -39,6 +39,7 @@ type CloudWatchAlarmProps = Omit<
39
39
  option: typeof CloudWatch.ComparisonOperator,
40
40
  ) => CloudWatch.ComparisonOperator);
41
41
  actions?: AlarmActions;
42
+ toNotify?: string[];
42
43
  };
43
44
 
44
45
  type NormalizedCloudWatchAlarmProps = Omit<CloudWatch.AlarmProps, "metric"> & {
@@ -50,8 +51,20 @@ export class IxCloudWatchAlarm extends Construct {
50
51
  constructor(scope: Construct, id: string, props: CloudWatchAlarmProps) {
51
52
  super(scope, id);
52
53
 
54
+ if (props.toNotify && props.alarmDescription?.includes(". notify:")) {
55
+ throw new Error(
56
+ "Alarm description cannot include '. notify:' if using the toNotify property.",
57
+ );
58
+ }
59
+
53
60
  const normalizedProps = {
54
61
  ...props,
62
+ alarmDescription: [
63
+ props.alarmDescription,
64
+ props.toNotify ? `notify: ${props.toNotify.join(",")}` : null,
65
+ ]
66
+ .filter(Boolean)
67
+ .join("\n"),
55
68
  metric: {
56
69
  ...props.metric,
57
70
  period: