You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.
In addition to recreating the google_spanner_instance it should also recreate the google_spanner_database linked to it.
Actual Behavior
It only recreates the google_spanner_instance (making a spanner instance with no database).
By planning again, it will notice the google_spanner_database is missing and will want to create it. It should all happen at the same time.
Change the google_spanner_instance config to force a destroy & create.
resource"google_spanner_instance""test" {
project=var.projectname="test"config="nam11"// Will force recreationdisplay_name="Test"num_nodes=1
}
resource"google_spanner_database""test" {
project=var.projectinstance=google_spanner_instance.test.namename="test"
}
terraform plan
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement
Terraform will perform the following actions:
# google_spanner_instance.test must be replaced
-/+ resource "google_spanner_instance" "test" {
~ config = "projects/test-project/instanceConfigs/regional-us-east1" -> "nam11" # forces replacement
display_name = "Test"
~ id = "test-project/test" -> (known after apply)
- labels = {} -> null
name = "test"
num_nodes = 1
project = "test-project"
~ state = "READY" -> (known after apply)
}
Plan: 1 to add, 0 to change, 1 to destroy.
The plan is missing the google_spanner_database database which will also be destroyed (and should be recreated).
Yes, we have to apply twice to restore the database. Not sure if there is a proper way that the Terraform code can be configured to reflect the underlying relationship.
This is an occurrence of an upstream issue in Terraform's resource model (hashicorp/terraform-plugin-sdk#122) for which we're not aware of any solution, unfortunately. Since there's nothing we can do here, I'm closing this out.
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
ghost
locked as resolved and limited conversation to collaborators
Dec 20, 2020
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Affected Resource(s)
Terraform Configuration Files
Before:
After:
Debug Output
https://gist.github.com/quentinms/52ad7e765738b986888025b953a0f4cf
Panic Output
Expected Behavior
In addition to recreating the
google_spanner_instance
it should also recreate thegoogle_spanner_database
linked to it.Actual Behavior
It only recreates the
google_spanner_instance
(making a spanner instance with no database).By planning again, it will notice the
google_spanner_database
is missing and will want to create it. It should all happen at the same time.Steps to Reproduce
terraform plan
&terraform apply
the following:google_spanner_instance
config to force a destroy & create.terraform plan
The plan is missing the
google_spanner_database
database which will also be destroyed (and should be recreated).Important Factoids
References
google_spanner_instance
's recreation behavior was recently changed to fix Error 400 when updating a google_spanner_instance's config #7732.The text was updated successfully, but these errors were encountered: