Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Relax assignment of backup_configuration when operating as a replica #589

Conversation

OscarVanL
Copy link
Contributor

@OscarVanL OscarVanL commented Apr 5, 2024

Relates to issue #590

In #556 and #559 I added the ability to configure the master_instance_name and instance_type on the main google_sql_database_instance created by this module.

The intent was to allow the module to be used for on-premises database migrations, where the primary instance would start as a replica and then later be promoted to the source.

During this change I disabled the assignment of backup_configuration because the docs say:

Backups cannot be enabled on replica instances, but binary logging can be enabled on a replica even when backups are disabled, unlike the primary.

When an instance is configured with a master_instance_name, the instance is operating as a replica, so cannot have backups enabled. This was why I restricted configuring these values.

However, I was overzealous about which configuration items I blocked. For example, binary logging can be enabled on replicas without enabling backups (infact, it must be to enable to create replicas). The only config here I should have restricted is the enabled option, which this PR changes.

…er_instance_name (replica) to allow configuration, just not backups
@OscarVanL OscarVanL changed the title fix: Relax configuration of backup_configuration when operating as a replica fix: Relax assignment of backup_configuration when operating as a replica Apr 5, 2024
@imrannayer
Copy link
Collaborator

/gcbrun

@OscarVanL
Copy link
Contributor Author

Hi @imrannayer, did that come back clear?

@imrannayer
Copy link
Collaborator

/gcbrun

1 similar comment
@imrannayer
Copy link
Collaborator

/gcbrun

@imrannayer imrannayer merged commit 19daff8 into terraform-google-modules:master Apr 11, 2024
4 checks passed
ps-occrp pushed a commit to ps-occrp/terraform-google-sql-db that referenced this pull request Apr 17, 2024
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.

None yet

2 participants