-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
373 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<!-- BEGIN_TF_DOCS --> | ||
# Terraform ACI ND Interface Policy Module | ||
|
||
Manages ACI ND Interface Policy | ||
|
||
Location in GUI: | ||
`Tenants` » `XXX` » `Policies` » `Protocol` » `ND Interface` | ||
|
||
## Examples | ||
|
||
```hcl | ||
module "aci_nd_interface_policy" { | ||
source = "netascode/nac-aci/aci//modules/terraform-aci-nd-interface-policy" | ||
version = ">= 0.8.0" | ||
tenant = "ABC" | ||
name = "ND-INTF-POL1" | ||
description = "My Description" | ||
controller_state = ["other-cfg"] | ||
hop_limit = 32 | ||
ns_tx_interval = 1000 | ||
mtu = 9000 | ||
retransmit_retry_count = 3 | ||
nud_retransmit_base = 1 | ||
nud_retransmit_interval = 2000 | ||
nud_retransmit_count = 3 | ||
route_advertise_interval = 600 | ||
router_lifetime = 3600 | ||
reachable_time = 0 | ||
retransmit_timer = 0 | ||
} | ||
``` | ||
|
||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 | | ||
| <a name="requirement_aci"></a> [aci](#requirement\_aci) | >= 2.0.0 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_aci"></a> [aci](#provider\_aci) | >= 2.0.0 | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_tenant"></a> [tenant](#input\_tenant) | Tenant name. | `string` | n/a | yes | | ||
| <a name="input_name"></a> [name](#input\_name) | ND interface policy name. | `string` | n/a | yes | | ||
| <a name="input_description"></a> [description](#input\_description) | Description. | `string` | `""` | no | | ||
| <a name="input_controller_state"></a> [controller\_state](#input\_controller_state) | Controller administrative state. Choices: `managed-cfg`, `other-cfg`, `suppress-ra`, `suppress-ra-mtu`, `unsolicit-na-glean`. | `list` | `[]` | no | | ||
| <a name="input_hop_limit"></a> [hop\_limit](#input\_hop\_limit) | Hop limit. Minimum value: 1. Maximum value: 255. | `number` | `64` | no | | ||
| <a name="input_ns_tx_interval"></a> [ns\_tx\_interval](#input\_ns\_tx\_interval) | NS transmit interval. Minimum value: 1000. Maximum value: 3600000 | `number` | `1000` | no | | ||
| <a name="input_mtu"></a> [mtu](#input\_mtu) | Maximum transmission unit. Minimum value: 1280. Maximum value: 9000. | `number` | `9000` | no | | ||
| <a name="input_retransmit_retry_count"></a> [retransmit\_retry\_count](#input\_retransmit\_retry\_count) | Retransmission retry count. Minimum value: 1. Maximum value: 100. | `number` | `3` | no | | ||
| <a name="input_nud_retransmit_base"></a> [nud\_retransmit\_base](#input\_nud\_retransmit\_base) | NUD retransmission base. Minimum value: 1. Maximum value: 3. | `number` | `1` | no | | ||
| <a name="input_nud_retransmit_interval"></a> [nud\_retransmit\_interval](#input\_nud\_retransmit\_interval) | NUD retransmission interval (msec). Minimum value: 1000. Maximum value: 10000. | `number` | `1000` | no | | ||
| <a name="input_nud_retransmit_count"></a> [nud\_retransmit\_count](#input\_nud\_retransmit\_count) | NUD retransmission count. Minimum value: 1. Maximum value: 3. | `number` | `1` | no | | ||
| <a name="input_route_advertise_interval"></a> [route\_advertise\_interval](#input\_route\_advertise\_interval) | Route advertise interval. Minimum value: 4. Maximum value: 1800. | `number` | `600` | no | | ||
| <a name="input_router_lifetime"></a> [router\_lifetime](#input\_router\_lifetime) | Router lifetime. Minimum value: 0. Maximum value: 9000. | `number` | `1800` | no | | ||
| <a name="input_reachable_time"></a> [reachable\_time](#input\_reachable\_time) | Reachable time (msec). Minimum value: 0. Maximum value: 3600000. | `number` | `0` | no | | ||
| <a name="input_retransmit_timer"></a> [retransmit\_timer](#input\_retransmit\_timer) | Retransmit timer (msec). Minimum value: 0. Maximum value: 4294967295. | `number` | `0` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_dn"></a> [dn](#output\_dn) | Distinguished name of `ndIfPol` object. | | ||
| <a name="output_name"></a> [name](#output\_name) | ND interface policy name. | | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [aci_rest_managed.ndIfPol](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/rest_managed) | resource | | ||
<!-- END_TF_DOCS --> |
24 changes: 24 additions & 0 deletions
24
modules/terraform-aci-nd-interface-policy/examples/complete/.terraform-docs.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: '>= 0.0.1' | ||
|
||
formatter: markdown table | ||
|
||
content: |- | ||
# ND Interface Policy 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 |
36 changes: 36 additions & 0 deletions
36
modules/terraform-aci-nd-interface-policy/examples/complete/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!-- BEGIN_TF_DOCS --> | ||
# ND Interface Policy 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_nd_interface_policy" { | ||
source = "netascode/nac-aci/aci//modules/terraform-aci-nd-interface-policy" | ||
version = ">= 0.8.0" | ||
tenant = "ABC" | ||
name = "ND-INTF-POL1" | ||
description = "My Description" | ||
controller_state = ["other-cfg"] | ||
hop_limit = 32 | ||
ns_tx_interval = 1000 | ||
mtu = 9000 | ||
retransmit_retry_count = 3 | ||
nud_retransmit_base = 1 | ||
nud_retransmit_interval = 2000 | ||
nud_retransmit_count = 3 | ||
route_advertise_interval = 600 | ||
router_lifetime = 3600 | ||
reachable_time = 0 | ||
retransmit_timer = 0 | ||
} | ||
``` | ||
<!-- END_TF_DOCS --> |
20 changes: 20 additions & 0 deletions
20
modules/terraform-aci-nd-interface-policy/examples/complete/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module "aci_nd_interface_policy" { | ||
source = "netascode/nac-aci/aci//modules/terraform-aci-nd-interface-policy" | ||
version = ">= 0.8.0" | ||
|
||
tenant = "ABC" | ||
name = "ND-INTF-POL1" | ||
description = "My Description" | ||
controller_state = ["other-cfg"] | ||
hop_limit = 32 | ||
ns_tx_interval = 1000 | ||
mtu = 9000 | ||
retransmit_retry_count = 3 | ||
nud_retransmit_base = 1 | ||
nud_retransmit_interval = 2000 | ||
nud_retransmit_count = 3 | ||
route_advertise_interval = 600 | ||
router_lifetime = 3600 | ||
reachable_time = 0 | ||
retransmit_timer = 0 | ||
} |
11 changes: 11 additions & 0 deletions
11
modules/terraform-aci-nd-interface-policy/examples/complete/versions.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
terraform { | ||
required_version = ">= 1.0.0" | ||
|
||
required_providers { | ||
aci = { | ||
source = "CiscoDevNet/aci" | ||
version = ">= 2.0.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
resource "aci_rest_managed" "ndIfPol" { | ||
dn = "uni/tn-${var.tenant}/ndifpol-${var.name}" | ||
class_name = "ndIfPol" | ||
content = { | ||
name = var.name | ||
descr = var.description | ||
ctrl = join(",", var.controller_state) | ||
hopLimit = var.hop_limit | ||
nsIntvl = var.ns_tx_interval | ||
mtu = var.mtu | ||
nsRetries = var.retransmit_retry_count | ||
nudRetryBase = var.nud_retransmit_base | ||
nudRetryInterval = var.nud_retransmit_interval | ||
nudRetryMaxAttempts = var.nud_retransmit_count | ||
raIntvl = var.route_advertise_interval | ||
raLifetime = var.router_lifetime | ||
reachableTime = var.reachable_time | ||
retransTimer = var.retransmit_timer | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
output "dn" { | ||
value = aci_rest_managed.ndIfPol.id | ||
description = "Distinguished name of `ndIfPol` object." | ||
} | ||
|
||
output "name" { | ||
value = aci_rest_managed.ndIfPol.content.name | ||
description = "ND interface policy name." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
variable "tenant" { | ||
description = "Tenant name." | ||
type = string | ||
|
||
validation { | ||
condition = can(regex("^[a-zA-Z0-9_.-]{0,64}$", var.tenant)) | ||
error_message = "Allowed characters: `a`-`z`, `A`-`Z`, `0`-`9`, `_`, `.`, `-`. Maximum characters: 64." | ||
} | ||
} | ||
variable "name" { | ||
description = "ND interface policy name." | ||
type = string | ||
|
||
validation { | ||
condition = can(regex("^[a-zA-Z0-9_.-]{0,64}$", var.name)) | ||
error_message = "Allowed characters: `a`-`z`, `A`-`Z`, `0`-`9`, `_`, `.`, `-`. Maximum characters: 64." | ||
} | ||
} | ||
|
||
variable "description" { | ||
description = "Description." | ||
type = string | ||
default = "" | ||
|
||
validation { | ||
condition = can(regex("^[a-zA-Z0-9\\!#$%()*,-./:;@ _{|}~?&+]{0,128}$", var.description)) | ||
error_message = "Allowed characters: `a`-`z`, `A`-`Z`, `0`-`9`, `\\`, `!`, `#`, `$`, `%`, `(`, `)`, `*`, `,`, `-`, `.`, `/`, `:`, `;`, `@`, ` `, `_`, `{`, `|`, }`, `~`, `?`, `&`, `+`. Maximum characters: 128." | ||
} | ||
} | ||
|
||
variable "controller_state" { | ||
description = "Controller administrative state." | ||
type = list(string) | ||
default = [] | ||
|
||
validation { | ||
condition = alltrue([ | ||
for state in var.controller_state : contains(["managed-cfg", "other-cfg", "suppress-ra", "suppress-ra-mtu", "unsolicit-na-glean"], state) | ||
]) | ||
error_message = "Allowed values are `managed-cfg`, `other-cfg`, `suppress-ra`, `suppress-ra-mtu`, or `unsolicit-na-glean`" | ||
} | ||
} | ||
|
||
variable "hop_limit" { | ||
description = "Detection multiplier. Minimum value: 0. Maximum value: 255." | ||
type = number | ||
default = 64 | ||
|
||
validation { | ||
condition = var.hop_limit >= 0 && var.hop_limit <= 255 | ||
error_message = "Minimum value: 0. Maximum value: 255." | ||
} | ||
} | ||
|
||
variable "ns_tx_interval" { | ||
description = "Neighbor solicitation transmit interval (msec). Minimum value: 1000. Maximum value: 3600000." | ||
type = number | ||
default = 1000 | ||
|
||
validation { | ||
condition = var.ns_tx_interval >= 50 && var.ns_tx_interval <= 3600000 | ||
error_message = "Minimum value: 1000. Maximum value: 360000." | ||
} | ||
} | ||
|
||
variable "mtu" { | ||
description = "Maximum transmission unit. Minimum value: 1280. Maximum value: 9000." | ||
type = number | ||
default = 9000 | ||
|
||
validation { | ||
condition = var.mtu >= 1280 && var.mtu <= 9000 | ||
error_message = "Minimum value: 1280. Maximum value: 9000." | ||
} | ||
} | ||
|
||
variable "retransmit_retry_count" { | ||
description = "Retransmission retry count. Minimum value: 1. Maximum value: 100." | ||
type = number | ||
default = 3 | ||
|
||
validation { | ||
condition = var.retransmit_retry_count >= 1 && var.retransmit_retry_count <= 100 | ||
error_message = "Minimum value: 1. Maximum value: 100." | ||
} | ||
} | ||
|
||
variable "nud_retransmit_base" { | ||
description = "NUD retransmission base. Minimum value: 1. Maximum value: 3." | ||
type = number | ||
default = 1 | ||
|
||
validation { | ||
condition = var.nud_retransmit_base >= 1 && var.nud_retransmit_base <= 3 | ||
error_message = "Minimum value: 1. Maximum value: 3." | ||
} | ||
} | ||
|
||
variable "nud_retransmit_interval" { | ||
description = "NUD retransmission interval (msec). Minimum value: 1000. Maximum value: 10000." | ||
type = number | ||
default = 1000 | ||
|
||
validation { | ||
condition = var.nud_retransmit_interval >= 1000 && var.nud_retransmit_interval <= 10000 | ||
error_message = "Minimum value: 1000. Maximum value: 10000." | ||
} | ||
} | ||
|
||
variable "nud_retransmit_count" { | ||
description = "NUD retransmission count. Minimum value: 3. Maximum value: 10." | ||
type = number | ||
default = 3 | ||
|
||
validation { | ||
condition = var.nud_retransmit_count >= 3 && var.nud_retransmit_count <= 10 | ||
error_message = "Minimum value: 3. Maximum value: 10." | ||
} | ||
} | ||
|
||
variable "route_advertise_interval" { | ||
description = "Route advertise interval. Minimum value: 4. Maximum value: 1800." | ||
type = number | ||
default = 600 | ||
|
||
validation { | ||
condition = var.route_advertise_interval >= 4 && var.route_advertise_interval <= 1800 | ||
error_message = "Minimum value: 4. Maximum value: 1800." | ||
} | ||
} | ||
|
||
variable "router_lifetime" { | ||
description = "Router lifetime. Minimum value: 0. Maximum value: 9000." | ||
type = number | ||
default = 1800 | ||
|
||
validation { | ||
condition = var.router_lifetime >= 0 && var.router_lifetime <= 9000 | ||
error_message = "Minimum value: 0. Maximum value: 9000." | ||
} | ||
} | ||
|
||
variable "reachable_time" { | ||
description = "Reachable time (msec). Minimum value: 0. Maximum value: 3600000." | ||
type = number | ||
default = 0 | ||
|
||
validation { | ||
condition = var.reachable_time >= 0 && var.reachable_time <= 3600000 | ||
error_message = "Minimum value: 0. Maximum value: 360000." | ||
} | ||
} | ||
|
||
variable "retransmit_timer" { | ||
description = "Retransmit timer (msec). Minimum value: 0. Maximum value: 4294967295." | ||
type = number | ||
default = 0 | ||
|
||
validation { | ||
condition = var.retransmit_timer >= 0 && var.retransmit_timer <= 4294967295 | ||
error_message = "Minimum value: 0. Maximum value: 4294967295." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
terraform { | ||
required_version = ">= 1.0.0" | ||
|
||
required_providers { | ||
aci = { | ||
source = "CiscoDevNet/aci" | ||
version = ">= 2.0.0" | ||
} | ||
} | ||
} |