Skip to content

Commit

Permalink
Revise variable descriptions and IP range suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
syedrakib committed Jan 11, 2021
1 parent 7917f40 commit 6f90e27
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ variable "name_suffix" {
}

variable "ip_ranges" {
description = "A map of IP CIDR ranges (including their /x parts) that should be used by the public/private subnets for the various components of the infrastructure. See comments in source code for elaboration on accepted keys. Can use an IP calculator (like https://www.calculator.net/ip-subnet-calculator.html) for help with calculating subnets & IP ranges."
description = "A map of IP CIDR ranges (including their /x parts) that should be used by the public/private subnets for the various components of the infrastructure. See comments in source code for elaboration on accepted keys and suggested IP CIDR ranges. Can use an IP calculator (like https://www.calculator.net/ip-subnet-calculator.html) for help with calculating subnets & IP ranges."
type = object({
public = list(string) # list of CIDR ranges - each with their /x parts (/24 advised) for public subnets of the VPC.
private_primary = string # a CIDR range including /x part (/24 advised) for primary IPs in private subnet of the VPC.
private_k8s = list(object({ pods = string, svcs = string })) # list of objects of CIDR ranges - each with their /x parts (/24 advised) - for pods & services in a k8s cluster.
public = list(string) # list of CIDR ranges - each with their /x parts (/20 advised) for public subnets of the VPC.
private_primary = string # a CIDR range including /x part (/20 advised) for primary IPs in private subnet of the VPC.
private_k8s = list(object({ pods = string, svcs = string })) # list of objects of CIDR ranges - each with their /x parts (/20 advised) - for pods & services in a k8s cluster.
private_redis = list(string) # list of CIDR ranges - each with their /x parts (/29 advised) - for Redis. See https://www.terraform.io/docs/providers/google/r/redis_instance.html#reserved_ip_range
private_g_services = string # a CIDR range including /x part (/20 advised) for Google services producers (like CloudSQL, Firebase, etc) in private subnet of the VPC.
proxy_only = string # an empty string or a CIDR range including /x part (/24 advised) for Proxy-Only subnet. Use empty string "" to avoid creating Proxy-Only subnet. See https://cloud.google.com/load-balancing/docs/l7-internal/proxy-only-subnets#proxy_only_subnet_create
Expand Down Expand Up @@ -77,7 +77,7 @@ variable "name_static_nat_ips" {
}

variable "nat_min_ports_per_vm" {
description = "Minimum number of ports allocated to a VM from the NAT. https://cloud.google.com/nat/docs/ports-and-addresses#ports-and-connections. The number of NAT source IP address and source port tuples that a Cloud NAT gateway reserves for a VM limits the number of connections that the VM can make to a unique destination. https://cloud.google.com/nat/docs/ports-and-addresses#port-reservation-examples. Each nat ip supports 65536 ports. If min ip per vm is 2048, then total number of vms that can be attached to the nat is (nat static ip count) * 65566 / 2048 = 32."
description = "Minimum number of ports reserved by the Cloud NAT for each VM. The number of ports that a Cloud NAT reserves for each VM limits the number of concurrent connections that the VM can make to a specific destination (https://cloud.google.com/nat/docs/ports-and-addresses#ports-and-connections). Each NAT IP supports upto 64,512 ports (65,536 minus 1,024 - https://cloud.google.com/nat/docs/ports-and-addresses#ports). If var.num_of_static_nat_ips is 1 and var.nat_min_ports_per_vm is 64, then the total number of VMs that can be serviced by that Cloud NAT is (1 * 64512 / 64) = 1008 VMs. https://cloud.google.com/nat/docs/ports-and-addresses#port-reservation-examples. As the total number of serviceable VMs increases, the total number of concurrent connections spawnable by a VM decreases. 64 is the default value provided by Google."
type = number
default = 64
}
Expand Down

0 comments on commit 6f90e27

Please sign in to comment.