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
26 changes: 26 additions & 0 deletions mmv1/products/vertexai/ReasoningEngine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,33 @@ async:
result:
resource_inside_response: true
examples:
- name: 'vertex_ai_reasoning_engine_deletion_policy'
primary_resource_id: 'reasoning_engine'
exclude_docs: true
vars:
name: 'reasoning-engine'
ignore_read_extra:
- 'deletion_policy'
- name: 'vertex_ai_reasoning_engine_basic'
primary_resource_id: 'reasoning_engine'
exclude_docs: true
vars:
name: 'reasoning-engine'
ignore_read_extra:
- 'deletion_policy'
- name: 'vertex_ai_reasoning_engine_source_based_deployment'
primary_resource_id: 'reasoning_engine'
vars:
name: 'reasoning-engine'
ignore_read_extra:
- 'deletion_policy'
- name: 'vertex_ai_reasoning_engine_developer_connect_source'
skip_docs: true # skip docs until templatized (or decide to skip docs permanently then)
primary_resource_id: 'reasoning_engine'
vars:
name: 'reasoning-engine'
ignore_read_extra:
- 'deletion_policy'
- name: 'vertex_ai_reasoning_engine_psc_interface'
primary_resource_id: 'reasoning_engine'
vars:
Expand All @@ -68,6 +81,8 @@ examples:
- member: "serviceAccount:service-{project_number}@gcp-sa-aiplatform-re.iam.gserviceaccount.com"
role: "roles/viewer"
exclude_test: true
ignore_read_extra:
- 'deletion_policy'
- name: 'vertex_ai_reasoning_engine_full'
primary_resource_id: 'reasoning_engine'
vars:
Expand All @@ -82,6 +97,17 @@ examples:
test_vars_overrides:
'kms_key_name': 'acctest.BootstrapKMSKeyWithPurposeInLocationAndName(t, "ENCRYPT_DECRYPT", "us-central1", "tf-bootstrap-re-key1").CryptoKey.Name'
external_providers: ["time"]
ignore_read_extra:
- 'deletion_policy'
custom_code:
pre_delete: 'templates/terraform/pre_delete/reasoning_engine_deletion_policy.go.tmpl'
virtual_fields:
Copy link
Contributor Author

@gwendal-lecren gwendal-lecren Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the internal Magic Modules documentation says (mmv1/api/resource.go):

Virtual fields are similar to url_param_only fields in that they create a schema entry
which is not read from or submitted to the API.
However virtual fields are meant to provide toggles for Terraform-specific behavior 
in a resource (eg: delete_contents_on_destroy) whereas url_param_only fields 
should be used for url construction (like region or location).

So we should probably go with virtual field per my understanding, but not sure actually

- name: 'deletion_policy'
description: |
Optional. The deletion policy for the reasoning engine. Setting this to FORCE allows the reasoning engine to be deleted regardless of child undeleted resources.
type: Enum
enum_values:
- 'FORCE'
parameters:
- name: 'region'
type: String
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "google_vertex_ai_reasoning_engine" "{{$.PrimaryResourceId}}" {
display_name = "{{index $.Vars "name"}}"
description = "A reasoning engine with deletion policy"
region = "us-central1"
deletion_policy = "FORCE"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if v, ok := d.GetOk("deletion_policy"); ok {
if v.(string) == "FORCE" {
url, err = transport_tpg.AddQueryParams(url, map[string]string{"force": "true"})
if err != nil {
return err
}
}
}
Loading