Skip to content

Commit 1af7ec2

Browse files
authored
Merge pull request #24 from DataChefHQ/fix/subscribers-not-optional
fix: subscribers field is mandatory
2 parents 0dfd4c4 + 7f233c0 commit 1af7ec2

File tree

3 files changed

+39
-39
lines changed

3 files changed

+39
-39
lines changed

API.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -456,16 +456,16 @@ public readonly applicationName: string;
456456
```typescript
457457
import { ApplicationCostMonitoringProps } from 'cost-monitoring-construct'
458458

459-
new ApplicationCostMonitoringProps(applicationName: string, monthlyLimitInDollars: number, otherStacksIncludedInBudget?: Stack[], defaultTopic?: string, subscribers?: string[], costAllocationTag?: string)
459+
new ApplicationCostMonitoringProps(applicationName: string, monthlyLimitInDollars: number, subscribers: string[], otherStacksIncludedInBudget?: Stack[], defaultTopic?: string, costAllocationTag?: string)
460460
```
461461

462462
| **Name** | **Type** | **Description** |
463463
| --- | --- | --- |
464464
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.applicationName">applicationName</a></code> | <code>string</code> | - the name of application to label resources with it. |
465465
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.monthlyLimitInDollars">monthlyLimitInDollars</a></code> | <code>number</code> | - montly limit in US Dollors. |
466+
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.subscribers">subscribers</a></code> | <code>string[]</code> | - list of email address that the CostMonitoring will use to send alerts to. |
466467
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.otherStacksIncludedInBudget">otherStacksIncludedInBudget</a></code> | <code>aws-cdk-lib.Stack[]</code> | - optional other stack to track their resources alog with the default stack. |
467468
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.defaultTopic">defaultTopic</a></code> | <code>string</code> | - default SNS topic name. |
468-
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.subscribers">subscribers</a></code> | <code>string[]</code> | - list of email address that the CostMonitoring will use to send alerts to. |
469469
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.costAllocationTag">costAllocationTag</a></code> | <code>string</code> | - Tag key used to track resources' expenditure. |
470470

471471
---
@@ -486,6 +486,14 @@ montly limit in US Dollors.
486486

487487
---
488488

489+
##### `subscribers`<sup>Required</sup> <a name="subscribers" id="cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.subscribers"></a>
490+
491+
- *Type:* string[]
492+
493+
list of email address that the CostMonitoring will use to send alerts to.
494+
495+
---
496+
489497
##### `otherStacksIncludedInBudget`<sup>Optional</sup> <a name="otherStacksIncludedInBudget" id="cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.otherStacksIncludedInBudget"></a>
490498

491499
- *Type:* aws-cdk-lib.Stack[]
@@ -504,14 +512,6 @@ Only if provided, the BudgetStratgy creates an SNS topic and send notifications
504512

505513
---
506514

507-
##### `subscribers`<sup>Optional</sup> <a name="subscribers" id="cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.subscribers"></a>
508-
509-
- *Type:* string[]
510-
511-
list of email address that the CostMonitoring will use to send alerts to.
512-
513-
---
514-
515515
##### `costAllocationTag`<sup>Optional</sup> <a name="costAllocationTag" id="cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.costAllocationTag"></a>
516516

517517
- *Type:* string
@@ -530,10 +530,10 @@ Only if provided, it will be used to tag the application resources. Defaults to
530530
| --- | --- | --- |
531531
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.applicationName">applicationName</a></code> | <code>string</code> | - the name of application to label resources with it. |
532532
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.monthlyLimitInDollars">monthlyLimitInDollars</a></code> | <code>number</code> | - montly limit in US Dollors. |
533+
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.subscribers">subscribers</a></code> | <code>string[]</code> | - list of email address that the CostMonitoring will use to send alerts to. |
533534
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.costAllocationTag">costAllocationTag</a></code> | <code>string</code> | - Tag key used to track resources' expenditure. |
534535
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.defaultTopic">defaultTopic</a></code> | <code>string</code> | - default SNS topic name. |
535536
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.otherStacksIncludedInBudget">otherStacksIncludedInBudget</a></code> | <code>aws-cdk-lib.Stack[]</code> | - optional other stack to track their resources alog with the default stack. |
536-
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.subscribers">subscribers</a></code> | <code>string[]</code> | - list of email address that the CostMonitoring will use to send alerts to. |
537537

