Skip to content

Commit

Permalink
[vpc] Add max_nats configuration (cloudposse/terraform-aws-componen…
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuru authored Oct 13, 2024
1 parent 1b67f66 commit 86e8450
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ components:
| <a name="input_label_value_case"></a> [label\_value\_case](#input\_label\_value\_case) | Controls the letter case of ID elements (labels) as included in `id`,<br>set as tag values, and output by this module individually.<br>Does not affect values of tags passed in via the `tags` input.<br>Possible values: `lower`, `title`, `upper` and `none` (no transformation).<br>Set this to `title` and set `delimiter` to `""` to yield Pascal Case IDs.<br>Default value: `lower`. | `string` | `null` | no |
| <a name="input_labels_as_tags"></a> [labels\_as\_tags](#input\_labels\_as\_tags) | Set of labels (ID elements) to include as tags in the `tags` output.<br>Default is to include all labels.<br>Tags with empty values will not be included in the `tags` output.<br>Set to `[]` to suppress all generated tags.<br>**Notes:**<br> The value of the `name` tag, if included, will be the `id`, not the `name`.<br> Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be<br> changed in later chained modules. Attempts to change it will be silently ignored. | `set(string)` | <pre>[<br> "default"<br>]</pre> | no |
| <a name="input_map_public_ip_on_launch"></a> [map\_public\_ip\_on\_launch](#input\_map\_public\_ip\_on\_launch) | Instances launched into a public subnet should be assigned a public IP address | `bool` | `true` | no |
| <a name="input_max_nats"></a> [max\_nats](#input\_max\_nats) | Upper limit on number of NAT Gateways/Instances to create.<br>Set to 1 or 2 for cost savings at the expense of availability.<br>Default creates a NAT Gateway in each public subnet. | `number` | `null` | no |
| <a name="input_max_subnet_count"></a> [max\_subnet\_count](#input\_max\_subnet\_count) | Sets the maximum amount of subnets to deploy. 0 will deploy a subnet for every provided availability zone (in `region_availability_zones` variable) within the region | `number` | `0` | no |
| <a name="input_name"></a> [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.<br>This is the only ID element not also included as a `tag`.<br>The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no |
Expand Down
1 change: 1 addition & 0 deletions src/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ module "subnets" {
igw_id = var.public_subnets_enabled ? [module.vpc.igw_id] : []
map_public_ip_on_launch = var.map_public_ip_on_launch
max_subnet_count = local.max_subnet_count
max_nats = var.max_nats
nat_gateway_enabled = var.nat_gateway_enabled
nat_instance_enabled = var.nat_instance_enabled
nat_instance_type = var.nat_instance_type
Expand Down
10 changes: 10 additions & 0 deletions src/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ variable "public_subnets_enabled" {
default = true
}

variable "max_nats" {
type = number
description = <<-EOT
Upper limit on number of NAT Gateways/Instances to create.
Set to 1 or 2 for cost savings at the expense of availability.
Default creates a NAT Gateway in each public subnet.
EOT
default = null
}

variable "nat_gateway_enabled" {
type = bool
description = "Flag to enable/disable NAT gateways"
Expand Down

0 comments on commit 86e8450

Please sign in to comment.