@@ -73,6 +73,12 @@ Private services access must already be configured for the network. If left unsp
73
73
[Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): 'projects/{project}/global/networks/{network}'.
74
74
Where '{project}' is a project number, as in '12345', and '{network}' is network name.` ,
75
75
},
76
+ "public_endpoint_enabled" : {
77
+ Type : schema .TypeBool ,
78
+ Optional : true ,
79
+ ForceNew : true ,
80
+ Description : `If true, the deployed index will be accessible through public endpoint.` ,
81
+ },
76
82
"region" : {
77
83
Type : schema .TypeString ,
78
84
Optional : true ,
@@ -94,6 +100,11 @@ Where '{project}' is a project number, as in '12345', and '{network}' is network
94
100
Computed : true ,
95
101
Description : `The resource name of the Index.` ,
96
102
},
103
+ "public_endpoint_domain_name" : {
104
+ Type : schema .TypeString ,
105
+ Computed : true ,
106
+ Description : `If publicEndpointEnabled is true, this field will be populated with the domain name to use for this index endpoint.` ,
107
+ },
97
108
"update_time" : {
98
109
Type : schema .TypeString ,
99
110
Computed : true ,
@@ -142,6 +153,12 @@ func resourceVertexAIIndexEndpointCreate(d *schema.ResourceData, meta interface{
142
153
} else if v , ok := d .GetOkExists ("network" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (networkProp )) && (ok || ! reflect .DeepEqual (v , networkProp )) {
143
154
obj ["network" ] = networkProp
144
155
}
156
+ publicEndpointEnabledProp , err := expandVertexAIIndexEndpointPublicEndpointEnabled (d .Get ("public_endpoint_enabled" ), d , config )
157
+ if err != nil {
158
+ return err
159
+ } else if v , ok := d .GetOkExists ("public_endpoint_enabled" ); ! tpgresource .IsEmptyValue (reflect .ValueOf (publicEndpointEnabledProp )) && (ok || ! reflect .DeepEqual (v , publicEndpointEnabledProp )) {
160
+ obj ["publicEndpointEnabled" ] = publicEndpointEnabledProp
161
+ }
145
162
146
163
url , err := tpgresource .ReplaceVars (d , config , "{{VertexAIBasePath}}projects/{{project}}/locations/{{region}}/indexEndpoints" )
147
164
if err != nil {
@@ -272,6 +289,9 @@ func resourceVertexAIIndexEndpointRead(d *schema.ResourceData, meta interface{})
272
289
if err := d .Set ("network" , flattenVertexAIIndexEndpointNetwork (res ["network" ], d , config )); err != nil {
273
290
return fmt .Errorf ("Error reading IndexEndpoint: %s" , err )
274
291
}
292
+ if err := d .Set ("public_endpoint_domain_name" , flattenVertexAIIndexEndpointPublicEndpointDomainName (res ["publicEndpointDomainName" ], d , config )); err != nil {
293
+ return fmt .Errorf ("Error reading IndexEndpoint: %s" , err )
294
+ }
275
295
276
296
return nil
277
297
}
@@ -466,6 +486,10 @@ func flattenVertexAIIndexEndpointNetwork(v interface{}, d *schema.ResourceData,
466
486
return v
467
487
}
468
488
489
+ func flattenVertexAIIndexEndpointPublicEndpointDomainName (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
490
+ return v
491
+ }
492
+
469
493
func expandVertexAIIndexEndpointDisplayName (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
470
494
return v , nil
471
495
}
@@ -488,3 +512,7 @@ func expandVertexAIIndexEndpointLabels(v interface{}, d tpgresource.TerraformRes
488
512
func expandVertexAIIndexEndpointNetwork (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
489
513
return v , nil
490
514
}
515
+
516
+ func expandVertexAIIndexEndpointPublicEndpointEnabled (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
517
+ return v , nil
518
+ }
0 commit comments