Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
Set proper dependencies for the ECS containers (#67)
Browse files Browse the repository at this point in the history
This will prevent the web container from starting before downloading the S3 keys or initializing the DB
  • Loading branch information
iuriaranda authored Feb 16, 2022
1 parent b2bd3d7 commit 4a01ba3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ecs-web/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ data "template_file" "concourse_web_task_template" {
concourse_prometheus_bind_port = var.concourse_prometheus_bind_port
concourse_prometheus_bind_ip = var.concourse_prometheus_bind_ip
volumes_from_concourse_db = var.auto_create_db ? ",{ \"sourceContainer\": \"create_db\" }" : ""
db_container_dependency = var.auto_create_db ? ",{ \"containerName\": \"create_db\", \"condition\": \"COMPLETE\" }" : ""
volumes_from_vault_auth = var.vault_server_url != null ? ",{ \"sourceContainer\": \"vault_auth\" }" : ""
vault_command_args = var.vault_server_url != null ? "--vault-client-token=`cat /concourse_vault/token`" : ""
vault_container_dependency = var.vault_server_url != null ? ",{ \"containerName\": \"create_db\", \"condition\": \"SUCCESS\" }" : ""
concourse_extra_args = var.concourse_extra_args != null ? var.concourse_extra_args : ""
concourse_extra_env = var.concourse_extra_env != null ? join("", data.template_file.concourse_extra_env.*.rendered) : ""
concourse_default_build_logs_to_retain = var.concourse_default_build_logs_to_retain
Expand Down
8 changes: 8 additions & 0 deletions ecs-web/task-definitions/concourse_web_service.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@
${volumes_from_concourse_db}
${volumes_from_vault_auth}
],
"dependsOn": [
{
"containerName": "download_keys",
"condition": "SUCCESS"
}
${db_container_dependency}
${vault_container_dependency}
],
"logConfiguration": {
"logDriver": "awslogs",
"options" : {
Expand Down

0 comments on commit 4a01ba3

Please sign in to comment.