-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for imported l4l7 device
- Loading branch information
Showing
15 changed files
with
258 additions
and
1 deletion.
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
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
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
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
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
34 changes: 34 additions & 0 deletions
34
modules/terraform-aci-imported-l4l7-device/.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,34 @@ | ||
version: '>= 0.14.0' | ||
|
||
formatter: markdown table | ||
|
||
content: |- | ||
# Terraform ACI Imported L4L7 Device Module | ||
ACI Imported L4L7 Device | ||
Location in GUI: | ||
`Tenants` » `XXX` » `Services` » `L4-L7` » `Imported Devices` | ||
## Examples | ||
```hcl | ||
{{ include "./examples/complete/main.tf" }} | ||
``` | ||
{{ .Requirements }} | ||
{{ .Providers }} | ||
{{ .Inputs }} | ||
{{ .Outputs }} | ||
{{ .Resources }} | ||
output: | ||
file: README.md | ||
mode: replace | ||
|
||
sort: | ||
enabled: false |
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,56 @@ | ||
<!-- BEGIN_TF_DOCS --> | ||
# Terraform ACI Imported L4L7 Device Module | ||
|
||
ACI Imported L4L7 Device | ||
|
||
Location in GUI: | ||
`Tenants` » `XXX` » `Services` » `L4-L7` » `Imported Devices` | ||
|
||
## Examples | ||
|
||
```hcl | ||
module "aci_imported_l4l7_device" { | ||
source = "netascode/nac-aci/aci//modules/terraform-aci-imported-l4l7-device" | ||
version = ">= 0.8.1" | ||
tenant = "ABC" | ||
source_tenant = "DEF" | ||
source_device = "DEV1" | ||
description = "My imported device" | ||
} | ||
``` | ||
|
||
## 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_source_tenant"></a> [source\_tenant](#input\_source\_tenant) | Source device tenant name. | `string` | n/a | yes | | ||
| <a name="input_source_device"></a> [source\_device](#input\_source\_device) | L4L7 device name to be imported. | `string` | n/a | yes | | ||
| <a name="input_description"></a> [description](#input\_description) | Imported device description. | `string` | `""` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_dn"></a> [dn](#output\_dn) | Distinguished name of `vnsLDevIf` object. | | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [aci_rest_managed.vnsLDevIf](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-imported-l4l7-device/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.14.0' | ||
|
||
formatter: markdown table | ||
|
||
content: |- | ||
# Imported L4L7 Device 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 |
25 changes: 25 additions & 0 deletions
25
modules/terraform-aci-imported-l4l7-device/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,25 @@ | ||
<!-- BEGIN_TF_DOCS --> | ||
# Imported L4L7 Device 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_imported_l4l7_device" { | ||
source = "netascode/nac-aci/aci//modules/terraform-aci-imported-l4l7-device" | ||
version = ">= 0.8.1" | ||
tenant = "ABC" | ||
source_tenant = "DEF" | ||
source_device = "DEV1" | ||
description = "My imported device" | ||
} | ||
``` | ||
<!-- END_TF_DOCS --> |
9 changes: 9 additions & 0 deletions
9
modules/terraform-aci-imported-l4l7-device/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,9 @@ | ||
module "aci_imported_l4l7_device" { | ||
source = "netascode/nac-aci/aci//modules/terraform-aci-imported-l4l7-device" | ||
version = ">= 0.8.1" | ||
|
||
tenant = "ABC" | ||
source_tenant = "DEF" | ||
source_device = "DEV1" | ||
description = "My imported device" | ||
} |
11 changes: 11 additions & 0 deletions
11
modules/terraform-aci-imported-l4l7-device/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,8 @@ | ||
resource "aci_rest_managed" "vnsLDevIf" { | ||
dn = "uni/tn-${var.tenant}/lDevIf-[uni/tn-${var.source_tenant}/lDevVip-${var.source_device}]" | ||
class_name = "vnsLDevIf" | ||
content = { | ||
ldev = "uni/tn-${var.source_tenant}/lDevVip-${var.source_device}]" | ||
description = var.description | ||
} | ||
} |
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,4 @@ | ||
output "dn" { | ||
value = aci_rest_managed.vnsLDevIf.id | ||
description = "Distinguished name of `vnsLDevIf` object." | ||
} |
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,40 @@ | ||
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 "source_tenant" { | ||
description = "Source device tenant name." | ||
type = string | ||
|
||
validation { | ||
condition = can(regex("^[a-zA-Z0-9_.-]{0,64}$", var.source_tenant)) | ||
error_message = "Allowed characters: `a`-`z`, `A`-`Z`, `0`-`9`, `_`, `.`, `-`. Maximum characters: 64." | ||
} | ||
} | ||
|
||
variable "source_device" { | ||
description = "L4L7 device name to be imported." | ||
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 = "Imported device 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." | ||
} | ||
} |
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" | ||
} | ||
} | ||
} |