Page MenuHomePhabricator

D12689.diff
No OneTemporary

D12689.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
@@ -116,6 +116,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, Nov 27, 10:08 AM (21 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2590123
Default Alt Text
D12689.diff (1 KB)

Event Timeline