From 7b3e0b06d12dd955d65506c50598e6e6be0bf74b Mon Sep 17 00:00:00 2001 From: devegupt Date: Tue, 22 Oct 2024 11:39:30 +0530 Subject: [PATCH 1/7] interface state terraform module --- aci_interface_policies.tf | 55 +++++++++++++++++ defaults/modules.yaml | 1 + .../.terraform-docs.yml | 34 +++++++++++ .../terraform-aci-interface-state/README.md | 58 ++++++++++++++++++ .../examples/complete/.terraform-docs.yml | 24 ++++++++ .../examples/complete/README.md | 26 ++++++++ .../examples/complete/main.tf | 10 +++ .../examples/complete/versions.tf | 11 ++++ modules/terraform-aci-interface-state/main.tf | 7 +++ .../terraform-aci-interface-state/outputs.tf | 4 ++ .../variables.tf | 61 +++++++++++++++++++ .../terraform-aci-interface-state/versions.tf | 11 ++++ 12 files changed, 302 insertions(+) create mode 100644 modules/terraform-aci-interface-state/.terraform-docs.yml create mode 100644 modules/terraform-aci-interface-state/README.md create mode 100644 modules/terraform-aci-interface-state/examples/complete/.terraform-docs.yml create mode 100644 modules/terraform-aci-interface-state/examples/complete/README.md create mode 100644 modules/terraform-aci-interface-state/examples/complete/main.tf create mode 100644 modules/terraform-aci-interface-state/examples/complete/versions.tf create mode 100644 modules/terraform-aci-interface-state/main.tf create mode 100644 modules/terraform-aci-interface-state/outputs.tf create mode 100644 modules/terraform-aci-interface-state/variables.tf create mode 100644 modules/terraform-aci-interface-state/versions.tf diff --git a/aci_interface_policies.tf b/aci_interface_policies.tf index 1f82ecf6..66050f14 100644 --- a/aci_interface_policies.tf +++ b/aci_interface_policies.tf @@ -434,3 +434,58 @@ module "aci_spine_fabric_interface_configuration" { shutdown = each.value.shutdown role = each.value.role } + +locals { + interface_state = flatten([ + for node in local.nodes : [ + for interface in try(node.interfaces, []) : { + key = format("%s/%s/%s", node.id, try(interface.module, local.defaults.apic.interface_policies.nodes.interfaces.module), interface.port) + node_id = node.id + module = try(interface.module, local.defaults.apic.interface_policies.nodes.interfaces.module) + port = interface.port + shutdown = try(interface.shutdown, local.defaults.apic.interface_policies.nodes.interfaces.shutdown) + } + ] + if(try(local.apic.auto_generate_switch_pod_profiles, local.defaults.apic.auto_generate_switch_pod_profiles) || try(local.apic.auto_generate_access_leaf_switch_interface_profiles, local.defaults.apic.auto_generate_access_leaf_switch_interface_profiles) || try(local.apic.auto_generate_access_spine_switch_interface_profiles, local.defaults.apic.auto_generate_access_spine_switch_interface_profiles)) && (length(var.managed_interface_policies_nodes) == 0 || contains(var.managed_interface_policies_nodes, node.id)) && try(local.apic.new_interface_configuration, local.defaults.apic.new_interface_configuration) == false + ]) +} + +module "aci_interface_state" { + source = "./modules/terraform-aci-interface-state" + + for_each = { for int in local.interface_state : int.key => int if local.modules.aci_interface_state && var.manage_interface_policies } + node_id = each.value.node_id + module = each.value.module + port = each.value.port + shutdown = each.value.shutdown +} + +locals { + fex_interface_state = flatten([ + for node in local.nodes : [ + for fex in try(node.fexes, []) : [ + for interface in try(fex.interfaces, []) : { + key = format("%s/%s/%s/%s", node.id, fex.id, "1", interface.port) + node_id = node.id + module = fex.id + port = interface.port + shutdown = try(interface.shutdown, local.defaults.apic.interface_policies.nodes.interfaces.shutdown) + } + ] + ] if(try(local.apic.auto_generate_switch_pod_profiles, local.defaults.apic.auto_generate_switch_pod_profiles) || try(local.apic.auto_generate_access_leaf_switch_interface_profiles, local.defaults.apic.auto_generate_access_leaf_switch_interface_profiles) || try(local.apic.auto_generate_access_spine_switch_interface_profiles, local.defaults.apic.auto_generate_access_spine_switch_interface_profiles)) && (length(var.managed_interface_policies_nodes) == 0 || contains(var.managed_interface_policies_nodes, node.id)) && try(local.apic.new_interface_configuration, local.defaults.apic.new_interface_configuration) == false + ]) +} + +module "aci_fex_interface_state" { + source = "./modules/terraform-aci-interface-state" + + for_each = { for int in local.fex_interface_state : int.key => int if local.modules.aci_interface_state && var.manage_interface_policies } + node_id = each.value.node_id + module = each.value.module + port = each.value.port + shutdown = each.value.shutdown + + depends_on = [ + module.aci_interface_state, + ] +} diff --git a/defaults/modules.yaml b/defaults/modules.yaml index c34f5b66..da98d402 100644 --- a/defaults/modules.yaml +++ b/defaults/modules.yaml @@ -81,6 +81,7 @@ modules: aci_infra_dhcp_relay_policy: true aci_infra_dscp_translation_policy: true aci_interface_configuration: true + aci_interface_state: true aci_interface_type: true aci_ip_aging: true aci_ip_sla_policy: true diff --git a/modules/terraform-aci-interface-state/.terraform-docs.yml b/modules/terraform-aci-interface-state/.terraform-docs.yml new file mode 100644 index 00000000..82eb5a87 --- /dev/null +++ b/modules/terraform-aci-interface-state/.terraform-docs.yml @@ -0,0 +1,34 @@ +version: '>= 0.14.0' + +formatter: markdown table + +content: |- + # Terraform ACI Interface Type Module + + Manages Interface Type + + Location in GUI: + `Fabric` » `Inventory` » `Pod XXX` » `Node XXX` » `Interface` + + ## Examples + + ```hcl + {{ include "./examples/complete/main.tf" }} + ``` + + {{ .Requirements }} + + {{ .Providers }} + + {{ .Inputs }} + + {{ .Outputs }} + + {{ .Resources }} + +output: + file: README.md + mode: replace + +sort: + enabled: false diff --git a/modules/terraform-aci-interface-state/README.md b/modules/terraform-aci-interface-state/README.md new file mode 100644 index 00000000..53537d8a --- /dev/null +++ b/modules/terraform-aci-interface-state/README.md @@ -0,0 +1,58 @@ + +# Terraform ACI Interface Type Module + +Manages Interface Type + +Location in GUI: +`Fabric` » `Inventory` » `Pod XXX` » `Node XXX` » `Interface` + +## Examples + +```hcl +module "aci_interface_type" { + source = "netascode/nac-aci/aci//modules/terraform-aci-interface-type" + version = ">= 0.8.0" + + pod_id = 2 + node_id = 101 + module = 2 + port = 1 + type = "downlink" +} +``` + +## Requirements + +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.0.0 | +| [aci](#requirement\_aci) | >= 2.0.0 | + +## Providers + +| Name | Version | +|------|---------| +| [aci](#provider\_aci) | >= 2.0.0 | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [pod\_id](#input\_pod\_id) | Interface Pod ID. Minimum value: `1`. Maximum value: `255`. | `number` | `1` | no | +| [node\_id](#input\_node\_id) | Interface Node ID. Minimum value: `1`. Maximum value: `4000`. | `number` | n/a | yes | +| [module](#input\_module) | Interface Module. Minimum value: `1`. Maximum value: `9`. | `number` | `1` | no | +| [port](#input\_port) | Interface Port. Minimum value: `1`. Maximum value: `127`. | `number` | n/a | yes | +| [type](#input\_type) | Interface Type. Valid values are `uplink` or `downlink` | `string` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| [dn](#output\_dn) | Distinguished name of `infraRsPortDirection` object. | + +## Resources + +| Name | Type | +|------|------| +| [aci_rest_managed.infraRsPortDirection](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource | + \ No newline at end of file diff --git a/modules/terraform-aci-interface-state/examples/complete/.terraform-docs.yml b/modules/terraform-aci-interface-state/examples/complete/.terraform-docs.yml new file mode 100644 index 00000000..4763843a --- /dev/null +++ b/modules/terraform-aci-interface-state/examples/complete/.terraform-docs.yml @@ -0,0 +1,24 @@ +version: '>= 0.14.0' + +formatter: markdown table + +content: |- + # Interface Type Example + + To run this example you need to execute: + + ```bash + $ terraform init + $ terraform plan + $ terraform apply + ``` + + Note that this example will create resources. Resources can be destroyed with `terraform destroy`. + + ```hcl + {{ include "./main.tf" }} + ``` + +output: + file: README.md + mode: replace diff --git a/modules/terraform-aci-interface-state/examples/complete/README.md b/modules/terraform-aci-interface-state/examples/complete/README.md new file mode 100644 index 00000000..9526b7ab --- /dev/null +++ b/modules/terraform-aci-interface-state/examples/complete/README.md @@ -0,0 +1,26 @@ + +# Interface Type Example + +To run this example you need to execute: + +```bash +$ terraform init +$ terraform plan +$ terraform apply +``` + +Note that this example will create resources. Resources can be destroyed with `terraform destroy`. + +```hcl +module "aci_interface_type" { + source = "netascode/nac-aci/aci//modules/terraform-aci-interface-state" + version = ">= 0.8.0" + + pod_id = 1 + node_id = 101 + module = 1 + port = 1 + shutdown = false + } +``` + \ No newline at end of file diff --git a/modules/terraform-aci-interface-state/examples/complete/main.tf b/modules/terraform-aci-interface-state/examples/complete/main.tf new file mode 100644 index 00000000..93e3b00d --- /dev/null +++ b/modules/terraform-aci-interface-state/examples/complete/main.tf @@ -0,0 +1,10 @@ +module "aci_interface_type" { + source = "netascode/nac-aci/aci//modules/terraform-aci-interface-state" + version = ">= 0.8.0" + + pod_id = 1 + node_id = 101 + module = 1 + port = 1 + shutdown = false +} diff --git a/modules/terraform-aci-interface-state/examples/complete/versions.tf b/modules/terraform-aci-interface-state/examples/complete/versions.tf new file mode 100644 index 00000000..e8b775ae --- /dev/null +++ b/modules/terraform-aci-interface-state/examples/complete/versions.tf @@ -0,0 +1,11 @@ + +terraform { + required_version = ">= 1.0.0" + + required_providers { + aci = { + source = "CiscoDevNet/aci" + version = ">= 2.0.0" + } + } +} diff --git a/modules/terraform-aci-interface-state/main.tf b/modules/terraform-aci-interface-state/main.tf new file mode 100644 index 00000000..02000aa2 --- /dev/null +++ b/modules/terraform-aci-interface-state/main.tf @@ -0,0 +1,7 @@ +resource "aci_rest_managed" "fabricRsOosPath" { + dn = "uni/fabric/outofsvc/rsoosPath-[topology/pod-${var.pod_id}/paths-${var.node_id}/pathep-[eth${var.module}/${var.port}]]" + class_name = "fabricRsOosPath" + content = { + lc = var.shutdown ? "blacklist" : "in-service" + } +} diff --git a/modules/terraform-aci-interface-state/outputs.tf b/modules/terraform-aci-interface-state/outputs.tf new file mode 100644 index 00000000..4b694bbe --- /dev/null +++ b/modules/terraform-aci-interface-state/outputs.tf @@ -0,0 +1,4 @@ +output "dn" { + value = aci_rest_managed.fabricRsOosPath.id + description = "Distinguished name of `fabricRsOosPath` object." +} diff --git a/modules/terraform-aci-interface-state/variables.tf b/modules/terraform-aci-interface-state/variables.tf new file mode 100644 index 00000000..95567dd3 --- /dev/null +++ b/modules/terraform-aci-interface-state/variables.tf @@ -0,0 +1,61 @@ +variable "pod_id" { + description = "Interface Pod ID. Minimum value: `1`. Maximum value: `255`." + type = number + default = 1 + + validation { + condition = var.pod_id >= 1 && var.pod_id <= 255 + error_message = "Minimum value: `1`. Maximum value: `255`." + } +} + +variable "node_id" { + description = "Interface Node ID. Minimum value: `1`. Maximum value: `4000`." + type = number + + validation { + condition = var.node_id >= 1 && var.node_id <= 4000 + error_message = "Minimum value: `1`. Maximum value: `4000`." + } +} + +variable "module" { + description = "Interface Module. Minimum value: `1`. Maximum value: `255`." + type = number + default = 1 + + validation { + condition = try(var.module >= 1 && var.module <= 255, false) + error_message = "Allowed values: 1-255." + } +} + +variable "port" { + description = "Interface Port. Minimum value: `1`. Maximum value: `127`." + type = number + + validation { + condition = var.port >= 1 && var.port <= 127 + error_message = "Minimum value: `1`. Maximum value: `127`." + } +} + +variable "sub_port" { + description = "Subinterface ID. Allowed values: 1-64." + type = number + default = 0 + + validation { + condition = try(var.sub_port >= 0 && var.sub_port <= 64, false) + error_message = "Allowed values: 1-64." + } +} + +variable "shutdown" { + description = "Shutdown interface." + type = bool + default = false +} + + + diff --git a/modules/terraform-aci-interface-state/versions.tf b/modules/terraform-aci-interface-state/versions.tf new file mode 100644 index 00000000..e8b775ae --- /dev/null +++ b/modules/terraform-aci-interface-state/versions.tf @@ -0,0 +1,11 @@ + +terraform { + required_version = ">= 1.0.0" + + required_providers { + aci = { + source = "CiscoDevNet/aci" + version = ">= 2.0.0" + } + } +} From 52b6b34aa421db6e0e74831ce780573a653d78e8 Mon Sep 17 00:00:00 2001 From: devegupt Date: Tue, 22 Oct 2024 15:08:49 +0530 Subject: [PATCH 2/7] udpated interface state moduel --- README.md | 6 ++++-- modules/terraform-aci-interface-state/variables.tf | 11 ----------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 79cf1a28..06335552 100644 --- a/README.md +++ b/README.md @@ -118,8 +118,8 @@ Additional example repositories: | Name | Version | |------|---------| -| [local](#provider\_local) | >= 2.3.0 | -| [utils](#provider\_utils) | >= 0.2.5 | +| [local](#provider\_local) | 2.5.2 | +| [utils](#provider\_utils) | 0.2.6 | ## Resources @@ -218,6 +218,7 @@ Additional example repositories: | [aci\_fabric\_spine\_switch\_profile\_auto](#module\_aci\_fabric\_spine\_switch\_profile\_auto) | ./modules/terraform-aci-fabric-spine-switch-profile | n/a | | [aci\_fabric\_spine\_switch\_profile\_manual](#module\_aci\_fabric\_spine\_switch\_profile\_manual) | ./modules/terraform-aci-fabric-spine-switch-profile | n/a | | [aci\_fabric\_wide\_settings](#module\_aci\_fabric\_wide\_settings) | ./modules/terraform-aci-fabric-wide-settings | n/a | +| [aci\_fex\_interface\_state](#module\_aci\_fex\_interface\_state) | ./modules/terraform-aci-interface-state | n/a | | [aci\_filter](#module\_aci\_filter) | ./modules/terraform-aci-filter | n/a | | [aci\_firmware\_group](#module\_aci\_firmware\_group) | ./modules/terraform-aci-firmware-group | n/a | | [aci\_forwarding\_scale\_policy](#module\_aci\_forwarding\_scale\_policy) | ./modules/terraform-aci-forwarding-scale-policy | n/a | @@ -232,6 +233,7 @@ Additional example repositories: | [aci\_infra\_dhcp\_relay\_policy](#module\_aci\_infra\_dhcp\_relay\_policy) | ./modules/terraform-aci-infra-dhcp-relay-policy | n/a | | [aci\_infra\_dscp\_translation\_policy](#module\_aci\_infra\_dscp\_translation\_policy) | ./modules/terraform-aci-infra-dscp-translation-policy | n/a | | [aci\_interface\_configuration\_fex](#module\_aci\_interface\_configuration\_fex) | ./modules/terraform-aci-interface-configuration | n/a | +| [aci\_interface\_state](#module\_aci\_interface\_state) | ./modules/terraform-aci-interface-state | n/a | | [aci\_interface\_type](#module\_aci\_interface\_type) | ./modules/terraform-aci-interface-type | n/a | | [aci\_ip\_aging](#module\_aci\_ip\_aging) | ./modules/terraform-aci-ip-aging | n/a | | [aci\_ip\_sla\_policy](#module\_aci\_ip\_sla\_policy) | ./modules/terraform-aci-ip-sla-policy | n/a | diff --git a/modules/terraform-aci-interface-state/variables.tf b/modules/terraform-aci-interface-state/variables.tf index 95567dd3..e0decdde 100644 --- a/modules/terraform-aci-interface-state/variables.tf +++ b/modules/terraform-aci-interface-state/variables.tf @@ -40,17 +40,6 @@ variable "port" { } } -variable "sub_port" { - description = "Subinterface ID. Allowed values: 1-64." - type = number - default = 0 - - validation { - condition = try(var.sub_port >= 0 && var.sub_port <= 64, false) - error_message = "Allowed values: 1-64." - } -} - variable "shutdown" { description = "Shutdown interface." type = bool From fed4e9d39d877b222ae66548654da0f8221294b7 Mon Sep 17 00:00:00 2001 From: devegupt Date: Wed, 23 Oct 2024 10:17:30 +0530 Subject: [PATCH 3/7] Updates in the Interface Shutdown Module --- README.md | 4 ++-- aci_interface_policies.tf | 24 +++++++++---------- defaults/modules.yaml | 2 +- .../.terraform-docs.yml | 4 ++-- .../README.md | 12 ++++------ .../examples/complete/.terraform-docs.yml | 2 +- .../examples/complete/README.md | 7 +++--- .../examples/complete/main.tf | 11 ++++----- .../examples/complete/versions.tf | 0 .../main.tf | 4 ++-- .../outputs.tf | 0 .../variables.tf | 10 ++------ .../versions.tf | 0 13 files changed, 34 insertions(+), 46 deletions(-) rename modules/{terraform-aci-interface-state => terraform-aci-interface-shutdown}/.terraform-docs.yml (84%) rename modules/{terraform-aci-interface-state => terraform-aci-interface-shutdown}/README.md (84%) rename modules/{terraform-aci-interface-state => terraform-aci-interface-shutdown}/examples/complete/.terraform-docs.yml (92%) rename modules/{terraform-aci-interface-state => terraform-aci-interface-shutdown}/examples/complete/README.md (83%) rename modules/{terraform-aci-interface-state => terraform-aci-interface-shutdown}/examples/complete/main.tf (56%) rename modules/{terraform-aci-interface-state => terraform-aci-interface-shutdown}/examples/complete/versions.tf (100%) rename modules/{terraform-aci-interface-state => terraform-aci-interface-shutdown}/main.tf (81%) rename modules/{terraform-aci-interface-state => terraform-aci-interface-shutdown}/outputs.tf (100%) rename modules/{terraform-aci-interface-state => terraform-aci-interface-shutdown}/variables.tf (80%) rename modules/{terraform-aci-interface-state => terraform-aci-interface-shutdown}/versions.tf (100%) diff --git a/README.md b/README.md index 06335552..8e5ed896 100644 --- a/README.md +++ b/README.md @@ -218,7 +218,7 @@ Additional example repositories: | [aci\_fabric\_spine\_switch\_profile\_auto](#module\_aci\_fabric\_spine\_switch\_profile\_auto) | ./modules/terraform-aci-fabric-spine-switch-profile | n/a | | [aci\_fabric\_spine\_switch\_profile\_manual](#module\_aci\_fabric\_spine\_switch\_profile\_manual) | ./modules/terraform-aci-fabric-spine-switch-profile | n/a | | [aci\_fabric\_wide\_settings](#module\_aci\_fabric\_wide\_settings) | ./modules/terraform-aci-fabric-wide-settings | n/a | -| [aci\_fex\_interface\_state](#module\_aci\_fex\_interface\_state) | ./modules/terraform-aci-interface-state | n/a | +| [aci\_fex\_interface\_shutdown](#module\_aci\_fex\_interface\_shutdown) | ./modules/terraform-aci-interface-shutdown | n/a | | [aci\_filter](#module\_aci\_filter) | ./modules/terraform-aci-filter | n/a | | [aci\_firmware\_group](#module\_aci\_firmware\_group) | ./modules/terraform-aci-firmware-group | n/a | | [aci\_forwarding\_scale\_policy](#module\_aci\_forwarding\_scale\_policy) | ./modules/terraform-aci-forwarding-scale-policy | n/a | @@ -233,7 +233,7 @@ Additional example repositories: | [aci\_infra\_dhcp\_relay\_policy](#module\_aci\_infra\_dhcp\_relay\_policy) | ./modules/terraform-aci-infra-dhcp-relay-policy | n/a | | [aci\_infra\_dscp\_translation\_policy](#module\_aci\_infra\_dscp\_translation\_policy) | ./modules/terraform-aci-infra-dscp-translation-policy | n/a | | [aci\_interface\_configuration\_fex](#module\_aci\_interface\_configuration\_fex) | ./modules/terraform-aci-interface-configuration | n/a | -| [aci\_interface\_state](#module\_aci\_interface\_state) | ./modules/terraform-aci-interface-state | n/a | +| [aci\_interface\_shutdown](#module\_aci\_interface\_shutdown) | ./modules/terraform-aci-interface-shutdown | n/a | | [aci\_interface\_type](#module\_aci\_interface\_type) | ./modules/terraform-aci-interface-type | n/a | | [aci\_ip\_aging](#module\_aci\_ip\_aging) | ./modules/terraform-aci-ip-aging | n/a | | [aci\_ip\_sla\_policy](#module\_aci\_ip\_sla\_policy) | ./modules/terraform-aci-ip-sla-policy | n/a | diff --git a/aci_interface_policies.tf b/aci_interface_policies.tf index 66050f14..85d8d380 100644 --- a/aci_interface_policies.tf +++ b/aci_interface_policies.tf @@ -436,7 +436,7 @@ module "aci_spine_fabric_interface_configuration" { } locals { - interface_state = flatten([ + interface_shutdown = flatten([ for node in local.nodes : [ for interface in try(node.interfaces, []) : { key = format("%s/%s/%s", node.id, try(interface.module, local.defaults.apic.interface_policies.nodes.interfaces.module), interface.port) @@ -446,22 +446,21 @@ locals { shutdown = try(interface.shutdown, local.defaults.apic.interface_policies.nodes.interfaces.shutdown) } ] - if(try(local.apic.auto_generate_switch_pod_profiles, local.defaults.apic.auto_generate_switch_pod_profiles) || try(local.apic.auto_generate_access_leaf_switch_interface_profiles, local.defaults.apic.auto_generate_access_leaf_switch_interface_profiles) || try(local.apic.auto_generate_access_spine_switch_interface_profiles, local.defaults.apic.auto_generate_access_spine_switch_interface_profiles)) && (length(var.managed_interface_policies_nodes) == 0 || contains(var.managed_interface_policies_nodes, node.id)) && try(local.apic.new_interface_configuration, local.defaults.apic.new_interface_configuration) == false + if(try(local.apic.auto_generate_switch_pod_profiles, local.defaults.apic.auto_generate_switch_pod_profiles) || try(local.apic.auto_generate_access_leaf_switch_interface_profiles, local.defaults.apic.auto_generate_access_leaf_switch_interface_profiles) || try(local.apic.auto_generate_access_spine_switch_interface_profiles, local.defaults.apic.auto_generate_access_spine_switch_interface_profiles)) && try(local.apic.new_interface_configuration, local.defaults.apic.new_interface_configuration) == false ]) } -module "aci_interface_state" { - source = "./modules/terraform-aci-interface-state" +module "aci_interface_shutdown" { + source = "./modules/terraform-aci-interface-shutdown" - for_each = { for int in local.interface_state : int.key => int if local.modules.aci_interface_state && var.manage_interface_policies } + for_each = { for int in local.interface_shutdown : int.key => int if local.modules.aci_interface_shutdown && var.manage_interface_policies && int.shutdown == true } node_id = each.value.node_id module = each.value.module port = each.value.port - shutdown = each.value.shutdown } locals { - fex_interface_state = flatten([ + fex_interface_shutdown = flatten([ for node in local.nodes : [ for fex in try(node.fexes, []) : [ for interface in try(fex.interfaces, []) : { @@ -472,20 +471,19 @@ locals { shutdown = try(interface.shutdown, local.defaults.apic.interface_policies.nodes.interfaces.shutdown) } ] - ] if(try(local.apic.auto_generate_switch_pod_profiles, local.defaults.apic.auto_generate_switch_pod_profiles) || try(local.apic.auto_generate_access_leaf_switch_interface_profiles, local.defaults.apic.auto_generate_access_leaf_switch_interface_profiles) || try(local.apic.auto_generate_access_spine_switch_interface_profiles, local.defaults.apic.auto_generate_access_spine_switch_interface_profiles)) && (length(var.managed_interface_policies_nodes) == 0 || contains(var.managed_interface_policies_nodes, node.id)) && try(local.apic.new_interface_configuration, local.defaults.apic.new_interface_configuration) == false + ] if(try(local.apic.auto_generate_switch_pod_profiles, local.defaults.apic.auto_generate_switch_pod_profiles) || try(local.apic.auto_generate_access_leaf_switch_interface_profiles, local.defaults.apic.auto_generate_access_leaf_switch_interface_profiles) || try(local.apic.auto_generate_access_spine_switch_interface_profiles, local.defaults.apic.auto_generate_access_spine_switch_interface_profiles)) && try(local.apic.new_interface_configuration, local.defaults.apic.new_interface_configuration) == false ]) } -module "aci_fex_interface_state" { - source = "./modules/terraform-aci-interface-state" +module "aci_fex_interface_shutdown" { + source = "./modules/terraform-aci-interface-shutdown" - for_each = { for int in local.fex_interface_state : int.key => int if local.modules.aci_interface_state && var.manage_interface_policies } + for_each = { for int in local.fex_interface_shutdown : int.key => int if local.modules.aci_interface_shutdown && var.manage_interface_policies && int.shutdown == true } node_id = each.value.node_id module = each.value.module port = each.value.port - shutdown = each.value.shutdown depends_on = [ - module.aci_interface_state, + module.aci_interface_shutdown ] } diff --git a/defaults/modules.yaml b/defaults/modules.yaml index da98d402..321314dc 100644 --- a/defaults/modules.yaml +++ b/defaults/modules.yaml @@ -81,7 +81,7 @@ modules: aci_infra_dhcp_relay_policy: true aci_infra_dscp_translation_policy: true aci_interface_configuration: true - aci_interface_state: true + aci_interface_shutdown: true aci_interface_type: true aci_ip_aging: true aci_ip_sla_policy: true diff --git a/modules/terraform-aci-interface-state/.terraform-docs.yml b/modules/terraform-aci-interface-shutdown/.terraform-docs.yml similarity index 84% rename from modules/terraform-aci-interface-state/.terraform-docs.yml rename to modules/terraform-aci-interface-shutdown/.terraform-docs.yml index 82eb5a87..f103aaa0 100644 --- a/modules/terraform-aci-interface-state/.terraform-docs.yml +++ b/modules/terraform-aci-interface-shutdown/.terraform-docs.yml @@ -3,9 +3,9 @@ version: '>= 0.14.0' formatter: markdown table content: |- - # Terraform ACI Interface Type Module + # Terraform ACI Interface Shutdown Module - Manages Interface Type + Manages Interface Shutdown Location in GUI: `Fabric` » `Inventory` » `Pod XXX` » `Node XXX` » `Interface` diff --git a/modules/terraform-aci-interface-state/README.md b/modules/terraform-aci-interface-shutdown/README.md similarity index 84% rename from modules/terraform-aci-interface-state/README.md rename to modules/terraform-aci-interface-shutdown/README.md index 53537d8a..344797d2 100644 --- a/modules/terraform-aci-interface-state/README.md +++ b/modules/terraform-aci-interface-shutdown/README.md @@ -1,7 +1,7 @@ -# Terraform ACI Interface Type Module +# Terraform ACI Interface Shutdown Module -Manages Interface Type +Manages Interface Shutdown Location in GUI: `Fabric` » `Inventory` » `Pod XXX` » `Node XXX` » `Interface` @@ -9,15 +9,14 @@ Location in GUI: ## Examples ```hcl -module "aci_interface_type" { - source = "netascode/nac-aci/aci//modules/terraform-aci-interface-type" +module "aci_interface_shutdown" { + source = "netascode/nac-aci/aci//modules/terraform-aci-interface-shutdown" version = ">= 0.8.0" pod_id = 2 node_id = 101 module = 2 port = 1 - type = "downlink" } ``` @@ -42,13 +41,12 @@ module "aci_interface_type" { | [node\_id](#input\_node\_id) | Interface Node ID. Minimum value: `1`. Maximum value: `4000`. | `number` | n/a | yes | | [module](#input\_module) | Interface Module. Minimum value: `1`. Maximum value: `9`. | `number` | `1` | no | | [port](#input\_port) | Interface Port. Minimum value: `1`. Maximum value: `127`. | `number` | n/a | yes | -| [type](#input\_type) | Interface Type. Valid values are `uplink` or `downlink` | `string` | n/a | yes | ## Outputs | Name | Description | |------|-------------| -| [dn](#output\_dn) | Distinguished name of `infraRsPortDirection` object. | +| [dn](#output\_dn) | Distinguished name of `fabricRsOosPath` object. | ## Resources diff --git a/modules/terraform-aci-interface-state/examples/complete/.terraform-docs.yml b/modules/terraform-aci-interface-shutdown/examples/complete/.terraform-docs.yml similarity index 92% rename from modules/terraform-aci-interface-state/examples/complete/.terraform-docs.yml rename to modules/terraform-aci-interface-shutdown/examples/complete/.terraform-docs.yml index 4763843a..13abdf8f 100644 --- a/modules/terraform-aci-interface-state/examples/complete/.terraform-docs.yml +++ b/modules/terraform-aci-interface-shutdown/examples/complete/.terraform-docs.yml @@ -3,7 +3,7 @@ version: '>= 0.14.0' formatter: markdown table content: |- - # Interface Type Example + # Interface Shutdown Example To run this example you need to execute: diff --git a/modules/terraform-aci-interface-state/examples/complete/README.md b/modules/terraform-aci-interface-shutdown/examples/complete/README.md similarity index 83% rename from modules/terraform-aci-interface-state/examples/complete/README.md rename to modules/terraform-aci-interface-shutdown/examples/complete/README.md index 9526b7ab..54a4ba44 100644 --- a/modules/terraform-aci-interface-state/examples/complete/README.md +++ b/modules/terraform-aci-interface-shutdown/examples/complete/README.md @@ -1,5 +1,5 @@ -# Interface Type Example +# Interface Shutdown Example To run this example you need to execute: @@ -12,15 +12,14 @@ $ terraform apply Note that this example will create resources. Resources can be destroyed with `terraform destroy`. ```hcl -module "aci_interface_type" { - source = "netascode/nac-aci/aci//modules/terraform-aci-interface-state" +module "aci_interface_shutdown" { + source = "netascode/nac-aci/aci//modules/terraform-aci-interface-shutdown" version = ">= 0.8.0" pod_id = 1 node_id = 101 module = 1 port = 1 - shutdown = false } ``` \ No newline at end of file diff --git a/modules/terraform-aci-interface-state/examples/complete/main.tf b/modules/terraform-aci-interface-shutdown/examples/complete/main.tf similarity index 56% rename from modules/terraform-aci-interface-state/examples/complete/main.tf rename to modules/terraform-aci-interface-shutdown/examples/complete/main.tf index 93e3b00d..4997b55b 100644 --- a/modules/terraform-aci-interface-state/examples/complete/main.tf +++ b/modules/terraform-aci-interface-shutdown/examples/complete/main.tf @@ -1,10 +1,9 @@ module "aci_interface_type" { - source = "netascode/nac-aci/aci//modules/terraform-aci-interface-state" + source = "netascode/nac-aci/aci//modules/terraform-aci-interface-shutdown" version = ">= 0.8.0" - pod_id = 1 - node_id = 101 - module = 1 - port = 1 - shutdown = false + pod_id = 1 + node_id = 101 + module = 1 + port = 1 } diff --git a/modules/terraform-aci-interface-state/examples/complete/versions.tf b/modules/terraform-aci-interface-shutdown/examples/complete/versions.tf similarity index 100% rename from modules/terraform-aci-interface-state/examples/complete/versions.tf rename to modules/terraform-aci-interface-shutdown/examples/complete/versions.tf diff --git a/modules/terraform-aci-interface-state/main.tf b/modules/terraform-aci-interface-shutdown/main.tf similarity index 81% rename from modules/terraform-aci-interface-state/main.tf rename to modules/terraform-aci-interface-shutdown/main.tf index 02000aa2..2be6a657 100644 --- a/modules/terraform-aci-interface-state/main.tf +++ b/modules/terraform-aci-interface-shutdown/main.tf @@ -2,6 +2,6 @@ resource "aci_rest_managed" "fabricRsOosPath" { dn = "uni/fabric/outofsvc/rsoosPath-[topology/pod-${var.pod_id}/paths-${var.node_id}/pathep-[eth${var.module}/${var.port}]]" class_name = "fabricRsOosPath" content = { - lc = var.shutdown ? "blacklist" : "in-service" + lc = "blacklist" } -} +} \ No newline at end of file diff --git a/modules/terraform-aci-interface-state/outputs.tf b/modules/terraform-aci-interface-shutdown/outputs.tf similarity index 100% rename from modules/terraform-aci-interface-state/outputs.tf rename to modules/terraform-aci-interface-shutdown/outputs.tf diff --git a/modules/terraform-aci-interface-state/variables.tf b/modules/terraform-aci-interface-shutdown/variables.tf similarity index 80% rename from modules/terraform-aci-interface-state/variables.tf rename to modules/terraform-aci-interface-shutdown/variables.tf index e0decdde..01a530a1 100644 --- a/modules/terraform-aci-interface-state/variables.tf +++ b/modules/terraform-aci-interface-shutdown/variables.tf @@ -14,8 +14,8 @@ variable "node_id" { type = number validation { - condition = var.node_id >= 1 && var.node_id <= 4000 - error_message = "Minimum value: `1`. Maximum value: `4000`." + condition = var.node_id >= 101 && var.node_id <= 4000 + error_message = "Minimum value: `101`. Maximum value: `4000`." } } @@ -40,11 +40,5 @@ variable "port" { } } -variable "shutdown" { - description = "Shutdown interface." - type = bool - default = false -} - diff --git a/modules/terraform-aci-interface-state/versions.tf b/modules/terraform-aci-interface-shutdown/versions.tf similarity index 100% rename from modules/terraform-aci-interface-state/versions.tf rename to modules/terraform-aci-interface-shutdown/versions.tf From 84c01669314822c07a7c283da04cd038f8a836cd Mon Sep 17 00:00:00 2001 From: devegupt Date: Wed, 23 Oct 2024 10:41:23 +0530 Subject: [PATCH 4/7] Updated Readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8e5ed896..be6fa080 100644 --- a/README.md +++ b/README.md @@ -118,8 +118,8 @@ Additional example repositories: | Name | Version | |------|---------| -| [local](#provider\_local) | 2.5.2 | -| [utils](#provider\_utils) | 0.2.6 | +| [local](#provider\_local) | >= 2.3.0 | +| [utils](#provider\_utils) | >= 0.2.5 | ## Resources From 83715b9273b6f9679edc1d266ab69e37bfd6ad87 Mon Sep 17 00:00:00 2001 From: Andrew Byrne Date: Wed, 23 Oct 2024 17:58:29 +1100 Subject: [PATCH 5/7] Support fex and sub ports --- README.md | 1 + aci_interface_policies.tf | 61 +++++++++++++------ defaults/defaults.yaml | 1 + .../examples/complete/main.tf | 4 +- .../terraform-aci-interface-shutdown/main.tf | 4 +- .../variables.tf | 23 ++++++- 6 files changed, 68 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index be6fa080..717b95ec 100644 --- a/README.md +++ b/README.md @@ -312,6 +312,7 @@ Additional example repositories: | [aci\_sr\_mpls\_l3out\_interface\_profile\_manual](#module\_aci\_sr\_mpls\_l3out\_interface\_profile\_manual) | ./modules/terraform-aci-l3out-interface-profile | n/a | | [aci\_sr\_mpls\_l3out\_node\_profile\_manual](#module\_aci\_sr\_mpls\_l3out\_node\_profile\_manual) | ./modules/terraform-aci-l3out-node-profile | n/a | | [aci\_storm\_control\_policy](#module\_aci\_storm\_control\_policy) | ./modules/terraform-aci-storm-control-policy | n/a | +| [aci\_subinterface\_shutdown](#module\_aci\_subinterface\_shutdown) | ./modules/terraform-aci-interface-shutdown | n/a | | [aci\_syslog\_policy](#module\_aci\_syslog\_policy) | ./modules/terraform-aci-syslog-policy | n/a | | [aci\_system\_global\_gipo](#module\_aci\_system\_global\_gipo) | ./modules/terraform-aci-system-global-gipo | n/a | | [aci\_system\_performance](#module\_aci\_system\_performance) | ./modules/terraform-aci-system-performance | n/a | diff --git a/aci_interface_policies.tf b/aci_interface_policies.tf index 85d8d380..1b00bafb 100644 --- a/aci_interface_policies.tf +++ b/aci_interface_policies.tf @@ -439,24 +439,48 @@ locals { interface_shutdown = flatten([ for node in local.nodes : [ for interface in try(node.interfaces, []) : { - key = format("%s/%s/%s", node.id, try(interface.module, local.defaults.apic.interface_policies.nodes.interfaces.module), interface.port) - node_id = node.id - module = try(interface.module, local.defaults.apic.interface_policies.nodes.interfaces.module) - port = interface.port - shutdown = try(interface.shutdown, local.defaults.apic.interface_policies.nodes.interfaces.shutdown) - } - ] - if(try(local.apic.auto_generate_switch_pod_profiles, local.defaults.apic.auto_generate_switch_pod_profiles) || try(local.apic.auto_generate_access_leaf_switch_interface_profiles, local.defaults.apic.auto_generate_access_leaf_switch_interface_profiles) || try(local.apic.auto_generate_access_spine_switch_interface_profiles, local.defaults.apic.auto_generate_access_spine_switch_interface_profiles)) && try(local.apic.new_interface_configuration, local.defaults.apic.new_interface_configuration) == false + key = format("%s/%s/%s", node.id, try(interface.module, local.defaults.apic.interface_policies.nodes.interfaces.module), interface.port) + node_id = node.id + module = try(interface.module, local.defaults.apic.interface_policies.nodes.interfaces.module) + port = interface.port + } if try(interface.shutdown, local.defaults.apic.interface_policies.nodes.interfaces.shutdown) + ] if(try(local.apic.auto_generate_switch_pod_profiles, local.defaults.apic.auto_generate_switch_pod_profiles) || try(local.apic.auto_generate_access_leaf_switch_interface_profiles, local.defaults.apic.auto_generate_access_leaf_switch_interface_profiles) || try(local.apic.auto_generate_access_spine_switch_interface_profiles, local.defaults.apic.auto_generate_access_spine_switch_interface_profiles)) && try(local.apic.new_interface_configuration, local.defaults.apic.new_interface_configuration) == false ]) } module "aci_interface_shutdown" { source = "./modules/terraform-aci-interface-shutdown" - for_each = { for int in local.interface_shutdown : int.key => int if local.modules.aci_interface_shutdown && var.manage_interface_policies && int.shutdown == true } + for_each = { for int in local.interface_shutdown : int.key => int if local.modules.aci_interface_shutdown && var.manage_interface_policies } + node_id = each.value.node_id + module = each.value.module + port = each.value.port +} + +locals { + subinterface_shutdown = flatten([ + for node in local.nodes : [ + for interface in try(node.interfaces, []) : [ + for subinterface in try(interface.sub_ports, []) : { + key = format("%s/%s/%s/%s", node.id, try(interface.module, local.defaults.apic.interface_policies.nodes.interfaces.module), interface.port, subinterface.port) + node_id = node.id + module = try(interface.module, local.defaults.apic.interface_policies.nodes.interfaces.module) + port = interface.port + sub_port = subinterface.port + } if try(subinterface.shutdown, local.defaults.apic.interface_policies.nodes.interfaces.sub_ports.shutdown) + ] + ] if(try(local.apic.auto_generate_switch_pod_profiles, local.defaults.apic.auto_generate_switch_pod_profiles) || try(local.apic.auto_generate_access_leaf_switch_interface_profiles, local.defaults.apic.auto_generate_access_leaf_switch_interface_profiles) || try(local.apic.auto_generate_access_spine_switch_interface_profiles, local.defaults.apic.auto_generate_access_spine_switch_interface_profiles)) && try(local.apic.new_interface_configuration, local.defaults.apic.new_interface_configuration) == false + ]) +} + +module "aci_subinterface_shutdown" { + source = "./modules/terraform-aci-interface-shutdown" + + for_each = { for int in local.subinterface_shutdown : int.key => int if local.modules.aci_interface_shutdown && var.manage_interface_policies } node_id = each.value.node_id module = each.value.module port = each.value.port + sub_port = each.value.sub_port } locals { @@ -464,12 +488,12 @@ locals { for node in local.nodes : [ for fex in try(node.fexes, []) : [ for interface in try(fex.interfaces, []) : { - key = format("%s/%s/%s/%s", node.id, fex.id, "1", interface.port) - node_id = node.id - module = fex.id - port = interface.port - shutdown = try(interface.shutdown, local.defaults.apic.interface_policies.nodes.interfaces.shutdown) - } + key = format("%s/%s/%s/%s", node.id, fex.id, try(interface.module, local.defaults.apic.interface_policies.nodes.fexes.interfaces.module), interface.port) + node_id = node.id + fex_id = fex.id + module = try(interface.module, local.defaults.apic.interface_policies.nodes.fexes.interfaces.module) + port = interface.port + } if try(interface.shutdown, local.defaults.apic.interface_policies.nodes.fexes.interfaces.shutdown) ] ] if(try(local.apic.auto_generate_switch_pod_profiles, local.defaults.apic.auto_generate_switch_pod_profiles) || try(local.apic.auto_generate_access_leaf_switch_interface_profiles, local.defaults.apic.auto_generate_access_leaf_switch_interface_profiles) || try(local.apic.auto_generate_access_spine_switch_interface_profiles, local.defaults.apic.auto_generate_access_spine_switch_interface_profiles)) && try(local.apic.new_interface_configuration, local.defaults.apic.new_interface_configuration) == false ]) @@ -478,12 +502,9 @@ locals { module "aci_fex_interface_shutdown" { source = "./modules/terraform-aci-interface-shutdown" - for_each = { for int in local.fex_interface_shutdown : int.key => int if local.modules.aci_interface_shutdown && var.manage_interface_policies && int.shutdown == true } + for_each = { for int in local.fex_interface_shutdown : int.key => int if local.modules.aci_interface_shutdown && var.manage_interface_policies } node_id = each.value.node_id + fex_id = each.value.fex_id module = each.value.module port = each.value.port - - depends_on = [ - module.aci_interface_shutdown - ] } diff --git a/defaults/defaults.yaml b/defaults/defaults.yaml index 44e19320..213cf42f 100644 --- a/defaults/defaults.yaml +++ b/defaults/defaults.yaml @@ -756,6 +756,7 @@ defaults: fexes: interfaces: from_module: 1 + module: 1 shutdown: false tenants: diff --git a/modules/terraform-aci-interface-shutdown/examples/complete/main.tf b/modules/terraform-aci-interface-shutdown/examples/complete/main.tf index 4997b55b..f2f88752 100644 --- a/modules/terraform-aci-interface-shutdown/examples/complete/main.tf +++ b/modules/terraform-aci-interface-shutdown/examples/complete/main.tf @@ -1,6 +1,6 @@ -module "aci_interface_type" { +module "aci_interface_shutdown" { source = "netascode/nac-aci/aci//modules/terraform-aci-interface-shutdown" - version = ">= 0.8.0" + version = ">= 0.9.2" pod_id = 1 node_id = 101 diff --git a/modules/terraform-aci-interface-shutdown/main.tf b/modules/terraform-aci-interface-shutdown/main.tf index 2be6a657..97914d75 100644 --- a/modules/terraform-aci-interface-shutdown/main.tf +++ b/modules/terraform-aci-interface-shutdown/main.tf @@ -1,7 +1,7 @@ resource "aci_rest_managed" "fabricRsOosPath" { - dn = "uni/fabric/outofsvc/rsoosPath-[topology/pod-${var.pod_id}/paths-${var.node_id}/pathep-[eth${var.module}/${var.port}]]" + dn = var.fex_id != 0 ? "uni/fabric/outofsvc/rsoosPath-[topology/pod-${var.pod_id}/paths-${var.node_id}/extpaths-${var.fex_id}/pathep-[eth${var.module}/${var.port}]]" : (var.sub_port != 0 ? "uni/fabric/outofsvc/rsoosPath-[topology/pod-${var.pod_id}/paths-${var.node_id}/pathep-[eth${var.module}/${var.port}/${var.sub_port}]]" : "uni/fabric/outofsvc/rsoosPath-[topology/pod-${var.pod_id}/paths-${var.node_id}/pathep-[eth${var.module}/${var.port}]]") class_name = "fabricRsOosPath" content = { lc = "blacklist" } -} \ No newline at end of file +} diff --git a/modules/terraform-aci-interface-shutdown/variables.tf b/modules/terraform-aci-interface-shutdown/variables.tf index 01a530a1..6b642e3b 100644 --- a/modules/terraform-aci-interface-shutdown/variables.tf +++ b/modules/terraform-aci-interface-shutdown/variables.tf @@ -10,7 +10,7 @@ variable "pod_id" { } variable "node_id" { - description = "Interface Node ID. Minimum value: `1`. Maximum value: `4000`." + description = "Interface Node ID. Minimum value: `101`. Maximum value: `4000`." type = number validation { @@ -25,7 +25,7 @@ variable "module" { default = 1 validation { - condition = try(var.module >= 1 && var.module <= 255, false) + condition = var.module >= 1 && var.module <= 255 error_message = "Allowed values: 1-255." } } @@ -40,5 +40,24 @@ variable "port" { } } +variable "sub_port" { + description = "Interface Sub-Port. Allowed values: 1-64." + type = number + default = 0 + validation { + condition = var.sub_port >= 0 && var.sub_port <= 64 + error_message = "Allowed values: 1-64." + } +} +variable "fex_id" { + description = "Interface FEX ID. Allowed values: 101-199. `0` meaning no FEX." + type = number + default = 0 + + validation { + condition = var.fex_id == 0 || (var.fex_id >= 101 && var.fex_id <= 199) + error_message = "Allowed values: 0, 101-199." + } +} From 77399e806c7198bffefe93b810da258cdd848831 Mon Sep 17 00:00:00 2001 From: Andrew Byrne Date: Thu, 24 Oct 2024 09:17:38 +1100 Subject: [PATCH 6/7] Update variables --- modules/terraform-aci-interface-shutdown/variables.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/terraform-aci-interface-shutdown/variables.tf b/modules/terraform-aci-interface-shutdown/variables.tf index 6b642e3b..d336c9c1 100644 --- a/modules/terraform-aci-interface-shutdown/variables.tf +++ b/modules/terraform-aci-interface-shutdown/variables.tf @@ -41,13 +41,13 @@ variable "port" { } variable "sub_port" { - description = "Interface Sub-Port. Allowed values: 1-64." + description = "Interface Sub-Port. Allowed values: 1-64. `0` meaning no Sub-Port." type = number default = 0 validation { condition = var.sub_port >= 0 && var.sub_port <= 64 - error_message = "Allowed values: 1-64." + error_message = "Allowed values: 0, 1-64." } } From b0271f026a449db8d63b42863373dcf2e6251926 Mon Sep 17 00:00:00 2001 From: Andrew Byrne Date: Thu, 24 Oct 2024 09:18:13 +1100 Subject: [PATCH 7/7] Update docs --- .pre-commit-config.yaml | 4 ++++ modules/terraform-aci-interface-shutdown/README.md | 14 ++++++++------ .../examples/complete/README.md | 12 ++++++------ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ea5acaea..8eac64b7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -341,6 +341,10 @@ repos: args: ["./modules/terraform-aci-interface-configuration"] - id: terraform-docs-system args: ["./modules/terraform-aci-interface-configuration/examples/complete"] + - id: terraform-docs-system + args: ["./modules/terraform-aci-interface-shutdown"] + - id: terraform-docs-system + args: ["./modules/terraform-aci-interface-shutdown/examples/complete"] - id: terraform-docs-system args: ["./modules/terraform-aci-interface-type"] - id: terraform-docs-system diff --git a/modules/terraform-aci-interface-shutdown/README.md b/modules/terraform-aci-interface-shutdown/README.md index 344797d2..2307ada9 100644 --- a/modules/terraform-aci-interface-shutdown/README.md +++ b/modules/terraform-aci-interface-shutdown/README.md @@ -11,11 +11,11 @@ Location in GUI: ```hcl module "aci_interface_shutdown" { source = "netascode/nac-aci/aci//modules/terraform-aci-interface-shutdown" - version = ">= 0.8.0" + version = ">= 0.9.2" - pod_id = 2 + pod_id = 1 node_id = 101 - module = 2 + module = 1 port = 1 } ``` @@ -38,9 +38,11 @@ module "aci_interface_shutdown" { | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [pod\_id](#input\_pod\_id) | Interface Pod ID. Minimum value: `1`. Maximum value: `255`. | `number` | `1` | no | -| [node\_id](#input\_node\_id) | Interface Node ID. Minimum value: `1`. Maximum value: `4000`. | `number` | n/a | yes | -| [module](#input\_module) | Interface Module. Minimum value: `1`. Maximum value: `9`. | `number` | `1` | no | +| [node\_id](#input\_node\_id) | Interface Node ID. Minimum value: `101`. Maximum value: `4000`. | `number` | n/a | yes | +| [module](#input\_module) | Interface Module. Minimum value: `1`. Maximum value: `255`. | `number` | `1` | no | | [port](#input\_port) | Interface Port. Minimum value: `1`. Maximum value: `127`. | `number` | n/a | yes | +| [sub\_port](#input\_sub\_port) | Interface Sub-Port. Allowed values: 1-64. `0` meaning no Sub-Port. | `number` | `0` | no | +| [fex\_id](#input\_fex\_id) | Interface FEX ID. Allowed values: 101-199. `0` meaning no FEX. | `number` | `0` | no | ## Outputs @@ -52,5 +54,5 @@ module "aci_interface_shutdown" { | Name | Type | |------|------| -| [aci_rest_managed.infraRsPortDirection](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource | +| [aci_rest_managed.fabricRsOosPath](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource | \ No newline at end of file diff --git a/modules/terraform-aci-interface-shutdown/examples/complete/README.md b/modules/terraform-aci-interface-shutdown/examples/complete/README.md index 54a4ba44..4999754d 100644 --- a/modules/terraform-aci-interface-shutdown/examples/complete/README.md +++ b/modules/terraform-aci-interface-shutdown/examples/complete/README.md @@ -14,12 +14,12 @@ Note that this example will create resources. Resources can be destroyed with `t ```hcl module "aci_interface_shutdown" { source = "netascode/nac-aci/aci//modules/terraform-aci-interface-shutdown" - version = ">= 0.8.0" + version = ">= 0.9.2" - pod_id = 1 - node_id = 101 - module = 1 - port = 1 - } + pod_id = 1 + node_id = 101 + module = 1 + port = 1 +} ``` \ No newline at end of file