Skip to content

Commit

Permalink
Merge pull request #64 from uktrade/feat/add_arangodb_env_vars
Browse files Browse the repository at this point in the history
Feat/add arangodb env vars
  • Loading branch information
isobel-daley-6point6 authored Apr 16, 2024
2 parents fc30205 + 575cacc commit 0dddaea
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
4 changes: 4 additions & 0 deletions infra/ecs_main_admin.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ locals {
authbroker_url = "${var.admin_authbroker_url}"
secret_key = "${random_string.admin_secret_key.result}"

arango_db__host = "${aws_ecs_service.arango.address}"
arango_db__password = "${random_string.aws_arangodb_root_password.result}"
arango_db__port = "${aws_ecs_service.arango.port}"

environment = "${var.admin_environment}"

uploads_bucket = "${var.uploads_bucket}"
Expand Down
16 changes: 16 additions & 0 deletions infra/ecs_main_admin_container_definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@
"name": "EXPLORER_DEFAULT_CONNECTION",
"value": "datasets_1"
},
{
"name": "ARANGO_DB__HOST",
"value": "${arango_db__host}"
},
{
"name": "ARANGO_DB__PORT",
"value": "${arango_db__port}"
},
{
"name": "ARANGO_DB__USER",
"value": "root"
},
{
"name": "ARANGO_DB__PASSWORD",
"value": "${arango_db__password}"
},
{
"name": "ALLOWED_HOSTS__1",
"value": "${root_domain}"
Expand Down
10 changes: 10 additions & 0 deletions infra/ecs_main_arango.tf
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ data "template_file" "arango_service_container_definitions" {
log_region = "${data.aws_region.aws_region.name}"
cpu = "${local.arango_container_cpu}"
memory = "${local.arango_container_memory}"
root_password = "${random_string.aws_arangodb_root_password.result}"
}
}

Expand Down Expand Up @@ -405,4 +406,13 @@ resource "aws_lb_target_group" "arango" {
unhealthy_threshold = 2
path = "/_db/_system/_admin/aardvark/index.html"
}
}

resource "random_string" "aws_arangodb_root_password" {
length = 64
special = false

lifecycle {
ignore_changes = all
}
}
7 changes: 6 additions & 1 deletion infra/ecs_main_arango_container_definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
"awslogs-stream-prefix": "${container_name}"
}
},
"environment": [],
"environment": [
{
"name": "ARANGO_ROOT_PASSWORD",
"value": "${root_password}"
}
],
"mountPoints" : [{
"containerPath" : "/data/",
"sourceVolume" : "data-arango"
Expand Down

0 comments on commit 0dddaea

Please sign in to comment.