-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from NomadBlacky/add-monitor
feat: Add Datadog::Monitors::Monitor resource
- Loading branch information
Showing
15 changed files
with
1,275 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
/lib | ||
/test-reports/ | ||
build/Release | ||
cdk.out/ | ||
coverage | ||
jspm_packages/ | ||
junit.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,71 @@ | ||
# replace this | ||
# AWS CDK Datadog Resources | ||
|
||
An AWS CDK construct library that wrapped [DataDog/datadog-cloudformation-resources](https://github.com/DataDog/datadog-cloudformation-resources). | ||
|
||
## Requirements | ||
|
||
Before use this library, [register datadog-cloudformation-resources to your AWS account.](https://github.com/DataDog/datadog-cloudformation-resources#datadog-aws-cloudformation) | ||
|
||
You need to register the correct version listed in `Supported Resources`. | ||
|
||
## Supported CDK Languages | ||
|
||
- TypeScript | ||
|
||
## Supported Resources | ||
|
||
| Supported? | Resource | Name | Description | Datadog CF Version | | ||
| :--------: | ----------------------- | -------------------------------- | -------------------------------------------------------- | ------------------ | | ||
| | Dashboards | `Datadog::Dashboards::Dashboard` | [Create, update, and delete Datadog dashboards.][1] | N/A | | ||
| | Datadog-AWS integration | `Datadog::Integrations::AWS` | [Manage your Datadog-Amazon Web Service integration.][2] | N/A | | ||
| ✅ | Monitors | `Datadog::Monitors::Monitor` | [Create, update, and delete Datadog monitors.][3] | [3.0.0][6] | | ||
| | Downtimes | `Datadog::Monitors::Downtime` | [Enable or disable downtimes for your monitors.][4] | N/A | | ||
| | User | `Datadog::IAM::User` | [ Create and manage Datadog users.][5] | N/A | | ||
|
||
## Installation | ||
|
||
TypeScript | ||
|
||
```shell | ||
npm install --save-dev @nomadblacky/cdk-datadog-resources | ||
``` | ||
|
||
## Usage | ||
|
||
Belows are examples of TypeScript. | ||
|
||
### Monitors | ||
|
||
```typescript | ||
import { App, Stack } from '@aws-cdk/core'; | ||
import { DatadogMonitor } from '@nomadblacky/cdk-datadog-resources'; | ||
|
||
const app = new App(); | ||
const stack = new Stack(app, 'CdkDatadogResourcesTestStack'); | ||
|
||
new DatadogMonitor(stack, 'TestMonitor', { | ||
datadogCredentials: { | ||
apiKey: process.env.DATADOG_API_KEY || 'DATADOG_API_KEY', | ||
applicationKey: process.env.DATADOG_APP_KEY || 'DATADOG_APP_KEY', | ||
}, | ||
query: 'avg(last_1h):sum:system.cpu.system{host:host0} > 100', | ||
type: 'query alert', | ||
name: 'Test Monitor', | ||
options: { | ||
thresholds: { | ||
critical: 100, | ||
warning: 80, | ||
oK: 90, | ||
}, | ||
notifyNoData: true, | ||
evaluationDelay: 60, | ||
}, | ||
}); | ||
``` | ||
|
||
[1]: https://github.com/DataDog/datadog-cloudformation-resources/tree/master/datadog-dashboards-dashboard-handler | ||
[2]: https://github.com/DataDog/datadog-cloudformation-resources/tree/master/datadog-integrations-aws-handler | ||
[3]: https://github.com/DataDog/datadog-cloudformation-resources/tree/master/datadog-monitors-monitor-handler | ||
[4]: https://github.com/DataDog/datadog-cloudformation-resources/tree/master/datadog-monitors-downtime-handler | ||
[5]: https://github.com/DataDog/datadog-cloudformation-resources/tree/master/datadog-iam-user-handler | ||
[6]: https://github.com/DataDog/datadog-cloudformation-resources/blob/master/datadog-monitors-monitor-handler/CHANGELOG.md#300--2021-02-16 |
Oops, something went wrong.