Page MenuHomePhabricator

D12689.id42105.diff
No OneTemporary

D12689.id42105.diff

diff --git a/services/terraform/self-host/aws_db.tf b/services/terraform/self-host/aws_db.tf
--- a/services/terraform/self-host/aws_db.tf
+++ b/services/terraform/self-host/aws_db.tf
@@ -97,3 +97,17 @@
value = "0"
}
}
+
+resource "null_resource" "create_comm_database" {
+ depends_on = [aws_db_instance.mariadb, aws_security_group.keyserver_mariadb_security_group]
+
+ provisioner "local-exec" {
+ command = <<EOT
+ mysql --user=${var.mariadb_username} \
+ --port=3307 \
+ --host=${aws_db_instance.mariadb.address} \
+ --execute="CREATE DATABASE IF NOT EXISTS comm;" \
+ --password=${var.mariadb_password}
+ EOT
+ }
+}
diff --git a/services/terraform/self-host/keyserver_primary.tf b/services/terraform/self-host/keyserver_primary.tf
--- a/services/terraform/self-host/keyserver_primary.tf
+++ b/services/terraform/self-host/keyserver_primary.tf
@@ -120,6 +120,8 @@
}
resource "aws_ecs_service" "keyserver_primary_service" {
+ depends_on = [null_resource.create_comm_database]
+
name = "keyserver-primary-service"
cluster = aws_ecs_cluster.keyserver_cluster.id
task_definition = aws_ecs_task_definition.keyserver_service.arn

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 25, 2:21 AM (4 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2701377
Default Alt Text
D12689.id42105.diff (1 KB)

Event Timeline