@@ -98,6 +98,50 @@ func ResourceVertexAIFeatureOnlineStore() *schema.Resource {
98
98
},
99
99
ExactlyOneOf : []string {"bigtable" , "optimized" },
100
100
},
101
+ "dedicated_serving_endpoint" : {
102
+ Type : schema .TypeList ,
103
+ Computed : true ,
104
+ Optional : true ,
105
+ Description : `The dedicated serving endpoint for this FeatureOnlineStore, which is different from common vertex service endpoint. Only need to be set when you choose Optimized storage type or enable EmbeddingManagement. Will use public endpoint by default.` ,
106
+ MaxItems : 1 ,
107
+ Elem : & schema.Resource {
108
+ Schema : map [string ]* schema.Schema {
109
+ "private_service_connect_config" : {
110
+ Type : schema .TypeList ,
111
+ Optional : true ,
112
+ Description : `Private service connect config.` ,
113
+ MaxItems : 1 ,
114
+ Elem : & schema.Resource {
115
+ Schema : map [string ]* schema.Schema {
116
+ "enable_private_service_connect" : {
117
+ Type : schema .TypeBool ,
118
+ Required : true ,
119
+ Description : `If set to true, customers will use private service connection to send request. Otherwise, the connection will set to public endpoint.` ,
120
+ },
121
+ "project_allowlist" : {
122
+ Type : schema .TypeList ,
123
+ Optional : true ,
124
+ Description : `A list of Projects from which the forwarding rule will target the service attachment.` ,
125
+ Elem : & schema.Schema {
126
+ Type : schema .TypeString ,
127
+ },
128
+ },
129
+ },
130
+ },
131
+ },
132
+ "public_endpoint_domain_name" : {
133
+ Type : schema .TypeString ,
134
+ Computed : true ,
135
+ Description : `Domain name to use for this FeatureOnlineStore` ,
136
+ },
137
+ "service_attachment" : {
138
+ Type : schema .TypeString ,
139
+ Computed : true ,
140
+ Description : `Name of the service attachment resource. Applicable only if private service connect is enabled and after FeatureViewSync is created.` ,
141
+ },
142
+ },
143
+ },
144
+ },
101
145
"labels" : {
102
146
Type : schema .TypeMap ,
103
147
Optional : true ,
@@ -195,6 +239,12 @@ func resourceVertexAIFeatureOnlineStoreCreate(d *schema.ResourceData, meta inter
195
239
} else if v , ok := d .GetOkExists ("optimized" ); ok || ! reflect .DeepEqual (v , optimizedProp ) {
196
240
obj ["optimized" ] = optimizedProp
197
241
}
242
+ dedicatedServingEndpointProp , err := expandVertexAIFeatureOnlineStoreDedicatedServingEndpoint (d .Get ("dedicated_serving_endpoint" ), d , config )
243
+ if err != nil {
244
+ return err
245
+ } else if v , ok := d .GetOkExists ("dedicated_serving_endpoint" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (dedicatedServingEndpointProp )) && (ok || ! reflect .DeepEqual (v , dedicatedServingEndpointProp )) {
246
+ obj ["dedicatedServingEndpoint" ] = dedicatedServingEndpointProp
247
+ }
198
248
labelsProp , err := expandVertexAIFeatureOnlineStoreEffectiveLabels (d .Get ("effective_labels" ), d , config )
199
249
if err != nil {
200
250
return err
@@ -334,6 +384,9 @@ func resourceVertexAIFeatureOnlineStoreRead(d *schema.ResourceData, meta interfa
334
384
if err := d .Set ("optimized" , flattenVertexAIFeatureOnlineStoreOptimized (res ["optimized" ], d , config )); err != nil {
335
385
return fmt .Errorf ("Error reading FeatureOnlineStore: %s" , err )
336
386
}
387
+ if err := d .Set ("dedicated_serving_endpoint" , flattenVertexAIFeatureOnlineStoreDedicatedServingEndpoint (res ["dedicatedServingEndpoint" ], d , config )); err != nil {
388
+ return fmt .Errorf ("Error reading FeatureOnlineStore: %s" , err )
389
+ }
337
390
if err := d .Set ("terraform_labels" , flattenVertexAIFeatureOnlineStoreTerraformLabels (res ["labels" ], d , config )); err != nil {
338
391
return fmt .Errorf ("Error reading FeatureOnlineStore: %s" , err )
339
392
}
@@ -372,6 +425,12 @@ func resourceVertexAIFeatureOnlineStoreUpdate(d *schema.ResourceData, meta inter
372
425
} else if v , ok := d .GetOkExists ("optimized" ); ok || ! reflect .DeepEqual (v , optimizedProp ) {
373
426
obj ["optimized" ] = optimizedProp
374
427
}
428
+ dedicatedServingEndpointProp , err := expandVertexAIFeatureOnlineStoreDedicatedServingEndpoint (d .Get ("dedicated_serving_endpoint" ), d , config )
429
+ if err != nil {
430
+ return err
431
+ } else if v , ok := d .GetOkExists ("dedicated_serving_endpoint" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , dedicatedServingEndpointProp )) {
432
+ obj ["dedicatedServingEndpoint" ] = dedicatedServingEndpointProp
433
+ }
375
434
labelsProp , err := expandVertexAIFeatureOnlineStoreEffectiveLabels (d .Get ("effective_labels" ), d , config )
376
435
if err != nil {
377
436
return err
@@ -396,6 +455,10 @@ func resourceVertexAIFeatureOnlineStoreUpdate(d *schema.ResourceData, meta inter
396
455
updateMask = append (updateMask , "optimized" )
397
456
}
398
457
458
+ if d .HasChange ("dedicated_serving_endpoint" ) {
459
+ updateMask = append (updateMask , "dedicatedServingEndpoint" )
460
+ }
461
+
399
462
if d .HasChange ("effective_labels" ) {
400
463
updateMask = append (updateMask , "labels" )
401
464
}
@@ -647,6 +710,54 @@ func flattenVertexAIFeatureOnlineStoreOptimized(v interface{}, d *schema.Resourc
647
710
return []interface {}{transformed }
648
711
}
649
712
713
+ func flattenVertexAIFeatureOnlineStoreDedicatedServingEndpoint (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
714
+ if v == nil {
715
+ return nil
716
+ }
717
+ original := v .(map [string ]interface {})
718
+ if len (original ) == 0 {
719
+ return nil
720
+ }
721
+ transformed := make (map [string ]interface {})
722
+ transformed ["public_endpoint_domain_name" ] =
723
+ flattenVertexAIFeatureOnlineStoreDedicatedServingEndpointPublicEndpointDomainName (original ["publicEndpointDomainName" ], d , config )
724
+ transformed ["service_attachment" ] =
725
+ flattenVertexAIFeatureOnlineStoreDedicatedServingEndpointServiceAttachment (original ["serviceAttachment" ], d , config )
726
+ transformed ["private_service_connect_config" ] =
727
+ flattenVertexAIFeatureOnlineStoreDedicatedServingEndpointPrivateServiceConnectConfig (original ["privateServiceConnectConfig" ], d , config )
728
+ return []interface {}{transformed }
729
+ }
730
+ func flattenVertexAIFeatureOnlineStoreDedicatedServingEndpointPublicEndpointDomainName (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
731
+ return v
732
+ }
733
+
734
+ func flattenVertexAIFeatureOnlineStoreDedicatedServingEndpointServiceAttachment (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
735
+ return v
736
+ }
737
+
738
+ func flattenVertexAIFeatureOnlineStoreDedicatedServingEndpointPrivateServiceConnectConfig (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
739
+ if v == nil {
740
+ return nil
741
+ }
742
+ original := v .(map [string ]interface {})
743
+ if len (original ) == 0 {
744
+ return nil
745
+ }
746
+ transformed := make (map [string ]interface {})
747
+ transformed ["enable_private_service_connect" ] =
748
+ flattenVertexAIFeatureOnlineStoreDedicatedServingEndpointPrivateServiceConnectConfigEnablePrivateServiceConnect (original ["enablePrivateServiceConnect" ], d , config )
749
+ transformed ["project_allowlist" ] =
750
+ flattenVertexAIFeatureOnlineStoreDedicatedServingEndpointPrivateServiceConnectConfigProjectAllowlist (original ["projectAllowlist" ], d , config )
751
+ return []interface {}{transformed }
752
+ }
753
+ func flattenVertexAIFeatureOnlineStoreDedicatedServingEndpointPrivateServiceConnectConfigEnablePrivateServiceConnect (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
754
+ return v
755
+ }
756
+
757
+ func flattenVertexAIFeatureOnlineStoreDedicatedServingEndpointPrivateServiceConnectConfigProjectAllowlist (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
758
+ return v
759
+ }
760
+
650
761
func flattenVertexAIFeatureOnlineStoreTerraformLabels (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
651
762
if v == nil {
652
763
return v
@@ -745,6 +856,81 @@ func expandVertexAIFeatureOnlineStoreOptimized(v interface{}, d tpgresource.Terr
745
856
return transformed , nil
746
857
}
747
858
859
+ func expandVertexAIFeatureOnlineStoreDedicatedServingEndpoint (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
860
+ l := v .([]interface {})
861
+ if len (l ) == 0 || l [0 ] == nil {
862
+ return nil , nil
863
+ }
864
+ raw := l [0 ]
865
+ original := raw .(map [string ]interface {})
866
+ transformed := make (map [string ]interface {})
867
+
868
+ transformedPublicEndpointDomainName , err := expandVertexAIFeatureOnlineStoreDedicatedServingEndpointPublicEndpointDomainName (original ["public_endpoint_domain_name" ], d , config )
869
+ if err != nil {
870
+ return nil , err
871
+ } else if val := reflect .ValueOf (transformedPublicEndpointDomainName ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
872
+ transformed ["publicEndpointDomainName" ] = transformedPublicEndpointDomainName
873
+ }
874
+
875
+ transformedServiceAttachment , err := expandVertexAIFeatureOnlineStoreDedicatedServingEndpointServiceAttachment (original ["service_attachment" ], d , config )
876
+ if err != nil {
877
+ return nil , err
878
+ } else if val := reflect .ValueOf (transformedServiceAttachment ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
879
+ transformed ["serviceAttachment" ] = transformedServiceAttachment
880
+ }
881
+
882
+ transformedPrivateServiceConnectConfig , err := expandVertexAIFeatureOnlineStoreDedicatedServingEndpointPrivateServiceConnectConfig (original ["private_service_connect_config" ], d , config )
883
+ if err != nil {
884
+ return nil , err
885
+ } else if val := reflect .ValueOf (transformedPrivateServiceConnectConfig ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
886
+ transformed ["privateServiceConnectConfig" ] = transformedPrivateServiceConnectConfig
887
+ }
888
+
889
+ return transformed , nil
890
+ }
891
+
892
+ func expandVertexAIFeatureOnlineStoreDedicatedServingEndpointPublicEndpointDomainName (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
893
+ return v , nil
894
+ }
895
+
896
+ func expandVertexAIFeatureOnlineStoreDedicatedServingEndpointServiceAttachment (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
897
+ return v , nil
898
+ }
899
+
900
+ func expandVertexAIFeatureOnlineStoreDedicatedServingEndpointPrivateServiceConnectConfig (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
901
+ l := v .([]interface {})
902
+ if len (l ) == 0 || l [0 ] == nil {
903
+ return nil , nil
904
+ }
905
+ raw := l [0 ]
906
+ original := raw .(map [string ]interface {})
907
+ transformed := make (map [string ]interface {})
908
+
909
+ transformedEnablePrivateServiceConnect , err := expandVertexAIFeatureOnlineStoreDedicatedServingEndpointPrivateServiceConnectConfigEnablePrivateServiceConnect (original ["enable_private_service_connect" ], d , config )
910
+ if err != nil {
911
+ return nil , err
912
+ } else if val := reflect .ValueOf (transformedEnablePrivateServiceConnect ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
913
+ transformed ["enablePrivateServiceConnect" ] = transformedEnablePrivateServiceConnect
914
+ }
915
+
916
+ transformedProjectAllowlist , err := expandVertexAIFeatureOnlineStoreDedicatedServingEndpointPrivateServiceConnectConfigProjectAllowlist (original ["project_allowlist" ], d , config )
917
+ if err != nil {
918
+ return nil , err
919
+ } else if val := reflect .ValueOf (transformedProjectAllowlist ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
920
+ transformed ["projectAllowlist" ] = transformedProjectAllowlist
921
+ }
922
+
923
+ return transformed , nil
924
+ }
925
+
926
+ func expandVertexAIFeatureOnlineStoreDedicatedServingEndpointPrivateServiceConnectConfigEnablePrivateServiceConnect (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
927
+ return v , nil
928
+ }
929
+
930
+ func expandVertexAIFeatureOnlineStoreDedicatedServingEndpointPrivateServiceConnectConfigProjectAllowlist (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
931
+ return v , nil
932
+ }
933
+
748
934
func expandVertexAIFeatureOnlineStoreEffectiveLabels (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (map [string ]string , error ) {
749
935
if v == nil {
750
936
return map [string ]string {}, nil
0 commit comments