Skip to content

Commit

Permalink
Merge pull request #24 from DataChefHQ/fix/subscribers-not-optional
Browse files Browse the repository at this point in the history
fix: subscribers field is mandatory
  • Loading branch information
wtfzambo authored May 6, 2024
2 parents 0dfd4c4 + 7f233c0 commit 1af7ec2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
74 changes: 37 additions & 37 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,16 +456,16 @@ public readonly applicationName: string;
```typescript
import { ApplicationCostMonitoringProps } from 'cost-monitoring-construct'

new ApplicationCostMonitoringProps(applicationName: string, monthlyLimitInDollars: number, otherStacksIncludedInBudget?: Stack[], defaultTopic?: string, subscribers?: string[], costAllocationTag?: string)
new ApplicationCostMonitoringProps(applicationName: string, monthlyLimitInDollars: number, subscribers: string[], otherStacksIncludedInBudget?: Stack[], defaultTopic?: string, costAllocationTag?: string)
```

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <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. |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.monthlyLimitInDollars">monthlyLimitInDollars</a></code> | <code>number</code> | - montly limit in US Dollors. |
| <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. |
| <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. |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.defaultTopic">defaultTopic</a></code> | <code>string</code> | - default SNS topic name. |
| <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. |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.costAllocationTag">costAllocationTag</a></code> | <code>string</code> | - Tag key used to track resources' expenditure. |

---
Expand All @@ -486,6 +486,14 @@ montly limit in US Dollors.

---

##### `subscribers`<sup>Required</sup> <a name="subscribers" id="cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.subscribers"></a>

- *Type:* string[]

list of email address that the CostMonitoring will use to send alerts to.

---

##### `otherStacksIncludedInBudget`<sup>Optional</sup> <a name="otherStacksIncludedInBudget" id="cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.otherStacksIncludedInBudget"></a>

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

---

##### `subscribers`<sup>Optional</sup> <a name="subscribers" id="cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.subscribers"></a>

- *Type:* string[]

list of email address that the CostMonitoring will use to send alerts to.

---

##### `costAllocationTag`<sup>Optional</sup> <a name="costAllocationTag" id="cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.costAllocationTag"></a>

- *Type:* string
Expand All @@ -530,10 +530,10 @@ Only if provided, it will be used to tag the application resources. Defaults to
| --- | --- | --- |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.applicationName">applicationName</a></code> | <code>string</code> | - the name of application to label resources with it. |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.monthlyLimitInDollars">monthlyLimitInDollars</a></code> | <code>number</code> | - montly limit in US Dollors. |
| <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. |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.costAllocationTag">costAllocationTag</a></code> | <code>string</code> | - Tag key used to track resources' expenditure. |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.defaultTopic">defaultTopic</a></code> | <code>string</code> | - default SNS topic name. |
| <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. |
| <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. |

---

Expand Down Expand Up @@ -561,6 +561,18 @@ montly limit in US Dollors.

---

##### `subscribers`<sup>Required</sup> <a name="subscribers" id="cost-monitoring-construct.ApplicationCostMonitoringProps.property.subscribers"></a>

```typescript
public readonly subscribers: string[];
```

- *Type:* string[]

list of email address that the CostMonitoring will use to send alerts to.

---

##### `costAllocationTag`<sup>Optional</sup> <a name="costAllocationTag" id="cost-monitoring-construct.ApplicationCostMonitoringProps.property.costAllocationTag"></a>

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

---

##### `subscribers`<sup>Optional</sup> <a name="subscribers" id="cost-monitoring-construct.ApplicationCostMonitoringProps.property.subscribers"></a>

```typescript
public readonly subscribers: string[];
```

- *Type:* string[]

list of email address that the CostMonitoring will use to send alerts to.

---


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

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

---

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

```typescript
public readonly defaultTopic: string;
public readonly subscribers: string[];
```

- *Type:* string
- *Type:* string[]

---

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

```typescript
public readonly subscribers: string[];
public readonly defaultTopic: string;
```

- *Type:* string[]
- *Type:* string

---

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

---

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

---

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

```typescript
public readonly defaultTopic: string;
public readonly subscribers: string[];
```

- *Type:* string
- *Type:* string[]

---

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

```typescript
public readonly subscribers: string[];
public readonly defaultTopic: string;
```

- *Type:* string[]
- *Type:* string

---

Expand Down
2 changes: 1 addition & 1 deletion src/application-cost-monitoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export class ApplicationCostMonitoringProps implements IApplicationCostMonitorin
constructor(
public applicationName: string,
public monthlyLimitInDollars: number,
public subscribers: string[],
public otherStacksIncludedInBudget?: Stack[],
public defaultTopic?: string,
public subscribers?: string[],
public costAllocationTag?: string
) {}
}
Expand Down
2 changes: 1 addition & 1 deletion src/budget-strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { Email, SubscriptionType } from "./utils";

export interface IBudgetStrategyProps {
monthlyLimitInDollars: number;
subscribers: Array<Email>;
defaultTopic?: string;
subscribers?: Array<Email>;
}

export abstract class IBudgetStrategy {
Expand Down

0 comments on commit 1af7ec2

Please sign in to comment.