Skip to content

Commit 3346881

Browse files
Adding examples for integrationconnectors endpointattachment and managedzone (terraform-google-modules#751)
Co-authored-by: Katie McLaughlin <[email protected]>
1 parent 91eb5b9 commit 3346881

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
# [START integrationconnectors_endpoint_attachment_example]
18+
resource "google_integration_connectors_endpoint_attachment" "default" {
19+
name = "test-endpoint-attachment"
20+
location = "us-central1"
21+
description = "tf created description"
22+
service_attachment = "projects/connectors-example/regions/us-central1/serviceAttachments/test"
23+
labels = {
24+
foo = "bar"
25+
}
26+
}
27+
# [END integrationconnectors_endpoint_attachment_example]
28+
+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
# This is the target project where you host the cloud DNS mapping, this can also be the current project
18+
data "google_project" "target_project" {
19+
}
20+
21+
resource "google_project_iam_member" "default" {
22+
project = data.google_project.target_project.project_id
23+
role = "roles/dns.peer"
24+
member = "serviceAccount:service-${data.google_project.test_project.number}@gcp-sa-connectors.iam.gserviceaccount.com"
25+
}
26+
27+
resource "google_compute_network" "default" {
28+
project = data.google_project.target_project.project_id
29+
name = "test"
30+
auto_create_subnetworks = false
31+
}
32+
33+
resource "google_dns_managed_zone" "default" {
34+
name = "test-dns"
35+
dns_name = "private.example.com."
36+
visibility = "private"
37+
38+
private_visibility_config {
39+
networks {
40+
network_url = google_compute_network.default.id
41+
}
42+
}
43+
}
44+
45+
# This is the current project.
46+
data "google_project" "test_project" {
47+
}
48+
49+
# [START integrationconnectors_managed_zone_example]
50+
resource "google_integration_connectors_managed_zone" "test_managed_zone" {
51+
name = "test-managed-zone"
52+
description = "tf created resource"
53+
labels = {
54+
intent = "example"
55+
}
56+
target_project = data.google_project.target_project.project_id
57+
target_vpc = "test"
58+
dns = google_dns_managed_zone.default.dns_name
59+
depends_on = [google_project_iam_member.default]
60+
}
61+
# [END integrationconnectors_managed_zone_example]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: blueprints.cloud.google.com/v1alpha1
16+
kind: BlueprintTest
17+
metadata:
18+
name: integration_connectors_add_tag
19+
spec:
20+
skip: true

0 commit comments

Comments
 (0)