From 6341b0ef352adf6e5e6039044d4606de715e1292 Mon Sep 17 00:00:00 2001 From: Chris Stephens Date: Wed, 5 Apr 2023 09:48:43 -0700 Subject: [PATCH] Fix bug with importing bq capacity commitments (#7621) --- mmv1/products/bigqueryreservation/CapacityCommitment.yaml | 8 +++----- .../bigquery_reservation_capacity_commitment_basic.tf.erb | 2 ++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mmv1/products/bigqueryreservation/CapacityCommitment.yaml b/mmv1/products/bigqueryreservation/CapacityCommitment.yaml index 3853f68eb7e2..1d41d4b29e74 100644 --- a/mmv1/products/bigqueryreservation/CapacityCommitment.yaml +++ b/mmv1/products/bigqueryreservation/CapacityCommitment.yaml @@ -15,7 +15,7 @@ name: 'CapacityCommitment' base_url: projects/{{project}}/locations/{{location}}/capacityCommitments create_url: projects/{{project}}/locations/{{location}}/capacityCommitments?capacityCommitmentId={{capacity_commitment_id}} -self_link: "{{name}}" +self_link: "projects/{{project}}/locations/{{location}}/capacityCommitments/{{capacity_commitment_id}}" update_verb: :PATCH update_mask: true description: | @@ -26,8 +26,8 @@ references: !ruby/object:Api::Resource::ReferenceLinks guides: "Introduction to Reservations": "https://cloud.google.com/bigquery/docs/reservations-intro" api: "https://cloud.google.com/bigquery/docs/reference/reservations/rest/v1/projects.locations.capacityCommitments" -id_format: "{{name}}" -import_format: ["{{name}}"] +id_format: "projects/{{project}}/locations/{{location}}/capacityCommitments/{{capacity_commitment_id}}" +import_format: ["projects/{{project}}/locations/{{location}}/capacityCommitments/{{capacity_commitment_id}}"] examples: - !ruby/object:Provider::Terraform::Examples name: "bigquery_reservation_capacity_commitment_basic" @@ -37,8 +37,6 @@ examples: - !ruby/object:Provider::Terraform::Examples name: "bigquery_reservation_capacity_commitment_docs" skip_test: true -custom_code: !ruby/object:Provider::Terraform::CustomCode - custom_import: templates/terraform/custom_import/self_link_as_name.erb parameters: - !ruby/object:Api::Type::String name: 'capacityCommitmentId' diff --git a/mmv1/templates/terraform/examples/bigquery_reservation_capacity_commitment_basic.tf.erb b/mmv1/templates/terraform/examples/bigquery_reservation_capacity_commitment_basic.tf.erb index a08fcdddd8d3..af222adc2ced 100644 --- a/mmv1/templates/terraform/examples/bigquery_reservation_capacity_commitment_basic.tf.erb +++ b/mmv1/templates/terraform/examples/bigquery_reservation_capacity_commitment_basic.tf.erb @@ -1,4 +1,6 @@ resource "google_bigquery_capacity_commitment" "<%= ctx[:primary_resource_id] %>" { + capacity_commitment_id = "capacity-tf-test%{random_suffix}" + location = "us-west2" slot_count = 100 plan = "FLEX_FLAT_RATE"