Skip to content
This repository was archived by the owner on Dec 10, 2021. It is now read-only.

Commit 6ddb6aa

Browse files
authored
Merge pull request #116 from zefdelgadillo/migration-guide
Add deprecation notice and migration guide
2 parents 8ba33a5 + 7959f66 commit 6ddb6aa

File tree

2 files changed

+48
-6
lines changed

2 files changed

+48
-6
lines changed

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
# NAT Gateway Terraform Module
22

3-
## NOTE: This module is no longer maintained. Please use [Cloud NAT](https://github.com/terraform-google-modules/terraform-google-cloud-nat) instead.
4-
5-
Modular NAT Gateway on Google Compute Engine for Terraform.
6-
7-
<a href="https://concourse-tf.gcp.solutions/teams/main/pipelines/tf-nat-gw-regression" target="_blank">
8-
<img src="https://concourse-tf.gcp.solutions/api/v1/teams/main/pipelines/tf-nat-gw-regression/badge" /></a>
3+
## Deprecation Notice
4+
**NOTE: This module is no longer maintained.** Please use [Cloud NAT](https://github.com/terraform-google-modules/terraform-google-cloud-nat) instead. For information on how to migrate to the Cloud NAT module, refer to the [migration guide](./docs/cloud-nat-migration-guide.md).
95

106
## Usage
117

docs/cloud-nat-migration-guide.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# NAT Gateway to Cloud NAT Migration Guide
2+
This guide explains how to migrate from an instance-based NAT gateway to the managed [Cloud NAT](https://cloud.google.com/nat/docs/overview) resource. For more information see the following [documentation](https://cloud.google.com/vpc/docs/special-configurations#migrate-nat).
3+
4+
## Configure a Cloud NAT
5+
In the same region your instance-based NAT gateway is located, configure a Cloud NAT resource.
6+
7+
### Using Console or API
8+
Use [these instructions](https://cloud.google.com/nat/docs/using-nat) to configure a Cloud NAT in the same region as your instance-based NAT gateway.
9+
10+
### Using [Cloud NAT Terraform Module](https://github.com/terraform-google-modules/terraform-google-cloud-nat)
11+
_The instructions below are intended for Terraform 0.12. We recommend [upgrading your resources](https://www.terraform.io/upgrade-guides/0-12.html) to Terraform 0.12, but if you need a Terraform 0.11.x-compatible version of Cloud NAT, use version [0.1.0](https://registry.terraform.io/modules/terraform-google-modules/cloud-nat/google/0.1.0) of [terraform-google-cloud-nat](https://github.com/terraform-google-modules/terraform-google-cloud-nat)._
12+
13+
Create a Cloud NAT resource in your region. If you do not have a Cloud Router, create one using the `google_compute_router` resource.
14+
```hcl
15+
resource "google_compute_router" "router" {
16+
name = "load-balancer-module-router"
17+
region = var.region
18+
network = var.network
19+
}
20+
21+
module "cloud_nat" {
22+
source = "terraform-google-modules/cloud-nat/google"
23+
version = "~> 1.0.0"
24+
project_id = var.project_id
25+
region = var.region
26+
name = "load-balancer-module-nat"
27+
router = google_compute_router.router.name
28+
}
29+
```
30+
31+
## Remove static routes
32+
Delete the [static routes](https://cloud.google.com/vpc/docs/using-routes#deletingaroute) that are sending traffic to the instanced-based NAT gateway.
33+
34+
* If created via NAT gateway module, routes will be named `[prefix]nat-[zone]`
35+
* If created via console or API, routes [may be called](https://cloud.google.com/vpc/docs/special-configurations#natgateway): `no-ip-internet-route`, `natroute1`, `natroute2`, `natroute3`
36+
37+
Once removed, confirm that traffic is flowing through Cloud NAT from an instance in your network.
38+
39+
## Remove NAT gateway
40+
Delete your NAT gateway instance(s).
41+
42+
* If created via NAT gateway module, remove the instance of the module from Terraform and re-apply
43+
* If created via console or API, delete your instance-based NAT gateways
44+
45+
## Note for users of squid proxy functionality in NAT gateway
46+
Cloud NAT does not support squid or network proxy functionality. To use a squid proxy, see the following [documentation](https://cloud.google.com/vpc/docs/special-configurations#proxyvm).

0 commit comments

Comments
 (0)