From 06bed40fb078fbba18c33c615260246aa5ed06ea Mon Sep 17 00:00:00 2001 From: badra001 Date: Mon, 10 Apr 2023 13:10:56 -0400 Subject: [PATCH] fix --- subnets/README.md | 4 ++-- subnets/main.tf | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/subnets/README.md b/subnets/README.md index 8e8b339..d96d8e3 100644 --- a/subnets/README.md +++ b/subnets/README.md @@ -98,8 +98,8 @@ No modules. | [account\_id](#input\_account\_id) | AWS Account ID (default: will pull from current user) | `string` | `""` | no | | [availability\_zones](#input\_availability\_zones) | AWS Availability Zones to use (by default will use all available) | `list(string)` | `[]` | no | | [override\_prefixes](#input\_override\_prefixes) | Override built-in prefixes by component. This should be used primarily for common infrastructure things | `map(string)` | `{}` | no | -| [private\_subnets](#input\_private\_subnets) | List of objects with private subnet information to be created |
list(object({
base_cidr = string
label = string
bits = number
offset = optional(number, 0)
private = bool
tags = map(string)
enabled = optional(bool, true)
availability_zone = optional(string)
availability_zones = optional(list(string))
# subnets = list(string)
# labels = list(string)
}))
| `[]` | no | -| [public\_subnets](#input\_public\_subnets) | List of objects with public subnet information to be created |
list(object({
base_cidr = string
label = string
bits = number
offset = optional(number, 0)
private = bool
tags = map(string)
enabled = optional(bool, true)
availability_zone = optional(string)
availability_zones = optional(list(string))
# subnets = list(string)
# labels = list(string)
}))
| `[]` | no | +| [private\_subnets](#input\_private\_subnets) | List of objects with private subnet information to be created |
list(object({
base_cidr = string
label = string
bits = number
offset = optional(number, 0)
private = bool
tags = map(string)
enabled = optional(bool, true)
availability_zone = optional(string)
availability_zones = optional(list(string), [])
# subnets = list(string)
# labels = list(string)
}))
| `[]` | no | +| [public\_subnets](#input\_public\_subnets) | List of objects with public subnet information to be created |
list(object({
base_cidr = string
label = string
bits = number
offset = optional(number, 0)
private = bool
tags = map(string)
enabled = optional(bool, true)
availability_zone = optional(string)
availability_zones = optional(list(string), [])
# subnets = list(string)
# labels = list(string)
}))
| `[]` | no | | [tags](#input\_tags) | AWS Tags to apply to appropriate resources (S3, KMS). Do not include safeguard tags here, use the data\_safeguard field for such things. | `map(string)` | `{}` | no | | [vpc\_environment](#input\_vpc\_environment) | VPC environment purpose (infrastructure, common, shared, dev, stage, ite, prod) | `string` | `null` | no | | [vpc\_full\_name](#input\_vpc\_full\_name) | VPC full name component (vpc{index}-{vpc\_name}) | `string` | `null` | no | diff --git a/subnets/main.tf b/subnets/main.tf index 143053b..89a10b8 100644 --- a/subnets/main.tf +++ b/subnets/main.tf @@ -84,6 +84,7 @@ locals { label = v.label bits = v.bits private = v.private + offset = v.offset # subnets = [for i in local.az_count_list : cidrsubnet(v.base_cidr, v.bits, v.offset + i)] # labels = [for az in local.availability_zones : format("%v-%v", v.label, az)] availability_zones = length(lookup(v, "availability_zones", [])) != 0 ? lookup(v, "availability_zones") : local.availability_zones @@ -129,6 +130,7 @@ locals { label = v.label bits = v.bits private = v.private + offset = v.offset # subnets = [for i in local.az_count_list : cidrsubnet(v.base_cidr, v.bits, v.offset + i)] # labels = [for az in local.availability_zones : format("%v-%v", v.label, az)] availability_zones = length(lookup(v, "availability_zones", [])) != 0 ? lookup(v, "availability_zones") : local.availability_zones