From 83849bc5928cc7588f9e5569e5f942b8ac182a14 Mon Sep 17 00:00:00 2001 From: BBBmau Date: Wed, 8 May 2024 17:45:11 -0700 Subject: [PATCH] add source_model support for :copy --- .../custom_flatten/vertex_ai_name_from_model.go.erb | 7 ------- .../terraform/decoders/vertex_ai_models.go.erb | 4 ---- .../terraform/examples/vertex_ai_model_basic.tf.erb | 13 ------------- .../terraform/pre_create/vertex_ai_models.go.erb | 9 --------- 4 files changed, 33 deletions(-) delete mode 100644 mmv1/templates/terraform/custom_flatten/vertex_ai_name_from_model.go.erb delete mode 100644 mmv1/templates/terraform/decoders/vertex_ai_models.go.erb delete mode 100644 mmv1/templates/terraform/examples/vertex_ai_model_basic.tf.erb delete mode 100644 mmv1/templates/terraform/pre_create/vertex_ai_models.go.erb diff --git a/mmv1/templates/terraform/custom_flatten/vertex_ai_name_from_model.go.erb b/mmv1/templates/terraform/custom_flatten/vertex_ai_name_from_model.go.erb deleted file mode 100644 index d6dcef6856ec..000000000000 --- a/mmv1/templates/terraform/custom_flatten/vertex_ai_name_from_model.go.erb +++ /dev/null @@ -1,7 +0,0 @@ -func flatten<%= prefix -%><%= titlelize_property(property) -%>(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} { - if d.Get("name").(string) == "" { - return v.(string) - } - - return d.Get("name") -} \ No newline at end of file diff --git a/mmv1/templates/terraform/decoders/vertex_ai_models.go.erb b/mmv1/templates/terraform/decoders/vertex_ai_models.go.erb deleted file mode 100644 index 66985ff32565..000000000000 --- a/mmv1/templates/terraform/decoders/vertex_ai_models.go.erb +++ /dev/null @@ -1,4 +0,0 @@ -if res["model"] != "" { - res["name"] = res["model"] -} -return res, nil \ No newline at end of file diff --git a/mmv1/templates/terraform/examples/vertex_ai_model_basic.tf.erb b/mmv1/templates/terraform/examples/vertex_ai_model_basic.tf.erb deleted file mode 100644 index 4bbb7740aabc..000000000000 --- a/mmv1/templates/terraform/examples/vertex_ai_model_basic.tf.erb +++ /dev/null @@ -1,13 +0,0 @@ -resource "google_vertex_ai_models" "<%= ctx[:primary_resource_id] %>" { - display_name = "<%= ctx[:vars]['display_name'] %>" - description = "sample description" - labels = { - "key1" : "value1", - "key2" : "value2" - } - region = "us-central1" - encryption_spec { - kms_key_name = "<%= ctx[:vars]['kms_key_name'] %>" - } - depends_on = [google_kms_crypto_key_iam_member.crypto_key] -} \ No newline at end of file diff --git a/mmv1/templates/terraform/pre_create/vertex_ai_models.go.erb b/mmv1/templates/terraform/pre_create/vertex_ai_models.go.erb deleted file mode 100644 index d0dea95f6ce5..000000000000 --- a/mmv1/templates/terraform/pre_create/vertex_ai_models.go.erb +++ /dev/null @@ -1,9 +0,0 @@ -var postRequestType string -if _, ok := d.GetOk("model"); ok { - postRequestType = ":upload" -} - -if _, ok := d.GetOk("source_model"); ok { - postRequestType = ":copy" -} -url = regexp.MustCompile("PRE_CREATE_REPLACE_ME").ReplaceAllLiteralString(url, postRequestType) \ No newline at end of file