Open florianmutter opened 1 year ago
Noticed the same problem.
Closing as a duplicate of https://github.com/hashicorp/terraform-provider-google/issues/16219
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.
The default_labels
is not going to be applied to google_sql_database_instance
resource as user_labels
is nested inside settings
and there is a bug in terraform sdk that SetNew is not working in the nested fields. It needs to wait until the resource is migrated to plugin framework.
The default_labels
will be available in the data source google_client_config
(https://github.com/hashicorp/terraform-provider-google/issues/19140)
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
Debug Output
Panic Output
Expected Behavior
default_labels
are applied togoogle_sql_database_instance
.Actual Behavior
Resource does not get any labels. Probably because the argument for
google_sql_database_instance
is nameduser_labels
.Steps to Reproduce
terraform apply
Important Factoids
References
Code where default_labels are applied: https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/terraform/tpgresource/labels.go#L58
Looks to me like it skips this if there is no
labels
argument.b/308122817