From 71839f8e2b6b3b83dcd510efb221ecd4baaa567e Mon Sep 17 00:00:00 2001 From: badra001 Date: Mon, 25 Oct 2021 11:34:51 -0400 Subject: [PATCH] fix --- custom/README.md | 6 +++--- custom/ports.tf | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/custom/README.md b/custom/README.md index 609dea7..14241a5 100644 --- a/custom/README.md +++ b/custom/README.md @@ -102,10 +102,10 @@ No modules. | [enable\_self](#input\_enable\_self) | Enable\|Disable self full access | `bool` | `false` | no | | [ingress\_networks](#input\_ingress\_networks) | List of ingress networks for access (with all pre-defined ingress ports) | `list(string)` | `[]` | no | | [ingress\_port\_list](#input\_ingress\_port\_list) | Ingress port list of 5-tuple: from, to, proto, description, and cidr(list) | `list` |
[
[]
]
| no | -| [ingress\_port\_map](#input\_ingress\_port\_map) | Ingress port list of objects: from, to, proto, description and cidr(list) |
list(object({
from = number
to = number
proto = any
description = string
cidr = list(string)
}))
|
[
{}
]
| no | +| [ingress\_port\_map](#input\_ingress\_port\_map) | Ingress port list of objects: from, to, proto, description and cidr(list) |
list(object({
from = number
to = number
proto = any
description = string
cidr = list(string)
}))
| `[]` | no | | [ingress\_security\_groups](#input\_ingress\_security\_groups) | List of ingress security groups for all ports | `list(string)` | `[]` | no | -| [ingress\_self\_port\_list](#input\_ingress\_self\_port\_list) | Ingress port list of 4-tuple: from, to, proto, description | `list` |
[
[
0,
0,
-1,
"all"
]
]
| no | -| [ingress\_self\_port\_map](#input\_ingress\_self\_port\_map) | Ingress self access port list of objects: from, to, proto, description |
list(object({
from = number
to = number
proto = any
description = string
}))
|
[
{}
]
| no | +| [ingress\_self\_port\_list](#input\_ingress\_self\_port\_list) | Ingress port list of 4-tuple: from, to, proto, description | `list` |
[
[]
]
| no | +| [ingress\_self\_port\_map](#input\_ingress\_self\_port\_map) | Ingress self access port list of objects: from, to, proto, description |
list(object({
from = number
to = number
proto = any
description = string
}))
| `[]` | no | | [name](#input\_name) | Security Group Name (required) | `string` | n/a | yes | | [short\_description](#input\_short\_description) | Security Group Short Description | `string` | `""` | no | | [tags](#input\_tags) | Extra security group tags | `map` | `{}` | no | diff --git a/custom/ports.tf b/custom/ports.tf index 7a72c3f..7c53124 100644 --- a/custom/ports.tf +++ b/custom/ports.tf @@ -9,8 +9,9 @@ locals { p_fields = ["from", "to", "proto", "description", "cidr"] # p_map = length(var.ingress_port_list) > 0 ? [for p in local.ports : zipmap(local.p_fields, p)] : var.ingress_port_map - p_map = length(var.ingress_port_list) > 0 ? [for p in flatten(compact(concat(local.ports, var.ingress_port_list))) : zipmap(local.p_fields, p)] : [for p in local.ports : zipmap(local.p_fields, p)] - port_map = { "external" = compact(concat(local.p_map, var.ingress_port_map)) } + port_source = length(var.ingress_port_list) > 0 ? var.ingress_port_list : local.ports + p_map = [for p in local.port_source : zipmap(local.p_fields, p)] + port_map = { "external" = compact(concat(local.p_map, var.ingress_port_map)) } p_self_fields = ["from", "to", "proto", "description"] self_port_list = length(var.ingress_self_port_list) > 0 ? [for p in var.ingress_self_port_list : zipmap(local.p_self_fields, p)] : local._defaults["self_port_list"]