diff --git a/README.md b/README.md index 2bbeb3b..02feacb 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ module "nxos_ospf" { |------|-------------|------|---------|:--------:| | [device](#input\_device) | A device name from the provider configuration. | `string` | `null` | no | | [name](#input\_name) | OSPF Process Name. | `string` | n/a | yes | -| [vrfs](#input\_vrfs) | OSPF VRF list.
Default value `admin_state`: `true`.
Default value `bandwidth_reference`: `40000`.
Choices `banwidth_reference_unit`: `mbps`, `gbps`. Default value `banwidth_reference_unit`: `mbps`.
Default value `distance`: `110`.
List `areas`:
Allowed formats `area`: `0.0.0.10`. Default value `area`: `0.0.0.0`.
Choices `authentication_type`: `unspecified`, `simple`, `md5`, `none`. Default value `authentication_type`: `unspecified`.
Default value `cost`: `110`.
List `interfaces`:
Default value `advertise_secondaries`: `true`.
Allowed formats `area`: `0.0.0.10`. Default value `area`: `0.0.0.0`.
Default value `advertise_secondaries`: `true`.
Choices `bfd`: `unspecified`, `enabled`, `disabled`. Default value `bfd`: `unspecified`.
Default value `cost`: `0`.
Default value `dead_interval`: `0`.
Default value `hello_interval`: `10`.
Choices `network_type`: `unspecified`, `p2p`, `bcast`. Default value `network_type`: `unspecified`.
Choices `passive`: `unspecified`, `enabled`, `disabled`. Default value `passive`: `unspecified`.
Default value `priority`: `1`.
Allowed formats `authentication_key`: '0 ', '3 <3DES-format-encrypted-key>', '7 '. Default value `area`: `0.0.0.0`.
Default value `authentication_key_id`: `0`.
Default value `authentication_key_secure_mode`: `false`.
Default value `authentication_md5_key_secure_mode`: `false`.
Choices `authentication_type`: `unspecified`, `simple`, `md5`, `none`. Default value `authentication_type`: `unspecified`. |
list(object({
vrf = string
admin_state = optional(bool, true)
bandwidth_reference = optional(number, 40000)
banwidth_reference_unit = optional(string, "mbps")
distance = optional(number, 110)
router_id = optional(string, "0.0.0.0")
# adjancency_logging_level = optional(string)
areas = optional(list(object({
area = string
authentication_type = optional(string, "unspecified")
cost = optional(number, 1)
type = optional(string, "regular")
})))
interfaces = optional(list(object({
interface = string
advertise_secondaries = optional(bool, true)
area = optional(string, "0.0.0.0")
bfd = optional(string, "unspecified")
cost = optional(number, 0)
dead_interval = optional(number, 0)
hello_interval = optional(number, 10)
network_type = optional(string, "unspecified")
passive = optional(string, "unspecified")
priority = optional(number, 1)
authentication_key = optional(string)
authentication_key_id = optional(number, 0)
authentication_key_secure_mode = optional(bool, false)
authentication_keychain = optional(string)
authentication_md5_key = optional(string)
authentication_md5_key_secure_mode = optional(bool, false)
authentication_type = optional(string)
})))
}))
| `[]` | no | +| [vrfs](#input\_vrfs) | OSPF VRF list.
Default value `admin_state`: `true`.
Default value `bandwidth_reference`: `40000`.
Choices `bandwidth_reference_unit`: `mbps`, `gbps`. Default value `bandwidth_reference_unit`: `mbps`.
Default value `distance`: `110`.
List `areas`:
Allowed formats `area`: `0.0.0.10`. Default value `area`: `0.0.0.0`.
Choices `authentication_type`: `unspecified`, `simple`, `md5`, `none`. Default value `authentication_type`: `unspecified`.
Default value `cost`: `110`.
List `interfaces`:
Default value `advertise_secondaries`: `true`.
Allowed formats `area`: `0.0.0.10`. Default value `area`: `0.0.0.0`.
Default value `advertise_secondaries`: `true`.
Choices `bfd`: `unspecified`, `enabled`, `disabled`. Default value `bfd`: `unspecified`.
Default value `cost`: `0`.
Default value `dead_interval`: `0`.
Default value `hello_interval`: `10`.
Choices `network_type`: `unspecified`, `p2p`, `bcast`. Default value `network_type`: `unspecified`.
Choices `passive`: `unspecified`, `enabled`, `disabled`. Default value `passive`: `unspecified`.
Default value `priority`: `1`.
Allowed formats `authentication_key`: '0 ', '3 <3DES-format-encrypted-key>', '7 '. Default value `area`: `0.0.0.0`.
Default value `authentication_key_id`: `0`.
Default value `authentication_key_secure_mode`: `false`.
Default value `authentication_md5_key_secure_mode`: `false`.
Choices `authentication_type`: `unspecified`, `simple`, `md5`, `none`. Default value `authentication_type`: `unspecified`. |
list(object({
vrf = string
admin_state = optional(bool, true)
bandwidth_reference = optional(number, 40000)
bandwidth_reference_unit = optional(string, "mbps")
distance = optional(number, 110)
router_id = optional(string, "0.0.0.0")
# adjancency_logging_level = optional(string)
areas = optional(list(object({
area = string
authentication_type = optional(string, "unspecified")
cost = optional(number, 1)
type = optional(string, "regular")
})))
interfaces = optional(list(object({
interface = string
advertise_secondaries = optional(bool, true)
area = optional(string, "0.0.0.0")
bfd = optional(string, "unspecified")
cost = optional(number, 0)
dead_interval = optional(number, 0)
hello_interval = optional(number, 10)
network_type = optional(string, "unspecified")
passive = optional(string, "unspecified")
priority = optional(number, 1)
authentication_key = optional(string)
authentication_key_id = optional(number, 0)
authentication_key_secure_mode = optional(bool, false)
authentication_keychain = optional(string)
authentication_md5_key = optional(string)
authentication_md5_key_secure_mode = optional(bool, false)
authentication_type = optional(string)
})))
}))
| `[]` | no | ## Outputs diff --git a/main.tf b/main.tf index daf67c4..a4fa4de 100644 --- a/main.tf +++ b/main.tf @@ -25,15 +25,15 @@ resource "nxos_ospf_instance" "ospfInst" { } resource "nxos_ospf_vrf" "ospfDom" { - for_each = local.vrf_map - device = var.device - instance_name = var.name - name = each.value.vrf - admin_state = each.value.admin_state == true ? "enabled" : "disabled" - bandwidth_reference = each.value.bandwidth_reference - banwidth_reference_unit = each.value.banwidth_reference_unit - distance = each.value.distance - router_id = each.value.router_id + for_each = local.vrf_map + device = var.device + instance_name = var.name + name = each.value.vrf + admin_state = each.value.admin_state == true ? "enabled" : "disabled" + bandwidth_reference = each.value.bandwidth_reference + bandwidth_reference_unit = each.value.bandwidth_reference_unit + distance = each.value.distance + router_id = each.value.router_id depends_on = [ nxos_ospf_instance.ospfInst diff --git a/variables.tf b/variables.tf index 0f93309..71eb6d3 100644 --- a/variables.tf +++ b/variables.tf @@ -19,7 +19,7 @@ variable "vrfs" { OSPF VRF list. Default value `admin_state`: `true`. Default value `bandwidth_reference`: `40000`. - Choices `banwidth_reference_unit`: `mbps`, `gbps`. Default value `banwidth_reference_unit`: `mbps`. + Choices `bandwidth_reference_unit`: `mbps`, `gbps`. Default value `bandwidth_reference_unit`: `mbps`. Default value `distance`: `110`. List `areas`: Allowed formats `area`: `0.0.0.10`. Default value `area`: `0.0.0.0`. @@ -43,12 +43,12 @@ variable "vrfs" { Choices `authentication_type`: `unspecified`, `simple`, `md5`, `none`. Default value `authentication_type`: `unspecified`. EOT type = list(object({ - vrf = string - admin_state = optional(bool, true) - bandwidth_reference = optional(number, 40000) - banwidth_reference_unit = optional(string, "mbps") - distance = optional(number, 110) - router_id = optional(string, "0.0.0.0") + vrf = string + admin_state = optional(bool, true) + bandwidth_reference = optional(number, 40000) + bandwidth_reference_unit = optional(string, "mbps") + distance = optional(number, 110) + router_id = optional(string, "0.0.0.0") # adjancency_logging_level = optional(string) areas = optional(list(object({ area = string @@ -80,9 +80,9 @@ variable "vrfs" { validation { condition = alltrue([ - for v in var.vrfs : try(contains(["mbps", "gbps"], v.banwidth_reference_unit), v.banwidth_reference_unit == null) + for v in var.vrfs : try(contains(["mbps", "gbps"], v.bandwidth_reference_unit), v.bandwidth_reference_unit == null) ]) - error_message = "`banwidth_reference_unit`: Allowed values are: `mbps` or `gbps`." + error_message = "`bandwidth_reference_unit`: Allowed values are: `mbps` or `gbps`." } validation {