Page MenuHomePhabricator

[terraform] create comm database on aws rds startup
ClosedPublic

Authored by will on Jul 8 2024, 5:37 AM.
Tags
None
Referenced Files
F3527860: D12689.id42105.diff
Tue, Dec 24, 7:13 AM
F3526936: D12689.id42442.diff
Tue, Dec 24, 2:21 AM
F3526935: D12689.id42391.diff
Tue, Dec 24, 2:21 AM
F3526934: D12689.id42143.diff
Tue, Dec 24, 2:21 AM
F3526933: D12689.id42105.diff
Tue, Dec 24, 2:21 AM
F3526932: D12689.id42213.diff
Tue, Dec 24, 2:21 AM
F3526920: D12689.id.diff
Tue, Dec 24, 2:21 AM
F3526915: D12689.diff
Tue, Dec 24, 2:20 AM
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.Jul 8 2024, 6:04 AM
Harbormaster failed remote builds in B30193: Diff 42105!
will requested review of this revision.Jul 9 2024, 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.Jul 10 2024, 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