538538
---
539539

@@ -561,6 +561,18 @@ montly limit in US Dollors.
561561

562562
---
563563

564+
##### `subscribers`<sup>Required</sup> <a name="subscribers" id="cost-monitoring-construct.ApplicationCostMonitoringProps.property.subscribers"></a>
565+
566+
```typescript
567+
public readonly subscribers: string[];
568+
```
569+
570+
- *Type:* string[]
571+
572+
list of email address that the CostMonitoring will use to send alerts to.
573+
574+
---
575+
564576
##### `costAllocationTag`<sup>Optional</sup> <a name="costAllocationTag" id="cost-monitoring-construct.ApplicationCostMonitoringProps.property.costAllocationTag"></a>
565577

566578
```typescript
@@ -601,18 +613,6 @@ optional other stack to track their resources alog with the default stack.
601613

602614
---
603615

604-
##### `subscribers`<sup>Optional</sup> <a name="subscribers" id="cost-monitoring-construct.ApplicationCostMonitoringProps.property.subscribers"></a>
605-
606-
```typescript
607-
public readonly subscribers: string[];
608-
```
609-
610-
- *Type:* string[]
611-
612-
list of email address that the CostMonitoring will use to send alerts to.
613-
614-
---
615-
616616

617617
### IBudgetStrategy <a name="IBudgetStrategy" id="cost-monitoring-construct.IBudgetStrategy"></a>
618618

@@ -749,8 +749,8 @@ Return default SNS topic only if the defultTopic prop has been passed when insta
749749
| **Name** | **Type** | **Description** |
750750
| --- | --- | --- |
751751
| <code><a href="#cost-monitoring-construct.IApplicationCostMonitoringProps.property.monthlyLimitInDollars">monthlyLimitInDollars</a></code> | <code>number</code> | *No description.* |
752-
| <code><a href="#cost-monitoring-construct.IApplicationCostMonitoringProps.property.defaultTopic">defaultTopic</a></code> | <code>string</code> | *No description.* |
753752
| <code><a href="#cost-monitoring-construct.IApplicationCostMonitoringProps.property.subscribers">subscribers</a></code> | <code>string[]</code> | *No description.* |
753+
| <code><a href="#cost-monitoring-construct.IApplicationCostMonitoringProps.property.defaultTopic">defaultTopic</a></code> | <code>string</code> | *No description.* |
754754
| <code><a href="#cost-monitoring-construct.IApplicationCostMonitoringProps.property.applicationName">applicationName</a></code> | <code>string</code> | *No description.* |
755755
| <code><a href="#cost-monitoring-construct.IApplicationCostMonitoringProps.property.costAllocationTag">costAllocationTag</a></code> | <code>string</code> | *No description.* |
756756
| <code><a href="#cost-monitoring-construct.IApplicationCostMonitoringProps.property.otherStacksIncludedInBudget">otherStacksIncludedInBudget</a></code> | <code>aws-cdk-lib.Stack[]</code> | *No description.* |
@@ -767,23 +767,23 @@ public readonly monthlyLimitInDollars: number;
767767

768768
---
769769

770-
##### `defaultTopic`<sup>Optional</sup> <a name="defaultTopic" id="cost-monitoring-construct.IApplicationCostMonitoringProps.property.defaultTopic"></a>
770+
##### `subscribers`<sup>Required</sup> <a name="subscribers" id="cost-monitoring-construct.IApplicationCostMonitoringProps.property.subscribers"></a>
771771

772772
```typescript
773-
public readonly defaultTopic: string;
773+
public readonly subscribers: string[];
774774
```
775775

776-
- *Type:* string
776+
- *Type:* string[]
777777

778778
---
779779

780-
##### `subscribers`<sup>Optional</sup> <a name="subscribers" id="cost-monitoring-construct.IApplicationCostMonitoringProps.property.subscribers"></a>
780+
##### `defaultTopic`<sup>Optional</sup> <a name="defaultTopic" id="cost-monitoring-construct.IApplicationCostMonitoringProps.property.defaultTopic"></a>
781781

782782
```typescript
783-
public readonly subscribers: string[];
783+
public readonly defaultTopic: string;
784784
```
785785

786-
- *Type:* string[]
786+
- *Type:* string
787787

788788
---
789789

@@ -950,8 +950,8 @@ public readonly tags: ITag[];
950950
| **Name** | **Type** | **Description** |
951951
| --- | --- | --- |
952952
| <code><a href="#cost-monitoring-construct.IBudgetStrategyProps.property.monthlyLimitInDollars">monthlyLimitInDollars</a></code> | <code>number</code> | *No description.* |
953-
| <code><a href="#cost-monitoring-construct.IBudgetStrategyProps.property.defaultTopic">defaultTopic</a></code> | <code>string</code> | *No description.* |
954953
| <code><a href="#cost-monitoring-construct.IBudgetStrategyProps.property.subscribers">subscribers</a></code> | <code>string[]</code> | *No description.* |
954+
| <code><a href="#cost-monitoring-construct.IBudgetStrategyProps.property.defaultTopic">defaultTopic</a></code> | <code>string</code> | *No description.* |
955955

956956
---
957957

@@ -965,23 +965,23 @@ public readonly monthlyLimitInDollars: number;
965965

966966
---
967967

968-
##### `defaultTopic`<sup>Optional</sup> <a name="defaultTopic" id="cost-monitoring-construct.IBudgetStrategyProps.property.defaultTopic"></a>
968+
##### `subscribers`<sup>Required</sup> <a name="subscribers" id="cost-monitoring-construct.IBudgetStrategyProps.property.subscribers"></a>
969969

970970
```typescript
971-
public readonly defaultTopic: string;
971+
public readonly subscribers: string[];
972972
```
973973

974-
- *Type:* string
974+
- *Type:* string[]
975975

976976
---
977977

978-
##### `subscribers`<sup>Optional</sup> <a name="subscribers" id="cost-monitoring-construct.IBudgetStrategyProps.property.subscribers"></a>
978+
##### `defaultTopic`<sup>Optional</sup> <a name="defaultTopic" id="cost-monitoring-construct.IBudgetStrategyProps.property.defaultTopic"></a>
979979

980980
```typescript
981-
public readonly subscribers: string[];
981+
public readonly defaultTopic: string;
982982
```
983983

984-
- *Type:* string[]
984+
- *Type:* string
985985

986986
---
987987

src/application-cost-monitoring.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ export class ApplicationCostMonitoringProps implements IApplicationCostMonitorin
2121
constructor(
2222
public applicationName: string,
2323
public monthlyLimitInDollars: number,
24+
public subscribers: string[],
2425
public otherStacksIncludedInBudget?: Stack[],
2526
public defaultTopic?: string,
26-
public subscribers?: string[],
2727
public costAllocationTag?: string
2828
) {}
2929
}

src/budget-strategy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Email, SubscriptionType } from "./utils";
33

44
export interface IBudgetStrategyProps {
55
monthlyLimitInDollars: number;
6+
subscribers: Array<Email>;
67
defaultTopic?: string;
7-
subscribers?: Array<Email>;
88
}
99

1010
export abstract class IBudgetStrategy {

0 commit comments

Comments
 (0)