You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ecs_fargate/README.md
+173-2Lines changed: 173 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -146,6 +146,89 @@ Lastly, include your other application containers within the `ContainerDefinitio
146
146
147
147
For more information on CloudFormation templating and syntax, see the [AWS CloudFormation task definition documentation][43].
148
148
149
+
<!-- xxz tab xxx -->
150
+
151
+
<!-- xxx tab "CDK" xxx -->
152
+
##### Datadog CDK Task Definition
153
+
154
+
You can use the [Datadog CDK Constructs][72] to configure your ECS Fargate task definition. Use the `DatadogECSFargate` construct to instrument your containers for desired Datadog features. This is supported in TypeScript, JavaScript, Python, and Go.
Update this construct definition below with your [Datadog API Key][41]. In addition, include the appropriate `DD_SITE` ({{< region-param key="dd_site" code="true" >}}) property if necessary, as this defaults to `datadoghq.com` if you don't set it.
For more information on the `DatadogECSFargate` construct instrumentation and syntax, see the [Datadog ECS Fargate CDK documentation][67].
188
+
189
+
<!-- xxz tab xxx -->
190
+
191
+
<!-- xxx tab "Terraform" xxx -->
192
+
##### Datadog Terraform Task Definition
193
+
194
+
You can use the [Datadog ECS Fargate Terraform module][71] to configure your containers for Datadog. This Terraform module wraps the [`aws_ecs_task_definition`][68] resource and automatically instruments your task definition for Datadog. Pass your input arguments into the Datadog ECS Fargate Terraform module in a similiar manner as to the `aws_ecs_task_definition`. Make sure to include your task `family` and `container_definitions`.
Update this Terraform module below with your [Datadog API Key][41]. As well as include the appropriate `DD_SITE` ({{< region-param key="dd_site" code="true" >}}) environment variable if necessary, as this defaults to `datadoghq.com` if you don't set it.
Lastly, include your other application containers within the `ContainerDefinitions` and deploy through Terraform.
230
+
231
+
For more information on the Terraform module, see the [Datadog ECS Fargate Terraform documentation][43].
149
232
150
233
<!-- xxz tab xxx -->
151
234
@@ -223,6 +306,41 @@ For more information on CloudFormation templating and syntax, see the [AWS Cloud
223
306
224
307
<!-- xxz tab xxx -->
225
308
309
+
<!-- xxx tab "CDK" xxx -->
310
+
##### AWS CDK Replica Service
311
+
312
+
In the CDK code you can reference the `fargateTaskDefinition` resource created in the previous example into the `FargateService` resource being created. After this, specify your `Cluster`, `DesiredCount`, and any other parameters necessary for your application in your replica service.
313
+
314
+
```typescript
315
+
const service = new ecs.FargateService(this, <SERVICE_ID>, {
316
+
<CLUSTER>,
317
+
fargateTaskDefinition,
318
+
desiredCount: 1
319
+
});
320
+
```
321
+
322
+
For more information on the CDK ECS service construct and syntax, see the [AWS CDK ECS Service documentation][69].
323
+
324
+
<!-- xxz tab xxx -->
325
+
326
+
<!-- xxx tab "Terraform" xxx -->
327
+
##### AWS Terraform Replica Service
328
+
329
+
In the Terraform code you can reference the `aws_ecs_task_definition` resource created in the previous example within the `aws_ecs_service` resource being created. Then, specify your `Cluster`, `DesiredCount`, and any other parameters necessary for your application in your replica service.
330
+
331
+
```hcl
332
+
resource "aws_ecs_service" <SERVICE_ID> {
333
+
name = <SERVICE_NAME>
334
+
cluster = <CLUSTER_ID>
335
+
task_definition = module.ecs_fargate_task.arn
336
+
desired_count = 1
337
+
}
338
+
```
339
+
340
+
For more information on the Terraform ECS service module and syntax, see the [AWS Terraform ECS service documentation][70].
341
+
342
+
<!-- xxz tab xxx -->
343
+
226
344
<!-- xxz tabs xxx -->
227
345
228
346
To provide your Datadog API key as a secret, see [Using secrets](#using-secrets).
@@ -894,6 +1012,51 @@ partial -->
894
1012
895
1013
For more information on CloudFormation templating and syntax, see the [AWS CloudFormation documentation][43].
896
1014
1015
+
<!-- xxz tab xxx -->
1016
+
1017
+
<!-- xxx tab "CDK" xxx -->
1018
+
##### Datadog ECS Fargate CDK Construct
1019
+
1020
+
To enable logging through the [Datadog ECS Fargate CDK][67] construct, configure the `logCollection` property as seen below:
1021
+
1022
+
```typescript
1023
+
const ecsDatadog = new DatadogECSFargate({
1024
+
apiKey: <DATADOG_API_KEY>,
1025
+
site: <DATADOG_SITE>,
1026
+
logCollection: {
1027
+
isEnabled: true,
1028
+
}
1029
+
});
1030
+
```
1031
+
1032
+
<!-- xxz tab xxx -->
1033
+
1034
+
<!-- xxx tab "Terraform" xxx -->
1035
+
##### Datadog ECS Fargate Terraform Module
1036
+
1037
+
To enable logging through the [Datadog ECS Fargate Terraform][71] module, configure the `dd_log_collection` input argument as seen below:
0 commit comments