Skip to content

Conversation

TheOneFromNorway
Copy link
Contributor

@TheOneFromNorway TheOneFromNorway commented Sep 8, 2025

  • User must be created within aws account due to database living in private subnet
  • For simplicity just create user on startup of application if does not already exist
  • Password is managed via terraform and injected into container

Ticket: MAV-1941

@@ -124,6 +124,10 @@ locals {
{
name = "RAILS_MASTER_KEY"
valueFrom = var.rails_master_key_path
},
{
name = "RO_DB_PASSWORD"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name = "RO_DB_PASSWORD"
name = "READ_ONLY_DB_PASSWORD"

Is there any reason not to use the full name? It took me a while to work out what "ro" stood for reading this!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ro is standard abbreviation for denoting read-only in the dba world but I have expanded it here for clarity (readonly_user was changed to grafana_ro to reflect reader scope more accurately)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few other places where we've still got ro (grafana_ro, ro_db_password, ro-db-password for example). I think it be worth updating these too for consistency.

- User must be created within aws account due to database living in
  private subnet
- For simplicity just create user on startup of application if does not
  already exist
- Password is managed via terraform and injected into container
@TheOneFromNorway TheOneFromNorway force-pushed the ro_user_for_data_replication branch from 5610a96 to e50a8b4 Compare September 9, 2025 11:14
Copy link

sonarqubecloud bot commented Sep 9, 2025

@@ -36,7 +36,7 @@ resource "aws_rds_cluster" "cluster" {
}

lifecycle {
ignore_changes = [cluster_identifier]
ignore_changes = [cluster_identifier, snapshot_identifier]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that really what we want? I would imagine the cluster should be recreated if the snapshot_identifier changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we have an option in the workflow to decide whether or not we actually want to recreate the database I would only want to trigger the recreation when that option is specified, otherwise we will recreate every deploy that is 12 hours apart regardless of this option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants