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
F3373517: D12689.diff
Tue, Nov 26, 10:08 AM
Unknown Object (File)
Fri, Nov 22, 11:07 PM
Unknown Object (File)
Fri, Nov 22, 11:02 PM
Unknown Object (File)
Fri, Nov 22, 10:41 PM
Unknown Object (File)
Wed, Nov 20, 4:01 PM
Unknown Object (File)
Tue, Nov 12, 6:14 AM
Unknown Object (File)
Tue, Nov 12, 4:37 AM
Unknown Object (File)
Tue, Nov 12, 3:41 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
No Lint Coverage
Unit
No Test Coverage

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