Skip to content

Commit

Permalink
Added the required files
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhrubajyoti Sadhu committed Dec 12, 2023
1 parent 8700c95 commit 305aae8
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 1 deletion.
13 changes: 13 additions & 0 deletions common.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,16 @@ data "aws_route53_zone" "apiary_zone" {
name = var.apiary_domain_name
vpc_id = var.vpc_id
}

data "aws_secretsmanager_secret" "datadog_key" {
name = var.datadog_key_secret_name
}

data "aws_secretsmanager_secret_version" "datadog_key" {
secret_id = data.aws_secretsmanager_secret.datadog_key.id
}

provider "datadog" {
api_key = jsondecode(data.aws_secretsmanager_secret_version.datadog_key.secret_string).api_key
app_key = jsondecode(data.aws_secretsmanager_secret_version.datadog_key.secret_string).app_key
}
35 changes: 34 additions & 1 deletion templates/apiary-hms-readonly.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,38 @@
}
%{ endfor }
]
}
},
{
"name": "datadog-agent",
"image": "public.ecr.aws/datadog/agent:latest",
"essential": true,
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "${loggroup}",
"awslogs-region": "${region}",
"awslogs-stream-prefix": "/"
}
},
"environment": [
{
"name": "DD_API_KEY",
"value": "${datadog_secret_key}"
},
{
"name": "ECS_FARGATE",
"value": "true"
}
],
"healthCheck": {
"command": [
"CMD-SHELL",
"curl -f http://localhost:18000/actuator/health || exit 1"
],
"interval": 5,
"retries": 3,
"startPeriod": 60,
"timeout": 5
}
}
]
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -715,3 +715,9 @@ variable "hms_ro_request_partition_limit" {
type = string
default = ""
}

variable "datadog_key_secret_name" {
description = "SecretsManager secret name containing a DataDog API key"
type = string
default = "dd-analytics-platform-starburst"
}
4 changes: 4 additions & 0 deletions version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ terraform {
source = "hashicorp/aws"
version = "~> 4.0"
}
datadog = {
source = "DataDog/datadog"
version = "~> 3.25.0"
}
}
}

0 comments on commit 305aae8

Please sign in to comment.