Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

metastore_service - add telemetry_config #1264

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions converters/google/resources/dataprocmetastore_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ func GetDataprocMetastoreServiceApiObject(d TerraformResourceData, config *Confi
} else if v, ok := d.GetOkExists("release_channel"); !isEmptyValue(reflect.ValueOf(releaseChannelProp)) && (ok || !reflect.DeepEqual(v, releaseChannelProp)) {
obj["releaseChannel"] = releaseChannelProp
}
telemetryConfigProp, err := expandDataprocMetastoreServiceTelemetryConfig(d.Get("telemetry_config"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("telemetry_config"); !isEmptyValue(reflect.ValueOf(telemetryConfigProp)) && (ok || !reflect.DeepEqual(v, telemetryConfigProp)) {
obj["telemetryConfig"] = telemetryConfigProp
}

return obj, nil
}
Expand Down Expand Up @@ -367,3 +373,26 @@ func expandDataprocMetastoreServiceDatabaseType(v interface{}, d TerraformResour
func expandDataprocMetastoreServiceReleaseChannel(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
return v, nil
}

func expandDataprocMetastoreServiceTelemetryConfig(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
l := v.([]interface{})
if len(l) == 0 || l[0] == nil {
return nil, nil
}
raw := l[0]
original := raw.(map[string]interface{})
transformed := make(map[string]interface{})

transformedLogFormat, err := expandDataprocMetastoreServiceTelemetryConfigLogFormat(original["log_format"], d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedLogFormat); val.IsValid() && !isEmptyValue(val) {
transformed["logFormat"] = transformedLogFormat
}

return transformed, nil
}

func expandDataprocMetastoreServiceTelemetryConfigLogFormat(v interface{}, d TerraformResourceData, config *Config) (interface{}, error) {
return v, nil
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/terraform-json v0.14.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0
github.com/hashicorp/terraform-provider-google v1.20.1-0.20230110004347-5d96319ce7cb
github.com/hashicorp/terraform-provider-google v1.20.1-0.20230110133756-75800f9833f1
github.com/mitchellh/go-homedir v1.1.0
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,8 @@ github.com/hashicorp/terraform-plugin-log v0.7.0 h1:SDxJUyT8TwN4l5b5/VkiTIaQgY6R
github.com/hashicorp/terraform-plugin-log v0.7.0/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0 h1:FtCLTiTcykdsURXPt/ku7fYXm3y19nbzbZcUxHx9RbI=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.0/go.mod h1:80wf5oad1tW+oLnbXS4UTYmDCrl7BuN1Q+IA91X1a4Y=
github.com/hashicorp/terraform-provider-google v1.20.1-0.20230110004347-5d96319ce7cb h1:IbHJm0MpTJImKxiqROEhbL8Lg4NIrfoebAUGiB5k+aY=
github.com/hashicorp/terraform-provider-google v1.20.1-0.20230110004347-5d96319ce7cb/go.mod h1:U6fCCwkZ6COAY1NchAI8XWuC2IjBB4Va7qa6wL7Xk6s=
github.com/hashicorp/terraform-provider-google v1.20.1-0.20230110133756-75800f9833f1 h1:21/s9LZNtUxnMDVf7Ln1p9mM9/t+F/pwwh8Rsf/3slg=
github.com/hashicorp/terraform-provider-google v1.20.1-0.20230110133756-75800f9833f1/go.mod h1:U6fCCwkZ6COAY1NchAI8XWuC2IjBB4Va7qa6wL7Xk6s=
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c h1:D8aRO6+mTqHfLsK/BC3j5OAoogv1WLRWzY1AaTo3rBg=
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c/go.mod h1:Wn3Na71knbXc1G8Lh+yu/dQWWJeFQEpDeJMtWMtlmNI=
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.