File tree Expand file tree Collapse file tree 8 files changed +20
-69
lines changed
examples/existing-project Expand file tree Collapse file tree 8 files changed +20
-69
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ No requirements.
8181
8282| Name | Source | Version |
8383| ------| --------| ---------|
84- | <a name =" module_cloud_nat " ></a > [ cloud\_ nat] ( #module\_ cloud\_ nat ) | ./ modules/cloud-nat | n/a |
84+ | <a name =" module_cloud_nat " ></a > [ cloud\_ nat] ( #module\_ cloud\_ nat ) | registry.terraform.io/terraform-google- modules/cloud-nat/google | 5.1.0 |
8585| <a name =" module_network " ></a > [ network] ( #module\_ network ) | registry.terraform.io/terraform-google-modules/network/google | 9.1.0 |
8686| <a name =" module_project " ></a > [ project] ( #module\_ project ) | registry.terraform.io/terraform-google-modules/project-factory/google | 15.0.1 |
8787| <a name =" module_project_services " ></a > [ project\_ services] ( #module\_ project\_ services ) | terraform-google-modules/project-factory/google//modules/project_services | 15.0.1 |
@@ -92,6 +92,7 @@ No requirements.
9292| ------| ------|
9393| [ google-beta_google_container_node_pool.pools] ( https://registry.terraform.io/providers/hashicorp/google-beta/latest/docs/resources/google_container_node_pool ) | resource |
9494| [ google_artifact_registry_repository.my-repo] ( https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/artifact_registry_repository ) | resource |
95+ | [ google_compute_address.cloud_nat_address] ( https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_address ) | resource |
9596| [ google_container_cluster.gke] ( https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster ) | resource |
9697
9798## Inputs
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ module "gke" {
1010 regional = false
1111 zones = [" europe-central2-a" ]
1212 cluster_deletion_protection = false
13- enable_private_nodes = true
1413 node_pools = {
1514 default-pool = {
1615 disk_size_gb = 50
Original file line number Diff line number Diff line change @@ -48,14 +48,24 @@ module "network" {
4848 }
4949}
5050
51+ resource "google_compute_address" "cloud_nat_address" {
52+ name = local. cloud_nat_name
53+ project = local. project_id
54+ region = var. region
55+ count = var. enable_private_nodes ? 1 : 0
56+ }
57+
5158module "cloud_nat" {
52- source = " ./modules/cloud-nat"
53- project_id = local. project_id
54- region = var. region
55- network = module. network . network_name
56- router = local. router
57- name = local. cloud_nat_name
58- count = var. enable_private_nodes ? 1 : 0
59+ source = " registry.terraform.io/terraform-google-modules/cloud-nat/google"
60+ version = " 5.1.0"
61+ project_id = local. project_id
62+ region = var. region
63+ network = module. network . network_name
64+ create_router = true
65+ router = local. router
66+ name = local. cloud_nat_name
67+ nat_ips = [google_compute_address . cloud_nat_address . 0 . self_link ]
68+ count = var. enable_private_nodes ? 1 : 0
5969}
6070
6171resource "google_container_cluster" "gke" {
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ output "gke_zones" {
4343 description = " List of zones where the cluster lives"
4444}
4545output "nat_ip" {
46- value = module . cloud_nat . * . cloud_nat_ip
46+ value = google_compute_address . cloud_nat_address . * . address
4747 description = " The IP address allocated for NAT"
4848}
4949output "subnetwork_name" {
You can’t perform that action at this time.
0 commit comments