Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions integrationconnectors/endpointattachment/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Copyright 2024 Google LLC
*
* 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.
*/

# [START integrationconnectors_endpoint_attachment_example]
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"
}
}
# [END integrationconnectors_endpoint_attachment_example]

61 changes: 61 additions & 0 deletions integrationconnectors/managedzone/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* Copyright 2024 Google LLC
*
* 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.
*/

# This is the target project where you host the cloud DNS mapping, this can also be the current project
data "google_project" "target_project" {
}

resource "google_project_iam_member" "default" {
project = data.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_compute_network" "default" {
project = data.google_project.target_project.project_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After renaming to default, all instances of referring to google_project will need to be updated.

name = "test"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are showing that you should be creating a custom network in this example, you should suggest a better name than "test". (While this code is example code, it should have production best practices, as it is intended to be copied by users)

auto_create_subnetworks = false
}

resource "google_dns_managed_zone" "default" {
name = "test-dns"
dns_name = "private.example.com."
visibility = "private"

private_visibility_config {
networks {
network_url = google_compute_network.default.id
}
}
}

# This is the current project.
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 resource"
labels = {
intent = "example"
}
target_project = data.google_project.target_project.project_id
target_vpc = "test"
dns = google_dns_managed_zone.default.dns_name
depends_on = [google_project_iam_member.default]
}
# [END integrationconnectors_managed_zone_example]
20 changes: 20 additions & 0 deletions integrationconnectors/managedzone/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2022 Google LLC
#
# 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.

apiVersion: blueprints.cloud.google.com/v1alpha1
kind: BlueprintTest
metadata:
name: integration_connectors_add_tag
spec:
skip: true