Skip to content

Commit

Permalink
Merge pull request #87 from NomadBlacky/add-examples
Browse files Browse the repository at this point in the history
docs: Add example code to README
  • Loading branch information
NomadBlacky committed Jul 3, 2021
2 parents c505c66 + 1b4bc36 commit 718c48c
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You need to register the correct version listed in `Supported Resources`.
| | 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] | [2.0.0][8] |
|| User | `Datadog::IAM::User` | [Create and manage Datadog users.][5] | [1.2.0][9] |
|| Users | `Datadog::IAM::User` | [Create and manage Datadog users.][5] | [1.2.0][9] |

[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
Expand Down Expand Up @@ -103,3 +103,36 @@ new DatadogMonitor(yourStack, 'TestMonitor', {
},
});
```

### Downtimes

```typescript
import { DatadogDowntime } from '@nomadblacky/cdk-datadog-resources';

new DatadogDowntime(stack, 'TestMonitor', {
datadogCredentials: {
apiKey: 'DATADOG_API_KEY',
applicationKey: 'DATADOG_APP_KEY',
},
scope: ['host:myserver', 'service:myservice'],
start: 1624542715,
end: 1624546321,
});
```

### Users

```typescript
import { DatadogIAMUser } from '@nomadblacky/cdk-datadog-resources';

new DatadogIAMUser(stack, 'TestUser', {
datadogCredentials: {
apiKey: 'DATADOG_API_KEY',
applicationKey: 'DATADOG_APP_KEY',
},
email: 'jane.doe@example.com',
name: 'name_example',
handle: 'title_example',
disabled: false,
});
```

0 comments on commit 718c48c

Please sign in to comment.