...
1/**
2 * Copyright 2022 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```hcl
18resource "google_compute_network" "default" {
19 name = "tf-test-my-network"
20}
21resource "google_compute_global_address" "service_range" {
22 name = "address"
23 purpose = "VPC_PEERING"
24 address_type = "INTERNAL"
25 prefix_length = 16
26 network = google_compute_network.default.id
27}
28resource "google_service_networking_connection" "private_service_connection" {
29 network = google_compute_network.default.id
30 service = "servicenetworking.googleapis.com"
31 reserved_peering_ranges = [google_compute_global_address.service_range.name]
32}
33
34resource "google_cloud_ids_endpoint" "example-endpoint" {
35 name = "test"
36 location = "us-central1-f"
37 network = google_compute_network.default.id
38 severity = "INFORMATIONAL"
39 depends_on = [google_service_networking_connection.private_service_connection]
40}
41```
View as plain text