Skip to content

Commit

Permalink
Merge pull request #22 from DataChefHQ/docs/doc-update
Browse files Browse the repository at this point in the history
chore: Update docs
  • Loading branch information
wtfzambo authored May 3, 2024
2 parents 0732971 + 3e27bcf commit cc647a6
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 46 deletions.
74 changes: 54 additions & 20 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ Cost Monitoring Construct is a CDK library that helps monitor costs for AWS clou

With the Cost Monitoring Construct, you can share the responsibility of cost management between developers and business holders. This is achieved through the creation of meaningful reports that enable the business team to make informed decisions. Additionally, the Construct generates boilerplate code that can be used to apply these decisions in practice, making it easier to stay on top of your budget.

# How to use Cost Monitoring Construct?
## How to use Cost Monitoring Construct?

To use Cost Monitoring Construct, all you need is to have the AWS CDK installed and set up. Once you have that, you can install the package from the repository of your choice.

For more information on using this Construct in TypeScript checkout the [TypeScript documentation](docs/typescript.md). You can also check the typescript example from [sample folder](https://github.com/DataChefHQ/cost-monitoring-construct/tree/main/sample) on the GitHub repository.

# Why do you need it?
## Why do you need it?

Cloud services can get very expensive, very quickly, especially if you are not careful with your usage. Cost Monitoring Construct helps you to keep an eye on your cloud infrastructure costs so that you can stay within budget. By setting budgets and defining alert strategies, you can take proactive steps to reduce costs before they become a problem.

# How does Cost Monitoring Construct work?
## How does Cost Monitoring Construct work?

Cost Monitoring Construct uses AWS Tagging practice to track resources related to an specific application, creates proper alert with respect to the defined budget limit and provide overview dashbords. The tool is highly customizable and allows you to customize it to your budgeting strategy based on your specific needs.

Expand All @@ -24,19 +24,22 @@ Cost Monitoring Construct provides the following features:
- **Budgets:** Allows you to set budgets for each applications. It will automatically set up alerts to notify you when your actual costs exceed your budgeted costs. It also continues to track the cost and sending alert if an application continues to cost drastically.
- **Integration:** Integrates with various tools and monitoring services, such as AWS Cost Explorer and Datadog.

# What is it useful for?
> [!WARNING]
> ApplicationCostMonitoring uses AWS Tags to track resources' usages. You must [activate](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/activating-tags.html) your chosen tag key (`cm:application` by default) under Cost Allocation Tags. The tag key will appear in the AWS console up to 24 hours after at least one AWS resource has been created with that tag.
## What is it useful for?

Cost Monitoring Construct is useful for anyone who uses AWS and wants to keep their costs under control. It is particularly useful for:

- **Startups and small businesses:** Cost Monitoring Construct can help startups and small businesses to keep their costs under control during the early stages of growth.
- **Large enterprises:** Cost Monitoring Construct can help large enterprises to optimize their cloud usage and reduce costs across multiple teams and departments.
- **Developers:** Cost Monitoring Construct can help developers to track their usage and costs across multiple projects and services.

# What is this _not_ useful for?
## What is this _not_ useful for?

The Cost Monitoring Construct is not a magical tool that can solve all of your cloud cost problems. In spite of the fact that it can bring clarity and help you to identify areas where you can reduce costs, you must make the necessary decisions about your infrastructure on your own.

# Which programming languages Cost Monitoring Construct supports?
## Which programming languages Cost Monitoring Construct supports?

Cost Monitoring Construct has been developed using JSII technolgy to provide interfaces for different modern programming languages. Currently, it supports the following languages:

Expand All @@ -46,8 +49,7 @@ Cost Monitoring Construct has been developed using JSII technolgy to provide int
- [.NET](https://www.nuget.org/packages/DataChef.CostMonitoringConstruct)
- [Java](https://central.sonatype.com/artifact/co.datachef/costmonitoringconstruct/1.1.0/versions)

> **✏️ Note**
>
> [!NOTE]
> Go will be supported soon but for now you can build it from the source.
If you have any questions or need help with Cost Monitoring Construct, you can reach out to our support team at [[email protected]](mailto:[email protected]).
Expand Down Expand Up @@ -459,49 +461,65 @@ new ApplicationCostMonitoringProps(applicationName: string, monthlyLimitInDollar

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.applicationName">applicationName</a></code> | <code>string</code> | *No description.* |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.monthlyLimitInDollars">monthlyLimitInDollars</a></code> | <code>number</code> | *No description.* |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.otherStacksIncludedInBudget">otherStacksIncludedInBudget</a></code> | <code>aws-cdk-lib.Stack[]</code> | *No description.* |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.defaultTopic">defaultTopic</a></code> | <code>string</code> | *No description.* |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.subscribers">subscribers</a></code> | <code>string[]</code> | *No description.* |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.Initializer.parameter.costAllocationTag">costAllocationTag</a></code> | <code>string</code> | *No 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.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. |

---

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

- *Type:* string

the name of application to label resources with it.

---

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

- *Type:* number

montly limit in US Dollors.

---

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

- *Type:* aws-cdk-lib.Stack[]

optional other stack to track their resources alog with the default stack.

---

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

- *Type:* string

default SNS topic name.

Only if provided, the BudgetStratgy creates an SNS topic and send notifications to it.

---

##### `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

Tag key used to track resources' expenditure.

Only if provided, it will be used to tag the application resources. Defaults to `cm:application`

---


Expand All @@ -510,12 +528,12 @@ new ApplicationCostMonitoringProps(applicationName: string, monthlyLimitInDollar

| **Name** | **Type** | **Description** |
| --- | --- | --- |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.applicationName">applicationName</a></code> | <code>string</code> | *No description.* |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.monthlyLimitInDollars">monthlyLimitInDollars</a></code> | <code>number</code> | *No description.* |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.costAllocationTag">costAllocationTag</a></code> | <code>string</code> | *No description.* |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.defaultTopic">defaultTopic</a></code> | <code>string</code> | *No description.* |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.otherStacksIncludedInBudget">otherStacksIncludedInBudget</a></code> | <code>aws-cdk-lib.Stack[]</code> | *No description.* |
| <code><a href="#cost-monitoring-construct.ApplicationCostMonitoringProps.property.subscribers">subscribers</a></code> | <code>string[]</code> | *No description.* |
| <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.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 All @@ -527,6 +545,8 @@ public readonly applicationName: string;

- *Type:* string

the name of application to label resources with it.

---

##### `monthlyLimitInDollars`<sup>Required</sup> <a name="monthlyLimitInDollars" id="cost-monitoring-construct.ApplicationCostMonitoringProps.property.monthlyLimitInDollars"></a>
Expand All @@ -537,6 +557,8 @@ public readonly monthlyLimitInDollars: number;

- *Type:* number

montly limit in US Dollors.

---

##### `costAllocationTag`<sup>Optional</sup> <a name="costAllocationTag" id="cost-monitoring-construct.ApplicationCostMonitoringProps.property.costAllocationTag"></a>
Expand All @@ -547,6 +569,10 @@ public readonly costAllocationTag: string;

- *Type:* string

Tag key used to track resources' expenditure.

Only if provided, it will be used to tag the application resources. Defaults to `cm:application`

---

##### `defaultTopic`<sup>Optional</sup> <a name="defaultTopic" id="cost-monitoring-construct.ApplicationCostMonitoringProps.property.defaultTopic"></a>
Expand All @@ -557,6 +583,10 @@ public readonly defaultTopic: string;

- *Type:* string

default SNS topic name.

Only if provided, the BudgetStratgy creates an SNS topic and send notifications to it.

---

##### `otherStacksIncludedInBudget`<sup>Optional</sup> <a name="otherStacksIncludedInBudget" id="cost-monitoring-construct.ApplicationCostMonitoringProps.property.otherStacksIncludedInBudget"></a>
Expand All @@ -567,6 +597,8 @@ public readonly otherStacksIncludedInBudget: Stack[];

- *Type:* aws-cdk-lib.Stack[]

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>
Expand All @@ -577,6 +609,8 @@ public readonly subscribers: string[];

- *Type:* string[]

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

---


Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ Cost Monitoring Construct is a CDK library that helps monitor costs for AWS clou

With the Cost Monitoring Construct, you can share the responsibility of cost management between developers and business holders. This is achieved through the creation of meaningful reports that enable the business team to make informed decisions. Additionally, the Construct generates boilerplate code that can be used to apply these decisions in practice, making it easier to stay on top of your budget.

# How to use Cost Monitoring Construct?
## How to use Cost Monitoring Construct?

To use Cost Monitoring Construct, all you need is to have the AWS CDK installed and set up. Once you have that, you can install the package from the repository of your choice.

For more information on using this Construct in TypeScript checkout the [TypeScript documentation](docs/typescript.md). You can also check the typescript example from [sample folder](https://github.com/DataChefHQ/cost-monitoring-construct/tree/main/sample) on the GitHub repository.

# Why do you need it?
## Why do you need it?

Cloud services can get very expensive, very quickly, especially if you are not careful with your usage. Cost Monitoring Construct helps you to keep an eye on your cloud infrastructure costs so that you can stay within budget. By setting budgets and defining alert strategies, you can take proactive steps to reduce costs before they become a problem.

# How does Cost Monitoring Construct work?
## How does Cost Monitoring Construct work?

Cost Monitoring Construct uses AWS Tagging practice to track resources related to an specific application, creates proper alert with respect to the defined budget limit and provide overview dashbords. The tool is highly customizable and allows you to customize it to your budgeting strategy based on your specific needs.

Expand All @@ -24,19 +24,22 @@ Cost Monitoring Construct provides the following features:
- **Budgets:** Allows you to set budgets for each applications. It will automatically set up alerts to notify you when your actual costs exceed your budgeted costs. It also continues to track the cost and sending alert if an application continues to cost drastically.
- **Integration:** Integrates with various tools and monitoring services, such as AWS Cost Explorer and Datadog.

# What is it useful for?
> [!WARNING]
> ApplicationCostMonitoring uses AWS Tags to track resources' usages. You must [activate](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/activating-tags.html) your chosen tag key (`cm:application` by default) under Cost Allocation Tags. The tag key will appear in the AWS console up to 24 hours after at least one AWS resource has been created with that tag.
## What is it useful for?

Cost Monitoring Construct is useful for anyone who uses AWS and wants to keep their costs under control. It is particularly useful for:

- **Startups and small businesses:** Cost Monitoring Construct can help startups and small businesses to keep their costs under control during the early stages of growth.
- **Large enterprises:** Cost Monitoring Construct can help large enterprises to optimize their cloud usage and reduce costs across multiple teams and departments.
- **Developers:** Cost Monitoring Construct can help developers to track their usage and costs across multiple projects and services.

# What is this _not_ useful for?
## What is this _not_ useful for?

The Cost Monitoring Construct is not a magical tool that can solve all of your cloud cost problems. In spite of the fact that it can bring clarity and help you to identify areas where you can reduce costs, you must make the necessary decisions about your infrastructure on your own.

# Which programming languages Cost Monitoring Construct supports?
## Which programming languages Cost Monitoring Construct supports?

Cost Monitoring Construct has been developed using JSII technolgy to provide interfaces for different modern programming languages. Currently, it supports the following languages:

Expand All @@ -46,8 +49,7 @@ Cost Monitoring Construct has been developed using JSII technolgy to provide int
- [.NET](https://www.nuget.org/packages/DataChef.CostMonitoringConstruct)
- [Java](https://central.sonatype.com/artifact/co.datachef/costmonitoringconstruct/1.1.0/versions)

> **✏️ Note**
>
> [!NOTE]
> Go will be supported soon but for now you can build it from the source.
If you have any questions or need help with Cost Monitoring Construct, you can reach out to our support team at [[email protected]](mailto:[email protected]).
39 changes: 39 additions & 0 deletions docs/python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Introduction

The Python version of Cost Monitoring Construct derives from the Typescript version, hence refer to [its docs](./typescript.md) for extra details.

To install the Cost Monitoring Construct package, run the following command to download it from PyPI:

```bash
pip install cost-monitoring-construct
```

## Usage

Getting started is very simple: just add the following snippet to your code and adapt it to the situation.

> [!WARNING] ApplicationCostMonitoring uses AWS Tags to track resources' usages. You must [activate](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/activating-tags.html) your chosen tag key (`cm:application` by default) under Cost Allocation Tags. The tag key will appear in the AWS console up to 24 hours after at least one AWS resource has been created with that tag.
```python
import aws_cdk as cdk
from cost_monitoring_construct import (
ApplicationCostMonitoring,
ApplicationCostMonitoringProps,
)

app = cdk.App()
monitoring_stack = MonitoringStack(app, "MyMonitoringStack")
first_stack = FirstStack(app, "FirstStack")

cost_monitoring = ApplicationCostMonitoring(
applications_stack,
props=ApplicationCostMonitoringProps(
application_name="my-application",
monthly_limit_in_dollars=200,
other_stacks_included_in_budget=[first_stack],
subscribers=["[email protected]"],
cost_allocation_tag="MyTag"
)
)
cost_monitoring.monitor()
```
Loading

0 comments on commit cc647a6

Please sign in to comment.