https://github.com/utxonly/fargate_deploy
A terraform script to deploy the Datadog agent as a sidecar container in a ECS Fargate task
https://github.com/utxonly/fargate_deploy
datadog-agent fargate terraform
Last synced: 3 months ago
JSON representation
A terraform script to deploy the Datadog agent as a sidecar container in a ECS Fargate task
- Host: GitHub
- URL: https://github.com/utxonly/fargate_deploy
- Owner: UTXOnly
- Created: 2024-07-22T02:32:24.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-07-22T03:36:47.000Z (11 months ago)
- Last Synced: 2025-02-06T13:51:35.751Z (4 months ago)
- Topics: datadog-agent, fargate, terraform
- Language: HCL
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fargate_deploy
A simple terraform script to deploy the Datadog agent as a sidecar container in a ECS Fargate taskThis deploys:
* `busybox` container that emits logs
* AWS FireLens/fluentbit log driver
* Datadog agent sidecar container## Prerequisites
* [aws-cli](https://github.com/aws/aws-cli)
* AWS account
* [aws-vault](https://github.com/99designs/aws-vault)## Configure
Update the variables in the `terraform.tfvars` file to use your own account info and credentials:
```tf
# AWS Configuration
subnet_ids = ["subnet-"]
security_group_ids = ["sg-"]
execution_role_arn = "arn:aws:iam:::role/ecsTaskExecutionRole"
task_role_arn = "arn:aws:iam:::role/ecsTaskExecutionRole"
aws_ecs_cluster = "your-name-cluster"
aws_ecs_service = "your-name-service"# Datadog Configuration
dd_api_key = "your-api-key"
dd_service = "sandbox"
host = "http-intake.logs.datadoghq.com" # Default US1 log intake, can adjust for differnt regions as needed# ECS Configuration
family = "your_name_sandbox"# Tags
aws_tags = {
environment = "sandbox"
owner = "your.name"
team = "sandbo-team"
}
```## Deploy
Once `aws-cli` and `aws-vault` are configured you can deploy this task in 3 steps below
```
terraform init
``````
aws-vault exec -- terraform plan
``````
aws-vault exec -- terraform plan
```
* (enter `yes` when prompted to create the resources)### Cleanup
```
aws-vault exec -- terraform plan
```