diff --git a/mmv1/products/integrationconnectors/ManazedZone.yaml b/mmv1/products/integrationconnectors/ManazedZone.yaml new file mode 100644 index 000000000000..c68a61ce3d82 --- /dev/null +++ b/mmv1/products/integrationconnectors/ManazedZone.yaml @@ -0,0 +1,105 @@ +# Copyright 2023 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. + +--- +!ruby/object:Api::Resource +name: "ManagedZone" +description: | + An Integration connectors Managed Zone. +references: !ruby/object:Api::Resource::ReferenceLinks + guides: + "Official Documentation": "https://cloud.google.com/integration-connectors/docs/create-endpoint-attachment#create-ep-hostname" + api: "https://cloud.google.com/integration-connectors/docs/reference/rest/v1/projects.locations.global.managedZones" +base_url: projects/{{project}}/locations/global/managedZones +self_link: projects/{{project}}/locations/global/managedZones/{{name}} +timeouts: !ruby/object:Api::Timeouts + insert_minutes: 5 + update_minutes: 5 + delete_minutes: 5 +create_url: projects/{{project}}/locations/global/managedZones?managedZoneId={{name}} +update_verb: :PATCH +update_mask: true +autogen_async: true +examples: + - !ruby/object:Provider::Terraform::Examples + name: "integration_connectors_managed_zone" + primary_resource_id: "samplemanagedzone" + vars: + managed_zone_name: "test-managed-zone" +async: !ruby/object:Api::OpAsync + operation: !ruby/object:Api::OpAsync::Operation + path: "name" + base_url: "{{op_id}}" + wait_ms: 1000 + timeouts: !ruby/object:Api::Timeouts + insert_minutes: 5 + update_minutes: 5 + delete_minutes: 5 + result: !ruby/object:Api::OpAsync::Result + path: "response" + resource_inside_response: true + status: !ruby/object:Api::OpAsync::Status + path: "done" + complete: true + allowed: + - "true" + - "false" + error: !ruby/object:Api::OpAsync::Error + path: "error" + message: "message" + +parameters: + - !ruby/object:Api::Type::String + name: "name" + required: true + immutable: true + url_param_only: true + description: | + Name of Managed Zone needs to be created. + +properties: + - !ruby/object:Api::Type::Time + name: "createTime" + description: | + Time the Namespace was created in UTC. + output: true + - !ruby/object:Api::Type::Time + name: "updateTime" + description: | + Time the Namespace was updated in UTC. + output: true + - !ruby/object:Api::Type::String + name: "description" + description: | + Description of the resource. + - !ruby/object:Api::Type::KeyValueLabels + name: "labels" + description: | + Resource labels to represent user provided metadata. + - !ruby/object:Api::Type::String + name: "dns" + required: true + immutable: true + description: | + DNS Name of the resource. + - !ruby/object:Api::Type::String + name: "targetProject" + required: true + description: | + The name of the Target Project. + - !ruby/object:Api::Type::String + name: "targetVpc" + required: true + description: | + The name of the Target Project VPC Network. diff --git a/mmv1/templates/terraform/examples/integration_connectors_managed_zone.tf.erb b/mmv1/templates/terraform/examples/integration_connectors_managed_zone.tf.erb new file mode 100644 index 000000000000..3b69e4452afd --- /dev/null +++ b/mmv1/templates/terraform/examples/integration_connectors_managed_zone.tf.erb @@ -0,0 +1,13 @@ +data "google_project" "test_project" { +} + +resource "google_integration_connectors_managed_zone" "<%= ctx[:primary_resource_id] %>" { + name = "<%= ctx[:vars]['managed_zone_name'] %>" + description = "tf created description" + labels = { + intent = "example" + } + target_project="connectors-example" + target_vpc="default" + dns="connectors.example.com." +} diff --git a/mmv1/third_party/terraform/services/integrationconnectors/resource_integration_connectors_managed_zone_test.go b/mmv1/third_party/terraform/services/integrationconnectors/resource_integration_connectors_managed_zone_test.go new file mode 100644 index 000000000000..cbe48abdcde4 --- /dev/null +++ b/mmv1/third_party/terraform/services/integrationconnectors/resource_integration_connectors_managed_zone_test.go @@ -0,0 +1,79 @@ +package integrationconnectors_test + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + "github.com/hashicorp/terraform-provider-google/google/acctest" +) + +func TestAccIntegrationConnectorsManagedZone_integrationConnectorsManagedZoneExample_update(t *testing.T) { + t.Parallel() + + context := map[string]interface{}{ + "random_suffix": acctest.RandString(t, 10), + } + + acctest.VcrTest(t, resource.TestCase{ + PreCheck: func() { acctest.AccTestPreCheck(t) }, + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), + CheckDestroy: testAccCheckIntegrationConnectorsManagedZoneDestroyProducer(t), + Steps: []resource.TestStep{ + { + Config: testAccIntegrationConnectorsManagedZone_integrationConnectorsManagedZoneExample_full(context), + }, + { + ResourceName: "google_integration_connectors_managed_zone.samplemanagedzone", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"name", "labels", "terraform_labels"}, + }, + { + Config: testAccIntegrationConnectorsManagedZone_integrationConnectorsManagedZoneExample_update(context), + }, + { + ResourceName: "google_integration_connectors_managed_zone.samplemanagedzone", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"name", "labels", "terraform_labels"}, + }, + }, + }) +} + +func testAccIntegrationConnectorsManagedZone_integrationConnectorsManagedZoneExample_full(context map[string]interface{}) string { + return acctest.Nprintf(` +data "google_project" "test_project" { +} + +resource "google_integration_connectors_managed_zone" "samplemanagedzone" { + name = "tf-test-test-managed-zone%{random_suffix}" + description = "tf created description" + labels = { + intent = "example" + } + target_project="connectors-example" + target_vpc="default" + dns="connectors.example.com." +} +`, context) +} + +func testAccIntegrationConnectorsManagedZone_integrationConnectorsManagedZoneExample_update(context map[string]interface{}) string { + return acctest.Nprintf(` +data "google_project" "test_project" { +} + +resource "google_integration_connectors_managed_zone" "samplemanagedzone" { + name = "tf-test-test-managed-zone%{random_suffix}" + description = "tf created description" + labels = { + example = "sample" + } + target_project="connectors-ip-test" + target_vpc="cp-ga-bug-bash" + dns="connectors-new.example.com." +} +`, context) +}