Skip to content

Commit 790213e

Browse files
chore: Update NAT example (#24)
1 parent 2154aee commit 790213e

File tree

4 files changed

+71
-5
lines changed

4 files changed

+71
-5
lines changed

examples/nat/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Simple Cloud Router
2+
3+
This example configures a Cloud Router and a NAT gateway with default values
4+
inside of a project.
5+
6+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
7+
## Inputs
8+
9+
| Name | Description | Type | Default | Required |
10+
|------|-------------|------|---------|:--------:|
11+
| project\_id | The project ID to host the Cloud Router in | `any` | n/a | yes |
12+
13+
## Outputs
14+
15+
| Name | Description |
16+
|------|-------------|
17+
| router\_name | The name of the created router |
18+
| router\_region | The region of the created router |
19+
20+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
21+
22+

examples/nat/main.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ provider "google" {
1919
}
2020

2121
module "cloud_router" {
22-
source = "../../"
23-
24-
name = "example-router"
25-
project = "example-project"
22+
source = "terraform-google-modules/cloud-router/google"
23+
version = "~> 0.4"
24+
project = var.project_id # Replace this with your project ID in quotes
25+
name = "my-cloud-router"
2626
network = "default"
2727
region = "us-central1"
2828

2929
nats = [{
30-
name = "example-nat"
30+
name = "my-nat-gateway"
3131
}]
3232
}

examples/nat/outputs.tf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Copyright 2020 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+
output "router_name" {
18+
value = module.cloud_router.router.name
19+
description = "The name of the created router"
20+
}
21+
22+
output "router_region" {
23+
value = module.cloud_router.router.region
24+
description = "The region of the created router"
25+
}

examples/nat/variables.tf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 project ID to host the Cloud Router in"
19+
}

0 commit comments

Comments
 (0)