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

provider/google: Fix master_instance_name to prevent slave rebuilds #11477

Merged
merged 1 commit into from
Jan 30, 2017

Conversation

gh-mlfowler
Copy link
Contributor

The v1beta4 API returns the master_instance_name for a Second Generation Replica prefixed with the project which is not what Terraform is expecting, nor is it required. With the project prefixed Terraform plans to recreate the slave on every subsequent apply. The read method has been adjusted to strip the project prefix so slaves can persist.

Two minor fixes are included that were uncovered in the acceptance test. crash_safe_replication is only relevant for First Generation instances so I have not specified it. With the slave the API returns true even if we haven't set the value. Terraform will attempt to set it to false on the next apply which appears to be a no-op in Google as the next plan will show true. I have changed this to a Computed value as it is a boolean.

Not specifying the optional start_time for backup_configuration causes subsequent plans to attempt to adjust the Google default to an empty value. As this is a string I have changed the read to return no value if we haven't set the value.

@gh-mlfowler gh-mlfowler changed the title Fix master_instance_name to prevent slave rebuilds provider/google: Fix master_instance_name to prevent slave rebuilds Jan 27, 2017
@danawillow
Copy link
Contributor

TF_ACC=1 go test ./builtin/providers/google -v -run=TestAccGoogleSqlDatabaseInstance -timeout 120m
=== RUN   TestAccGoogleSqlDatabaseInstance_basic
--- PASS: TestAccGoogleSqlDatabaseInstance_basic (40.18s)
=== RUN   TestAccGoogleSqlDatabaseInstance_basic2
--- PASS: TestAccGoogleSqlDatabaseInstance_basic2 (50.78s)
=== RUN   TestAccGoogleSqlDatabaseInstance_settings_basic
--- PASS: TestAccGoogleSqlDatabaseInstance_settings_basic (31.48s)
=== RUN   TestAccGoogleSqlDatabaseInstance_slave
--- PASS: TestAccGoogleSqlDatabaseInstance_slave (643.12s)
=== RUN   TestAccGoogleSqlDatabaseInstance_settings_upgrade
--- PASS: TestAccGoogleSqlDatabaseInstance_settings_upgrade (54.92s)
=== RUN   TestAccGoogleSqlDatabaseInstance_settings_downgrade
--- PASS: TestAccGoogleSqlDatabaseInstance_settings_downgrade (35.78s)
PASS

LGTM. Thanks for the contribution!

@danawillow danawillow merged commit f7e2147 into hashicorp:master Jan 30, 2017
@gh-mlfowler gh-mlfowler deleted the google-sql2-slave branch January 31, 2017 11:37
arcadiatea pushed a commit to ticketmaster/terraform that referenced this pull request Feb 9, 2017
@ghost
Copy link

ghost commented Apr 17, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants