Skip to content

Commit

Permalink
addressed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kpdhulipala committed Jun 12, 2024
1 parent 3617ce3 commit e6ed76a
Show file tree
Hide file tree
Showing 17 changed files with 729 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/c8000v-ha/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module "c8000v_ha" {
enabled = true
metro_code = var.metro_code_secondary
hostname = "c8000v-sec"
account_number = "664566"
account_number = "123456"
additional_bandwidth = 50
acl_template_id = equinix_network_acl_template.c8000v_sec.id
}
Expand Down
65 changes: 65 additions & 0 deletions examples/vmware-sdwan-ha/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Network Edge VMWare Velocloud SDWAN HA Device Example

This example demonstrates creation of Network Edge VMWare Velocloud SDWAN HA device. It will:

- Create a ACL template
- Provision VMWare Velocloud SDWAN HA device

## Usage

To provision this example, you should clone the github repository and run terraform from within this directory:

```bash
git clone https://github.com/equinix/terraform-equinix-network-edge.git
cd terraform-equinix-network-edge/examples/vmware-sdwan-ha
terraform init
terraform apply
```

Note that this example may create resources which cost money. Run 'terraform destroy' when you don't need these
resources.

<!-- TEMPLATE: The following block has been generated by terraform-docs util: https://github.com/terraform-docs/terraform-docs -->
<!-- BEGIN_TF_DOCS -->

## Requirements

| Name | Version |
|---------------------------------------------------------------------------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_equinix"></a> [equinix](#requirement\_equinix) | >= 1.34 |

## Providers

| Name | Version |
|---------------------------------------------------------------|---------|
| <a name="provider_equinix"></a> [equinix](#provider\_equinix) | >= 1.34 |

## Modules

| Name | Source | Version |
|-----------------------------------------------------------------------------------|----------------------------------|---------|
| <a name="module_velocloud_sdwan"></a> [velocloud-sdwan](#module\_velocloud-sdwan) | ../../../modules/velocloud-sdwan | n/a |

## Resources

| Name | Type |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|
| [equinix_network_acl_template.velocloud_sdwan_pri](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/equinix_network_acl_template) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|-------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|---------|:--------:|
| <a name="input_equinix_client_id"></a> [equinix\_client\_id](#input\_equinix\_client\_id) | API Consumer Key available under 'My Apps' in developer portal. This argument can also be specified with the EQUINIX\_API\_CLIENTID shell environment variable. | `string` | n/a | yes |
| <a name="input_equinix_client_secret"></a> [equinix\_client\_secret](#input\_equinix\_client\_secret) | API Consumer secret available under 'My Apps' in developer portal. This argument can also be specified with the EQUINIX\_API\_CLIENTSECRET shell environment variable. | `string` | n/a | yes |
| <a name="input_metro_code_primary"></a> [metro\_code\_primary](#input\_metro\_code\_primary) | Device location metro code for primary | `string` | n/a | yes |
| <a name="input_metro_code_secondary"></a> [metro\_code\_primary](#input\_metro\_code\_secondary) | Device location metro code for secondary | `string` | n/a | yes |

## Outputs

| Name | Description |
|----------------------------------------------------------------------------------|------------------------|
| <a name="output_device_details"></a> [device\_details](#output\_device\_details) | Virtual device details |

<!-- END_TF_DOCS -->
60 changes: 60 additions & 0 deletions examples/vmware-sdwan-ha/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}

module "vmware_sdwan_ha" {
source = "../../modules/velocloud-sdwan"
name = "tf-vmware-sdwan"
metro_code = var.metro_code_primary
platform = "small"
account_number = "123456"
project_id = "e6be59d9-62c0-4140-aad6-150f0700203c"
software_package = "VMware-2"
version_number = "4.3.0"
term_length = 1
notifications = ["[email protected]"]
additional_bandwidth = 100
acl_template_id = equinix_network_acl_template.velocloud_sdwan_pri.id
vendor_configuration = {
activationKey = "xxxx-xxxx-xxxx-xxxx"
controllerFqdn = "test.test.test"
rootPassword = "xxxxxxxxxxx"
}
secondary = {
enabled = true
metro_code = var.metro_code_secondary
account_number = "123456"
name = "custom-secondary-name"
additional_bandwidth = 100
acl_template_id = equinix_network_acl_template.velocloud_sdwan_sec.id
vendor_configuration = {
activationKey = "xxxx-xxxx-xxxx-xxxx"
controllerFqdn = "test.test.test"
rootPassword = "xxxxxxxxxxxx"
}
}
}

resource "equinix_network_acl_template" "velocloud_sdwan_pri" {
name = "tf-velocloud-sdwan-pri"
description = "Primary velocloud sdwan ACL template"
project_id = "e6be59d9-62c0-4140-aad6-150f0700203c"
inbound_rule {
subnet = "12.16.103.0/24"
protocol = "TCP"
src_port = "any"
dst_port = "22"
}
}

resource "equinix_network_acl_template" "velocloud_sdwan_sec" {
name = "tf-velocloud-sdwan-sec"
description = "Secondary VMWare SD-WAN ACL template"
inbound_rule {
subnet = "193.39.0.0/16"
protocol = "TCP"
src_port = "any"
dst_port = "22"
}
}
4 changes: 4 additions & 0 deletions examples/vmware-sdwan-ha/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "device_details" {
description = "Virtual device details"
value = module.vmware_sdwan_ha
}
19 changes: 19 additions & 0 deletions examples/vmware-sdwan-ha/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
variable "equinix_client_id" {
type = string
description = "API Consumer Key available under 'My Apps' in developer portal. This argument can also be specified with the EQUINIX_API_CLIENTID shell environment variable."
}

variable "equinix_client_secret" {
type = string
description = "API Consumer secret available under 'My Apps' in developer portal. This argument can also be specified with the EQUINIX_API_CLIENTSECRET shell environment variable."
}

variable "metro_code_primary" {
description = "Device location metro code"
type = string
}

variable "metro_code_secondary" {
description = "Device location metro code"
type = string
}
9 changes: 9 additions & 0 deletions examples/vmware-sdwan-ha/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.3"
required_providers {
equinix = {
source = "equinix/equinix"
version = ">= 1.34"
}
}
}
64 changes: 64 additions & 0 deletions examples/vmware-sdwan-single/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Network Edge VMWare Velocloud SDWAN Single Device Example

This example demonstrates creation of Network Edge VMWare Velocloud SDWAN Single device. It will:

- Create a ACL template
- Provision VMWare Velocloud SDWAN Single device

## Usage

To provision this example, you should clone the github repository and run terraform from within this directory:

```bash
git clone https://github.com/equinix/terraform-equinix-network-edge.git
cd terraform-equinix-network-edge/examples/vmware-sdwan-single
terraform init
terraform apply
```

Note that this example may create resources which cost money. Run 'terraform destroy' when you don't need these
resources.

<!-- TEMPLATE: The following block has been generated by terraform-docs util: https://github.com/terraform-docs/terraform-docs -->
<!-- BEGIN_TF_DOCS -->

## Requirements

| Name | Version |
|---------------------------------------------------------------------------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_equinix"></a> [equinix](#requirement\_equinix) | >= 1.34 |

## Providers

| Name | Version |
|---------------------------------------------------------------|---------|
| <a name="provider_equinix"></a> [equinix](#provider\_equinix) | >= 1.34 |

## Modules

| Name | Source | Version |
|-----------------------------------------------------------------------------------|----------------------------------|---------|
| <a name="module_velocloud-sdwan"></a> [velocloud-sdwan](#module\_velocloud-sdwan) | ../../../modules/velocloud-sdwan | n/a |

## Resources

| Name | Type |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|
| [equinix_network_acl_template.velocloud_sdwan_pri](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/equinix_network_acl_template) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|-------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|---------|:--------:|
| <a name="input_equinix_client_id"></a> [equinix\_client\_id](#input\_equinix\_client\_id) | API Consumer Key available under 'My Apps' in developer portal. This argument can also be specified with the EQUINIX\_API\_CLIENTID shell environment variable. | `string` | n/a | yes |
| <a name="input_equinix_client_secret"></a> [equinix\_client\_secret](#input\_equinix\_client\_secret) | API Consumer secret available under 'My Apps' in developer portal. This argument can also be specified with the EQUINIX\_API\_CLIENTSECRET shell environment variable. | `string` | n/a | yes |
| <a name="input_metro_code_primary"></a> [metro\_code\_primary](#input\_metro\_code\_primary) | Device location metro code | `string` | n/a | yes |

## Outputs

| Name | Description |
|----------------------------------------------------------------------------------|------------------------|
| <a name="output_device_details"></a> [device\_details](#output\_device\_details) | Virtual device details |

<!-- END_TF_DOCS -->
36 changes: 36 additions & 0 deletions examples/vmware-sdwan-single/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}

module "vmware_sdwan_single" {
source = "../../modules/velocloud-sdwan"
name = "tf-vmware-sdwan"
account_number = "123456"
project_id = "e6be59d9-62c0-4140-aad6-150f0700203c"
metro_code = var.metro_code_primary
platform = "small"
version_number = "4.3.0"
software_package = "VMware-2"
term_length = 1
notifications = ["[email protected]"]
additional_bandwidth = 100
acl_template_id = equinix_network_acl_template.velocloud_sdwan_pri.id
vendor_configuration = {
activationKey = "xxxxx-xxxx-xxxx-xxxx"
controllerFqdn = "test.test.test"
rootPassword = "xxxxxxxxxxxx"
}
}

resource "equinix_network_acl_template" "velocloud_sdwan_pri" {
name = "tf-velocloud-sdwan-pri"
description = "Primary velocloud sdwan ACL template"
project_id = "e6be59d9-62c0-4140-aad6-150f0700203c"
inbound_rule {
subnet = "12.16.103.0/24"
protocol = "TCP"
src_port = "any"
dst_port = "22"
}
}
4 changes: 4 additions & 0 deletions examples/vmware-sdwan-single/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
output "device_details" {
description = "Virtual device details"
value = module.vmware_sdwan_single
}
14 changes: 14 additions & 0 deletions examples/vmware-sdwan-single/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
variable "equinix_client_id" {
type = string
description = "API Consumer Key available under 'My Apps' in developer portal. This argument can also be specified with the EQUINIX_API_CLIENTID shell environment variable."
}

variable "equinix_client_secret" {
type = string
description = "API Consumer secret available under 'My Apps' in developer portal. This argument can also be specified with the EQUINIX_API_CLIENTSECRET shell environment variable."
}

variable "metro_code_primary" {
description = "Device location metro code"
type = string
}
9 changes: 9 additions & 0 deletions examples/vmware-sdwan-single/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.3"
required_providers {
equinix = {
source = "equinix/equinix"
version = ">= 1.34"
}
}
}
2 changes: 1 addition & 1 deletion modules/c8000v/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ variable "secondary" {
error_message = "Key 'additional_bandwidth' has to be between 25 and 5001 Mbps."
}
validation {
condition = !try(var.secondary.enabled, false) || try(var.secondary.acl_template_id != null, true)
condition = !try(var.secondary.enabled, false) || try(var.secondary.acl_template_id != null, false)
error_message = "Secondary Acl template is required."
}
}
Loading

0 comments on commit e6ed76a

Please sign in to comment.