-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
google_sql_database_instance inconsistent private_network value #10107
Comments
@joe-a-t can you share the debug log that capture all the api calls? |
I censored some of the relevant fields with
|
@joe-a-t what do you see if you use the same format for the resource "google_sql_database_instance" "replica" {
name = "replica-instance"
database_version = google_sql_database_instance.master.database_version
region = google_sql_database_instance.master.region
master_instance_name = google_sql_database_instance.master.name
deletion_protection = false
settings {
ip_configuration {
ipv4_enabled = false
private_network = google_compute_network.network.self_link
}
tier = google_sql_database_instance.master.settings[0].tier
}
} |
Either explicitly passing the network to the replica as you suggest (not ideal in our situation since the replica is wrapped inside of a separate module so it would require an extra module input) or using resource "google_sql_database_instance" "master" {
name = "master-instance"
database_version = "POSTGRES_11"
region = "us-central1"
deletion_protection = false
settings {
ip_configuration {
ipv4_enabled = false
private_network = google_compute_network.network.id
}
tier = "db-f1-micro"
}
depends_on = [
google_service_networking_connection.this
]
} |
@joe-a-t yes. You are right. Setting both to |
Yep, that all makes sense. I think we had missed the memo that |
@joe-a-t you are right. I don't think there will be a solution in the provider side. Please switch to |
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. |
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
Terraform version 0.15.3
Google provider version 3.84.0
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
All resources should have been properly created
Actual Behavior
Steps to Reproduce
terraform apply
that creates both the master and replica instance in the same apply. If the master instance already exists, the replica will successfully create.Important Factoids
I think this traces back to
private_network = google_compute_network.network.self_link
on the master instance. It looks likeprivate_network
accepts bothself_link
andid
for the network but once the DB instance is created, it will always export the network by itsid
. Is this simply a situation where we should useprivate_network = google_compute_network.network.id
instead and avoid theself_link
or should the provider handle this use case?The text was updated successfully, but these errors were encountered: