File tree Expand file tree Collapse file tree 4 files changed +85
-0
lines changed Expand file tree Collapse file tree 4 files changed +85
-0
lines changed 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+ provider "google" {
18+ version = " ~> 3.45.0"
19+ }
20+
21+ provider "null" {
22+ version = " ~> 2.1"
23+ }
24+
25+ # [START routes_create]
26+ module "google_compute_route" {
27+ source = " terraform-google-modules/network/google//modules/routes"
28+ version = " ~> 3.2.0"
29+ project_id = var. project_id # Replace this with your project ID in quotes
30+ network_name = " default"
31+
32+ routes = [
33+ {
34+ name = " egress-internet"
35+ description = " route through IGW to access internet"
36+ destination_range = " 0.0.0.0/0"
37+ tags = " egress-inet"
38+ next_hop_internet = " true"
39+ }
40+ ]
41+ }
42+ # [END routes_create]
Original file line number Diff line number Diff line change 1+ output "route_name" {
2+ value = module.google_compute_route.google_compute_route.route
3+ description = "The name of the route being created"
4+ }
5+
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 "project_id" {
18+ description = " The ID of the project where the routes will be created"
19+ }
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