Skip to content
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/hashicorp/hcl/v2 v2.23.0
github.com/hashicorp/terraform-json v0.24.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.0
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20250530001903-344b19af2e5e
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20250530014058-8b1490d5bb8c
github.com/mitchellh/go-homedir v1.1.0
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.10.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.0 h1:7/iejAPyCRBhqAg3jOx+4UcA
github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.0/go.mod h1:TiQwXAjFrgBf5tg5rvBRz8/ubPULpU0HjSaVi5UoJf8=
github.com/hashicorp/terraform-plugin-testing v1.5.1 h1:T4aQh9JAhmWo4+t1A7x+rnxAJHCDIYW9kXyo4sVO92c=
github.com/hashicorp/terraform-plugin-testing v1.5.1/go.mod h1:dg8clO6K59rZ8w9EshBmDp1CxTIPu3yA4iaDpX1h5u0=
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20250530001903-344b19af2e5e h1:C3T+a6mbKO/AQEwnxBbLKCpS2H5W81Z2T9iWclot0dg=
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20250530001903-344b19af2e5e/go.mod h1:QS9dytYA/BzNKhKt9T+jLFuZzhpGYs9PcVcugNkJ8Aw=
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20250530014058-8b1490d5bb8c h1:5ONzEJTj9+sUFLFVEFdXUYg1vWLLHjNBrRC9QQ2zY9o=
github.com/hashicorp/terraform-provider-google-beta v1.20.1-0.20250530014058-8b1490d5bb8c/go.mod h1:QS9dytYA/BzNKhKt9T+jLFuZzhpGYs9PcVcugNkJ8Aw=
github.com/hashicorp/terraform-registry-address v0.2.4 h1:JXu/zHB2Ymg/TGVCRu10XqNa4Sh2bWcqCNyKWjnCPJA=
github.com/hashicorp/terraform-registry-address v0.2.4/go.mod h1:tUNYTVyCtU4OIGXXMDp7WNcJ+0W1B4nmstVDgHMjfAU=
github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ func GetDatastreamPrivateConnectionApiObject(d tpgresource.TerraformResourceData
} else if v, ok := d.GetOkExists("vpc_peering_config"); !tpgresource.IsEmptyValue(reflect.ValueOf(vpcPeeringConfigProp)) && (ok || !reflect.DeepEqual(v, vpcPeeringConfigProp)) {
obj["vpcPeeringConfig"] = vpcPeeringConfigProp
}
pscInterfaceConfigProp, err := expandDatastreamPrivateConnectionPscInterfaceConfig(d.Get("psc_interface_config"), d, config)
if err != nil {
return nil, err
} else if v, ok := d.GetOkExists("psc_interface_config"); !tpgresource.IsEmptyValue(reflect.ValueOf(pscInterfaceConfigProp)) && (ok || !reflect.DeepEqual(v, pscInterfaceConfigProp)) {
obj["pscInterfaceConfig"] = pscInterfaceConfigProp
}
labelsProp, err := expandDatastreamPrivateConnectionEffectiveLabels(d.Get("effective_labels"), d, config)
if err != nil {
return nil, err
Expand Down Expand Up @@ -116,6 +122,29 @@ func expandDatastreamPrivateConnectionVpcPeeringConfigSubnet(v interface{}, d tp
return v, nil
}

func expandDatastreamPrivateConnectionPscInterfaceConfig(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.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{})

transformedNetworkAttachment, err := expandDatastreamPrivateConnectionPscInterfaceConfigNetworkAttachment(original["network_attachment"], d, config)
if err != nil {
return nil, err
} else if val := reflect.ValueOf(transformedNetworkAttachment); val.IsValid() && !tpgresource.IsEmptyValue(val) {
transformed["networkAttachment"] = transformedNetworkAttachment
}

return transformed, nil
}

func expandDatastreamPrivateConnectionPscInterfaceConfigNetworkAttachment(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
return v, nil
}

func expandDatastreamPrivateConnectionEffectiveLabels(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (map[string]string, error) {
if v == nil {
return map[string]string{}, nil
Expand Down