Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3373517
D12689.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12689.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D12689: [terraform] create comm database on aws rds startup
Attached
Detach File
Event Timeline
Log In to Comment