Page MenuHomePhabricator

[terraform] create comm database on aws rds startup
ClosedPublic

Authored by will on Mon, Jul 8, 5:37 AM.
Tags
None
Referenced Files
F2368697: D12689.id42391.diff
Wed, Jul 31, 12:07 PM
F2368681: D12689.id42442.diff
Wed, Jul 31, 11:47 AM
Unknown Object (File)
Wed, Jul 31, 2:26 AM
Unknown Object (File)
Sat, Jul 27, 4:04 PM
Unknown Object (File)
Sat, Jul 27, 8:28 AM
Unknown Object (File)
Sat, Jul 27, 8:28 AM
Unknown Object (File)
Sat, Jul 27, 8:28 AM
Unknown Object (File)
Fri, Jul 26, 4:50 PM
Subscribers

Details

Summary

Our scripts take care of creating the comm database. However, AWS RDS initializes empty, causing
ecs tasks running the keyserver image to fail. This uses a null_resource to setup the comm database before launching keyserver nodes

Depends on D12688

Test Plan

On terraform apply, I no longer need to mysql remotely into aws rds to create the comm database. The comm database is first created and then the ecs tasks are launched

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Mon, Jul 8, 6:04 AM
Harbormaster failed remote builds in B30193: Diff 42105!
will requested review of this revision.Tue, Jul 9, 6:56 AM

run this command every time

varun added inline comments.
services/terraform/self-host/aws_db.tf
104 ↗(On Diff #42213)

what does this line do?

This revision is now accepted and ready to land.Wed, Jul 10, 11:58 PM
services/terraform/self-host/aws_db.tf
104 ↗(On Diff #42213)

So this ensures that the command is constantly run on every terraform apply as the changing timestamp always triggers the null resource.

This might be overkill, but the case I'm accounting for is if AWS RDS needs to be relaunched or the database was dropped (which I had to do for testing) and the null_resource isn't destroyed with it.

I think it's safe to put in for now, and maybe we can rethink how useful it is later

remove timestamp trigger, running only on first rds creation

services/terraform/self-host/aws_db.tf
104 ↗(On Diff #42213)

Ended up removing this. When one need to switch ip addresses, this prevents you from running terraform apply