File tree Expand file tree Collapse file tree 5 files changed +120
-0
lines changed
examples/basic_vpc_peering Expand file tree Collapse file tree 5 files changed +120
-0
lines changed Original file line number Diff line number Diff line change 1+ # VPC network peering
2+
3+ This example configures VPC network peering.
4+
5+ <!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
6+ ## Inputs
7+
8+ | Name | Description | Type | Default | Required |
9+ | ------| -------------| ------| ---------| :--------:|
10+ | local\_ network | Self link to the local network. | ` string ` | n/a | yes |
11+ | peer\_ network | Self link to the peer network. | ` string ` | n/a | yes |
12+
13+ ## Outputs
14+
15+ | Name | Description |
16+ | ------| -------------|
17+ | local\_ network | The local network peering information |
18+
19+ <!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Original file line number Diff line number Diff line change 1+ /* *
2+ * Copyright 2019 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+
18+ provider "null" {
19+ version = " ~> 2.1"
20+ }
21+
22+ provider "google" {
23+ version = " ~> 3.45.0"
24+ }
25+
26+ # [START vpc_peering_create]
27+ module "peering1" {
28+ source = " terraform-google-modules/network/google//modules/network-peering"
29+ version = " ~> 3.2.1"
30+ local_network = var. local_network # Replace with self link to VPC network "foobar" in quotes
31+ peer_network = var. peer_network # Replace with self link to VPC network "other" in quotes
32+ }
33+ # [END vpc_peering_create]
Original file line number Diff line number Diff line change 1+ /* *
2+ * Copyright 2019 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+
18+ output "local_network" {
19+ value = module. peering1 . local_network_peering
20+ description = " The local network peering information"
21+ }
22+
23+
Original file line number Diff line number Diff line change 1+ /* *
2+ * Copyright 2019 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+ variable "local_network" {
18+ description = " Self link to the local network."
19+ type = string
20+ }
21+
22+ variable "peer_network" {
23+ description = " Self link to the peer network."
24+ type = string
25+ }
26+
Original file line number Diff line number Diff line change 1+ /* *
2+ * Copyright 2019 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+ terraform {
18+ required_version = " >=0.12.6"
19+ }
You can’t perform that action at this time.
0 commit comments