From ae0b1a4d004c31b318f00ba7bbe0f5dd5c01b50b Mon Sep 17 00:00:00 2001 From: The Magician Date: Tue, 11 Jul 2023 11:15:39 -0700 Subject: [PATCH] feat(vertexai): support `shard_size` in `google_vertex_ai_index` (#8293) (#1146) Signed-off-by: Modular Magician --- .../resources/services/vertexai/vertexai_index.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tfplan2cai/converters/google/resources/services/vertexai/vertexai_index.go b/tfplan2cai/converters/google/resources/services/vertexai/vertexai_index.go index 0a68292b3..0655848d9 100644 --- a/tfplan2cai/converters/google/resources/services/vertexai/vertexai_index.go +++ b/tfplan2cai/converters/google/resources/services/vertexai/vertexai_index.go @@ -159,6 +159,13 @@ func expandVertexAIIndexMetadataConfig(v interface{}, d tpgresource.TerraformRes transformed["approximateNeighborsCount"] = transformedApproximateNeighborsCount } + transformedShardSize, err := expandVertexAIIndexMetadataConfigShardSize(original["shard_size"], d, config) + if err != nil { + return nil, err + } else if val := reflect.ValueOf(transformedShardSize); val.IsValid() && !tpgresource.IsEmptyValue(val) { + transformed["shardSize"] = transformedShardSize + } + transformedDistanceMeasureType, err := expandVertexAIIndexMetadataConfigDistanceMeasureType(original["distance_measure_type"], d, config) if err != nil { return nil, err @@ -191,6 +198,10 @@ func expandVertexAIIndexMetadataConfigApproximateNeighborsCount(v interface{}, d return v, nil } +func expandVertexAIIndexMetadataConfigShardSize(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { + return v, nil +} + func expandVertexAIIndexMetadataConfigDistanceMeasureType(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) { return v, nil }