From d8f5e99cb989c17597343c7c508f4e47c94b12fa Mon Sep 17 00:00:00 2001 From: Balanagu Harsha Vardhan Date: Fri, 20 Sep 2024 09:53:52 +0000 Subject: [PATCH] Adding examples for integrationconnectors endpointattachment and managedzone --- .../endpointattachment/main.tf | 9 +++ integrationconnectors/managedzone/main.tf | 55 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 integrationconnectors/endpointattachment/main.tf create mode 100644 integrationconnectors/managedzone/main.tf diff --git a/integrationconnectors/endpointattachment/main.tf b/integrationconnectors/endpointattachment/main.tf new file mode 100644 index 000000000..ef2fe4be5 --- /dev/null +++ b/integrationconnectors/endpointattachment/main.tf @@ -0,0 +1,9 @@ +resource "google_integration_connectors_endpoint_attachment" "default" { + name = "test-endpoint-attachment" + location = "us-central1" + description = "tf created description" + service_attachment = "projects/connectors-example/regions/us-central1/serviceAttachments/test" + labels = { + foo = "bar" + } +} \ No newline at end of file diff --git a/integrationconnectors/managedzone/main.tf b/integrationconnectors/managedzone/main.tf new file mode 100644 index 000000000..65f44856d --- /dev/null +++ b/integrationconnectors/managedzone/main.tf @@ -0,0 +1,55 @@ +data "google_project" "target_project" { +} + +resource "google_project_iam_member" "dns_peer_binding" { + project = google_project.target_project.project_id + role = "roles/dns.peer" + member = "serviceAccount:service-${data.google_project.test_project.number}@gcp-sa-connectors.iam.gserviceaccount.com" +} + +resource "google_project_service" "dns" { + project = google_project.target_project.project_id + service = "dns.googleapis.com" +} + +resource "google_project_service" "compute" { + project = google_project.target_project.project_id + service = "compute.googleapis.com" +} + +resource "google_compute_network" "network" { + project = google_project.target_project.project_id + name = "test" + auto_create_subnetworks = false + depends_on = [google_project_service.compute] +} + +resource "google_dns_managed_zone" "zone" { + name = "test-dns" + dns_name = "private.example.com." + visibility = "private" + + private_visibility_config { + networks { + network_url = google_compute_network.network.id + } + } + depends_on = [google_project_service.dns] +} + +data "google_project" "test_project" { +} + +# [START integrationconnectors_managed_zone_example] +resource "google_integration_connectors_managed_zone" "test_managed_zone" { + name = "test-managed-zone" + description = "tf created description" + labels = { + intent = "example" + } + target_project = google_project.target_project.project_id + target_vpc = "test" + dns = google_dns_managed_zone.zone.dns_name + depends_on = [google_project_iam_member.dns_peer_binding,google_dns_managed_zone.zone] +} +# [END integrationconnectors_managed_zone_example]