From d4e09f1c902bc20205915cb20d93e9fc005e73ba Mon Sep 17 00:00:00 2001 From: Sam Levenick Date: Fri, 15 May 2026 10:48:04 -0700 Subject: [PATCH] Add migration center report config resource and tests --- .../migrationcenter/ReportConfig.yaml | 91 +++++++++++++++++++ ...gration_center_report_config_basic.tf.tmpl | 20 ++++ 2 files changed, 111 insertions(+) create mode 100644 mmv1/products/migrationcenter/ReportConfig.yaml create mode 100644 mmv1/templates/terraform/examples/migration_center_report_config_basic.tf.tmpl diff --git a/mmv1/products/migrationcenter/ReportConfig.yaml b/mmv1/products/migrationcenter/ReportConfig.yaml new file mode 100644 index 000000000000..ef61f7c566c1 --- /dev/null +++ b/mmv1/products/migrationcenter/ReportConfig.yaml @@ -0,0 +1,91 @@ +# Copyright 2026 Google Inc. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +name: ReportConfig +description: ReportConfig defines the configuration and criteria used to generate Migration Center reports. +base_url: projects/{{project}}/locations/{{location}}/reportConfigs +immutable: true +self_link: projects/{{project}}/locations/{{location}}/reportConfigs/{{report_config_id}} +create_url: projects/{{project}}/locations/{{location}}/reportConfigs?reportConfigId={{report_config_id}} +import_format: + - projects/{{project}}/locations/{{location}}/reportConfigs/{{report_config_id}} +async: + operation: + base_url: '{{op_id}}' + actions: + - create + - delete + result: + resource_inside_response: true +autogen_status: UmVwb3J0Q29uZmln +autogen_async: true +examples: + - name: 'migration_center_report_config_basic' + primary_resource_id: 'default' + vars: + report_config_id: 'report-config-test' + pref_set_id: 'pref-set-test' + group_id: 'group-test' +parameters: + - name: location + type: String + required: true + description: Resource ID segment making up resource `name`. It identifies the resource within its parent collection as described in https://google.aip.dev/122. + immutable: true + url_param_only: true + - name: reportConfigId + type: String + required: true + description: |- + User specified ID for the report config. It will become the last component + of the report config name. The ID must be unique within the project, must + conform with RFC-1034, is restricted to lower-cased letters, and has a + maximum length of 63 characters. The ID must match the regular expression: + [a-z]([a-z0-9-]{0,61}[a-z0-9])?. + immutable: true + url_param_only: true +properties: + - name: createTime + type: String + description: The timestamp when the resource was created. + output: true + - name: description + type: String + description: Free-text description. + - name: displayName + type: String + description: User-friendly display name. Maximum length is 63 characters. + - name: groupPreferencesetAssignments + type: Array + required: true + description: Collection of combinations of groups and preference sets. + item_type: + type: NestedObject + properties: + - name: group + type: String + required: true + description: Name of the group. + - name: preferenceSet + type: String + required: true + description: Name of the Preference Set. + - name: name + type: String + description: Name of resource. + output: true + - name: updateTime + type: String + description: The timestamp when the resource was last updated. + output: true diff --git a/mmv1/templates/terraform/examples/migration_center_report_config_basic.tf.tmpl b/mmv1/templates/terraform/examples/migration_center_report_config_basic.tf.tmpl new file mode 100644 index 000000000000..592513e24667 --- /dev/null +++ b/mmv1/templates/terraform/examples/migration_center_report_config_basic.tf.tmpl @@ -0,0 +1,20 @@ +resource "google_migration_center_group" "default" { + location = "us-central1" + group_id = "{{index $.Vars "group_id"}}" +} + +resource "google_migration_center_preference_set" "default" { + location = "us-central1" + preference_set_id = "{{index $.Vars "pref_set_id"}}" +} + +resource "google_migration_center_report_config" "default" { + location = "us-central1" + report_config_id = "{{index $.Vars "report_config_id"}}" + description = "Terraform integration test description" + display_name = "Terraform integration test display" + group_preferenceset_assignments { + group = google_migration_center_group.default.id + preference_set = google_migration_center_preference_set.default.id + } +}