Skip to content

Commit

Permalink
chore: Route example for docs (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
betsy-lichtenberg authored Apr 7, 2021
1 parent 5b00673 commit 1bef932
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
42 changes: 42 additions & 0 deletions examples/routes/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* Copyright 2019 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.
*/

provider "google" {
version = "~> 3.45.0"
}

provider "null" {
version = "~> 2.1"
}

# [START routes_create]
module "google_compute_route" {
source = "terraform-google-modules/network/google//modules/routes"
version = "~> 3.2.0"
project_id = var.project_id # Replace this with your project ID in quotes
network_name = "default"

routes = [
{
name = "egress-internet"
description = "route through IGW to access internet"
destination_range = "0.0.0.0/0"
tags = "egress-inet"
next_hop_internet = "true"
}
]
}
# [END routes_create]
5 changes: 5 additions & 0 deletions examples/routes/outputs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
output "route_name" {
value = module.google_compute_route.google_compute_route.route
description = "The name of the route being created"
}

19 changes: 19 additions & 0 deletions examples/routes/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright 2019 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.
*/

variable "project_id" {
description = "The ID of the project where the routes will be created"
}
19 changes: 19 additions & 0 deletions examples/routes/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright 2019 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.
*/

terraform {
required_version = ">=0.12.6"
}

0 comments on commit 1bef932

Please sign in to comment.