From 348c9b8726f149bcc73922c86b9dfdc292d6c172 Mon Sep 17 00:00:00 2001 From: abheda-crest Date: Tue, 31 Dec 2024 14:35:02 +0530 Subject: [PATCH] Update parameter version resource to support only beta version --- .../RegionalParameterVersion.yaml | 13 +++++++++++++ .../regional_parameter_version_basic.tf.tmpl | 2 ++ ...ional_parameter_version_with_json_format.tf.tmpl | 2 ++ ...ional_parameter_version_with_yaml_format.tf.tmpl | 2 ++ ...meter_manager_regional_parameter_version_test.go | 6 +++++- 5 files changed, 24 insertions(+), 1 deletion(-) diff --git a/mmv1/products/parametermanagerregional/RegionalParameterVersion.yaml b/mmv1/products/parametermanagerregional/RegionalParameterVersion.yaml index 3514b983353f..943316439e9a 100644 --- a/mmv1/products/parametermanagerregional/RegionalParameterVersion.yaml +++ b/mmv1/products/parametermanagerregional/RegionalParameterVersion.yaml @@ -16,6 +16,7 @@ name: 'RegionalParameterVersion' api_resource_type_kind: ParameterVersion description: | A Regional Parameter Version resource that stores the actual value of the regional parameter. +min_version: 'beta' references: guides: api: 'https://cloud.google.com/secret-manager/parameter-manager/docs/reference/rest/v1/projects.locations.parameters.versions' @@ -34,11 +35,13 @@ timeouts: examples: - name: 'regional_parameter_version_basic' primary_resource_id: 'regional-parameter-version-basic' + min_version: 'beta' vars: parameter_id: 'regional_parameter' parameter_version_id: 'regional_parameter_version' - name: 'regional_parameter_version_with_json_format' primary_resource_id: 'regional-parameter-version-with-json-format' + min_version: 'beta' vars: parameter_id: 'regional_parameter' parameter_version_id: 'regional_parameter_version' @@ -47,6 +50,7 @@ examples: 'data': '"./test-fixtures/parameter_data_json_format.json"' - name: 'regional_parameter_version_with_yaml_format' primary_resource_id: 'regional-parameter-version-with-yaml-format' + min_version: 'beta' vars: parameter_id: 'regional_parameter' parameter_version_id: 'regional_parameter_version' @@ -61,6 +65,7 @@ parameters: type: ResourceRef description: | Parameter Manager Regional Parameter resource. + min_version: 'beta' url_param_only: true required: true immutable: true @@ -70,6 +75,7 @@ parameters: type: String description: | Version ID of the Regional Parameter Version Resource. This must be unique within the Regional Parameter. + min_version: 'beta' url_param_only: true required: true immutable: true @@ -77,6 +83,7 @@ parameters: type: String description: | Location of Parameter Manager Regional parameter resource. + min_version: 'beta' url_param_only: true output: true properties: @@ -85,25 +92,30 @@ properties: description: | The resource name of the Regional Parameter Version. Format: `projects/{{project}}/locations/{{location}}/parameters/{{parameter_id}}/versions/{{parameter_version_id}}` + min_version: 'beta' output: true - name: 'createTime' type: String description: | The time at which the Regional Parameter Version was created. + min_version: 'beta' output: true - name: 'updateTime' type: String description: | The time at which the Regional Parameter Version was updated. + min_version: 'beta' output: true - name: 'disabled' type: Boolean description: | The current state of Regional Parameter Version. This field is only applicable for updating Regional Parameter Version. + min_version: 'beta' - name: 'payload' type: NestedObject description: | The parameter payload of the RegionalParameterVersion. + min_version: 'beta' flatten_object: true required: true immutable: true @@ -113,6 +125,7 @@ properties: type: String description: | The Regional Parameter data. + min_version: 'beta' api_name: data required: true immutable: true diff --git a/mmv1/templates/terraform/examples/regional_parameter_version_basic.tf.tmpl b/mmv1/templates/terraform/examples/regional_parameter_version_basic.tf.tmpl index 416991a7601e..b649cc0d6dfd 100644 --- a/mmv1/templates/terraform/examples/regional_parameter_version_basic.tf.tmpl +++ b/mmv1/templates/terraform/examples/regional_parameter_version_basic.tf.tmpl @@ -1,9 +1,11 @@ resource "google_parameter_manager_regional_parameter" "regional-parameter-basic" { + provider = google-beta parameter_id = "{{index $.Vars "parameter_id"}}" location = "us-central1" } resource "google_parameter_manager_regional_parameter_version" "{{$.PrimaryResourceId}}" { + provider = google-beta parameter = google_parameter_manager_regional_parameter.regional-parameter-basic.id parameter_version_id = "{{index $.Vars "parameter_version_id"}}" parameter_data = "regional-parameter-version-data" diff --git a/mmv1/templates/terraform/examples/regional_parameter_version_with_json_format.tf.tmpl b/mmv1/templates/terraform/examples/regional_parameter_version_with_json_format.tf.tmpl index eaaac2142d3f..310f8b523a41 100644 --- a/mmv1/templates/terraform/examples/regional_parameter_version_with_json_format.tf.tmpl +++ b/mmv1/templates/terraform/examples/regional_parameter_version_with_json_format.tf.tmpl @@ -1,10 +1,12 @@ resource "google_parameter_manager_regional_parameter" "regional-parameter-basic" { + provider = google-beta parameter_id = "{{index $.Vars "parameter_id"}}" format = "JSON" location = "us-central1" } resource "google_parameter_manager_regional_parameter_version" "{{$.PrimaryResourceId}}" { + provider = google-beta parameter = google_parameter_manager_regional_parameter.regional-parameter-basic.id parameter_version_id = "{{index $.Vars "parameter_version_id"}}" parameter_data = file("{{index $.Vars "data"}}") diff --git a/mmv1/templates/terraform/examples/regional_parameter_version_with_yaml_format.tf.tmpl b/mmv1/templates/terraform/examples/regional_parameter_version_with_yaml_format.tf.tmpl index 269c9b9841c1..3afde40457a3 100644 --- a/mmv1/templates/terraform/examples/regional_parameter_version_with_yaml_format.tf.tmpl +++ b/mmv1/templates/terraform/examples/regional_parameter_version_with_yaml_format.tf.tmpl @@ -1,10 +1,12 @@ resource "google_parameter_manager_regional_parameter" "regional-parameter-basic" { + provider = google-beta parameter_id = "{{index $.Vars "parameter_id"}}" format = "YAML" location = "us-central1" } resource "google_parameter_manager_regional_parameter_version" "{{$.PrimaryResourceId}}" { + provider = google-beta parameter = google_parameter_manager_regional_parameter.regional-parameter-basic.id parameter_version_id = "{{index $.Vars "parameter_version_id"}}" parameter_data = file("{{index $.Vars "data"}}") diff --git a/mmv1/third_party/terraform/services/parametermanagerregional/resource_parameter_manager_regional_parameter_version_test.go b/mmv1/third_party/terraform/services/parametermanagerregional/resource_parameter_manager_regional_parameter_version_test.go index 06b2eb58cf38..6413f3606e8e 100644 --- a/mmv1/third_party/terraform/services/parametermanagerregional/resource_parameter_manager_regional_parameter_version_test.go +++ b/mmv1/third_party/terraform/services/parametermanagerregional/resource_parameter_manager_regional_parameter_version_test.go @@ -16,7 +16,7 @@ func TestAccParameterManagerRegionalRegionalParameterVersion_update(t *testing.T acctest.VcrTest(t, resource.TestCase{ PreCheck: func() { acctest.AccTestPreCheck(t) }, - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderBetaFactories(t), CheckDestroy: testAccCheckParameterManagerRegionalRegionalParameterVersionDestroyProducer(t), Steps: []resource.TestStep{ { @@ -53,11 +53,13 @@ func TestAccParameterManagerRegionalRegionalParameterVersion_update(t *testing.T func testAccParameterManagerRegionalRegionalParameterVersion_basic(context map[string]interface{}) string { return acctest.Nprintf(` resource "google_parameter_manager_regional_parameter" "regional-parameter-update" { + provider = google-beta parameter_id = "tf_test_regional_parameter%{random_suffix}" location = "us-central1" } resource "google_parameter_manager_regional_parameter_version" "regional-parameter-version-update" { + provider = google-beta parameter = google_parameter_manager_regional_parameter.regional-parameter-update.id parameter_version_id = "tf_test_regional_parameter_version%{random_suffix}" parameter_data = "regional-parameter-version-data" @@ -68,11 +70,13 @@ resource "google_parameter_manager_regional_parameter_version" "regional-paramet func testAccParameterManagerRegionalRegionalParameterVersion_update(context map[string]interface{}) string { return acctest.Nprintf(` resource "google_parameter_manager_regional_parameter" "regional-parameter-update" { + provider = google-beta parameter_id = "tf_test_regional_parameter%{random_suffix}" location = "us-central1" } resource "google_parameter_manager_regional_parameter_version" "regional-parameter-version-update" { + provider = google-beta parameter = google_parameter_manager_regional_parameter.regional-parameter-update.id parameter_version_id = "tf_test_regional_parameter_version%{random_suffix}" parameter_data = "regional-parameter-version-data"