File tree Expand file tree Collapse file tree 2 files changed +29
-6
lines changed Expand file tree Collapse file tree 2 files changed +29
-6
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ locals {
1616
1717 // https://www.datadoghq.com/blog/monitor-aws-fargate/
1818 ECS_FARGATE = var.ecs_launch_type == " FARGATE" ? " true" : " false"
19- }
19+ },
20+ (var. ecs_launch_type == " EC2" && var. socket_apm_enabled_on_ec2 ) ? {
21+ DD_APM_RECEIVER_SOCKET = " /var/run/datadog.sock"
22+ } : {}
2023 )
2124
2225 container_definition = {
@@ -46,7 +49,14 @@ locals {
4649 sourceVolume = " proc"
4750 // This is disabled temporarily to overcome json unmarshaling issue
4851 // readOnly = true
49- }
52+ },
53+
54+ var.socket_apm_enabled_on_ec2 ? {
55+ containerPath = " /var/run/datadog.sock"
56+ sourceVolume = " datadog_sock"
57+ // This is disabled temporarily to overcome json unmarshaling issue
58+ // readOnly = true
59+ } : {}
5060 ]
5161
5262
@@ -82,6 +92,15 @@ locals {
8292 {
8393 name = " cgroup"
8494 host_path = " /cgroup/"
95+ },
96+ {
97+ name = " datadog_sock"
98+ host_path = " /var/run/datadog.sock"
99+ mount_point = {
100+ " sourceVolume" = " datadog_sock"
101+ " containerPath" = " /var/run/datadog.sock"
102+ " readOnly" = null
103+ }
85104 }
86105 ]
87106
Original file line number Diff line number Diff line change @@ -11,12 +11,12 @@ variable "app_name" {
1111
1212
1313variable "environment" {
14- type = map (string )
14+ type = map (string )
1515 default = {}
1616}
1717
1818variable "secret_names" {
19- type = list (string )
19+ type = list (string )
2020 default = []
2121}
2222
@@ -25,12 +25,12 @@ variable "secret_names" {
2525// }
2626
2727variable "docker_image_name" {
28- type = string
28+ type = string
2929 default = " datadog/agent"
3030}
3131
3232variable "docker_image_tag" {
33- type = string
33+ type = string
3434 default = " latest"
3535}
3636
@@ -46,6 +46,10 @@ variable "resource_requirements" {
4646 default = []
4747}
4848
49+ variable "socket_apm_enabled_on_ec2" {
50+ default = true
51+ }
52+
4953variable "enabled" {
5054 default = true
5155}
You can’t perform that action at this time.
0 commit comments