Skip to content

Commit

Permalink
conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhrubajyoti Sadhu committed Jan 3, 2024
1 parent 42c7092 commit 2c8fba7
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 63 deletions.
8 changes: 0 additions & 8 deletions common.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,3 @@ 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
}

output "datadog_api_key" {
value = jsondecode(data.aws_secretsmanager_secret_version.datadog_key.secret_string).api_key
}

output "datadog_app_key" {
value = jsondecode(data.aws_secretsmanager_secret_version.datadog_key.secret_string).app_key
}
1 change: 1 addition & 0 deletions templates.tf
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,6 @@ data "template_file" "waggledance" {
wd_instance_type = var.wd_instance_type
datadog_metrics_port = var.datadog_metrics_port
datadog_agent_version = var.datadog_agent_version
include_datadog_agent = var.include_datadog_agent
}
}
115 changes: 60 additions & 55 deletions templates/waggledance.json
Original file line number Diff line number Diff line change
@@ -1,100 +1,101 @@
[
{
"name": "waggledance",
"image": "${docker_image}:${docker_version}",
${docker_auth}
{
"name": "waggledance",
"image": "${docker_image}:${docker_version}",
${docker_auth}
"essential": true,
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "${loggroup}",
"awslogs-region": "${region}",
"awslogs-stream-prefix": "/"
}
},
}
},
"dockerLabels": {
"com.datadoghq.ad.instances": "[{\"openmetrics_endpoint\": \"http://%%host%%:${datadog_metrics_port}/actuator/prometheus\", \"namespace\": \"waggledance\", \"metrics\": [\"metastore_status\",\"counter_*\",\"jvm_*\",\"system_*\",\"timer_*\",\"http_*\",\"process_*\"], \"tags\": { \"region\":\"${region}\", \"instance_type\":\"${wd_instance_type}\"} }]",
"com.datadoghq.ad.check_names": "[\"openmetrics\"]",
"com.datadoghq.ad.init_configs": "[{}]"
},
},
"portMappings": [
{
{
"containerPort": 48869,
"hostPort": 48869
}
],
}
],
"environment":[
{
{
"name": "HEAPSIZE",
"value": "${heapsize}"
},
{
},
{
"name": "LOGLEVEL",
"value": "${loglevel}"
},
{
},
{
"name": "INVOCATIONLOGLEVEL",
"value": "${invocationloglevel}"
},
{
},
{
"name": "SERVER_YAML",
"value": "${server_yaml}"
},
{
},
{
"name": "FEDERATION_YAML",
"value": "${federation_yaml}"
},
{
},
{
"name": "HIVE_SITE_XML",
"value": "${hive_site_xml}"
},
{
},
{
"name": "BASTION_SSH_KEY_ARN",
"value": "${bastion_ssh_key_arn}"
},
{
},
{
"name": "LOG4J_FORMAT_MSG_NO_LOOKUPS",
"value": "true"
},
},
{
"name": "DD_USE_DOGSTATSD",
"value": "true"
}
],
],
"healthCheck": {
"command": ["CMD-SHELL", "curl -f http://localhost:18000/actuator/health || exit 1"],
"interval": 5,
"retries": 3,
"startPeriod": 60,
"timeout": 5
},
"command": ["CMD-SHELL", "curl -f http://localhost:${datadog_metrics_port}/actuator/health || exit 1"],
"interval": 5,
"retries": 3,
"startPeriod": 60,
"timeout": 5
},
"ulimits": [
{
{
"name": "nofile",
"softLimit": 65536,
"hardLimit": 65536
},
{
},
{
"name": "nproc",
"softLimit": 65536,
"hardLimit": 65536
}
],
}
],
"systemControls": [
{
"namespace": "net.ipv4.tcp_keepalive_time",
"value": "${tcp_keepalive_time}"
},
{
"namespace": "net.ipv4.tcp_keepalive_intvl",
"value": "${tcp_keepalive_intvl}"
},
{
"namespace": "net.ipv4.tcp_keepalive_probes",
"value": "${tcp_keepalive_probes}"
}
]
},
{
"namespace": "net.ipv4.tcp_keepalive_time",
"value": "${tcp_keepalive_time}"
},
{
"namespace": "net.ipv4.tcp_keepalive_intvl",
"value": "${tcp_keepalive_intvl}"
},
{
"namespace": "net.ipv4.tcp_keepalive_probes",
"value": "${tcp_keepalive_probes}"
}
]
},
${include_datadog_agent ?
{
"name": "datadog-agent",
"image": "public.ecr.aws/datadog/agent:${datadog_agent_version}",
Expand All @@ -118,11 +119,15 @@
}
],
"healthCheck": {
"command": ["CMD-SHELL", "curl -f http://localhost:18000/actuator/health || exit 1"],
"command": [
"CMD-SHELL",
"curl -f http://localhost:${datadog_metrics_port}/actuator/health || exit 1"
],
"interval": 5,
"retries": 3,
"startPeriod": 60,
"timeout": 5
}
} : null
}
]
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -389,3 +389,9 @@ variable "datadog_agent_version" {
type = string
default = "7.46.0-jmx"
}

variable "include_datadog_agent" {
description = "Whether to include the datadog-agent container"
type = bool
default = true
}

0 comments on commit 2c8fba7

Please sign in to comment.