From 43dd7028faaef2beb0123db04a3a68c4911a44df Mon Sep 17 00:00:00 2001 From: Andrew Plummer Date: Thu, 21 Dec 2023 14:26:19 +0000 Subject: [PATCH] Examples in README --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 8cd4ee3..f9b81fc 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,40 @@ Docs: https://isotoma.github.io/datadog-ecs-cdk/ NPM: https://www.npmjs.com/package/datadog-ecs-cdk + +## EC2 example + +```typescript +import { EcsDatadogDaemonService } from 'datadog-ecs-cdk'; + +// ... + +new EcsDatadogDaemonService(this, 'EcsDatadog', { + ecsCluster: myCluster, + datadogApiKeySecret: mySecret, +}); +``` + +## Fargate example +```typescript +import { addDatadogToFargateTask } from 'datadog-ecs-cdk'; + +// ... + +const myTaskDef = ... + +addDatadogToFargateTask(myTaskDef, { + datadogApiKeySecret: ecs.Secret.fromSecretsManager(mySecret), + agent: { + enabled: true, + statsd: { + enabled: true, + }, + }, + fireLensLogging: { + enabled: true, + service: 'myservice', + source: 'myservice', + }, +}); +```