Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: onboarding Aviatrix edge 7.1 device #38

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions examples/aviatrix-edge-7.1-ha/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Network Edge Device Aviatrix Edge 7.1 HA Device Example

This example demonstrates creation of Network Edge Aviatrix Edge 7.1 HA device. It will:

- Create a ACL template
- Upload Aviatrix bootstrap file
- Provision Aviatrix Edge 7.1 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/aviatrix-edge-7.1-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.

<!-- 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="aviatrix-edge-7.1-single_ha"></a> [Aviatrix_Edge_7.1-ha](#aviatrix-edge-7.1-single_ha) | ../../modules/Aviatrix Edge 7.1 | n/a |

## Resources

| Name | Type |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| [equinix_network_acl_template.aviatrix_edge_7_1_ha_wan_acl_template](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/equinix_network_acl_template) | resource |
| [equinix_network_file.aviatrix_edge_7_1_ha_bootstrap_file](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/equinix_network_file) | 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 -->
68 changes: 68 additions & 0 deletions examples/aviatrix-edge-7.1-ha/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}

module "aviatrix_edge_7_1" {
source = "../../modules/aviatrix-edge-7.1"
name = "terraform-test-aviatrix-edge-7.1-primary"
metro_code = data.equinix_network_account.ny.metro_code
account_number = data.equinix_network_account.ny.number
platform = "small"
software_package = "STD"
vnf_version = 7.1
project_id = "c9a8e930-5f54-4d8b-8e4d-0fc2c3f034af"
term_length = 1
notifications = ["[email protected]"]
additional_bandwidth = 50
cloud_init_file_id = equinix_network_file.aviatrix_edge_7_1_ha_bootstrap_file.uuid
acl_template_id = equinix_network_acl_template.aviatrix_edge_7_1_ha_wan_acl_template.id

secondary = {
name = "terraform-test-aviatrix-edge-7.1-secondary"
enabled = true
metro_code = var.metro_code_secondary
cloud_init_file_id = equinix_network_file.aviatrix_edge_7_1_ha_bootstrap_file_sec.uuid
acl_template_id = equinix_network_acl_template.aviatrix_edge_7_1_ha_wan_acl_template.id
account_number = data.equinix_network_account.ny.number
}

}


resource "equinix_network_acl_template" "aviatrix_edge_7_1_ha_wan_acl_template" {
name = "tf-aviatrix-edge-7.1-ha-wan-acl"
description = "Primary aviatrix-edge-7.1 wan ACL template"
inbound_rule {
subnet = "0.0.0.0/0"
protocol = "TCP"
src_port = "any"
dst_port = "22"
}
}

resource "equinix_network_file" "aviatrix_edge_7_1_ha_bootstrap_file" {
file_name = "aviatrix.txt"
content = file("${path.module}/../../files/aviatrix-edge-7.1/aviatrix.txt")
metro_code = var.metro_code_primary
device_type_code = "AVIATRIX_EDGE"
process_type = "CLOUD_INIT"
self_managed = true
byol = true
}

resource "equinix_network_file" "aviatrix_edge_7_1_ha_bootstrap_file_sec" {
file_name = "aviatrix.txt"
content = file("${path.module}/../../files/aviatrix-edge-7.1/aviatrix.txt")
metro_code = var.metro_code_secondary
device_type_code = "AVIATRIX_EDGE"
process_type = "CLOUD_INIT"
self_managed = true
byol = true
}

data "equinix_network_account" "ny" {
name = "test"
metro_code = "NY"
project_id = "c9a8e930-5f54-4d8b-8e4d-0fc2c3f034af"
}
4 changes: 4 additions & 0 deletions examples/aviatrix-edge-7.1-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.aviatrix_edge_7_1
}
17 changes: 17 additions & 0 deletions examples/aviatrix-edge-7.1-ha/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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 = "Primary device location metro code"
type = string
}
variable "metro_code_secondary" {
description = "Secondary device location metro code"
type = string
}
9 changes: 9 additions & 0 deletions examples/aviatrix-edge-7.1-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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make it >=1.34 to keep it consistent across modules.

}
}
}
61 changes: 61 additions & 0 deletions examples/aviatrix-edge-7.1-private-connectivity-ha/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Network Edge Device Aviatrix Edge 7.1 Private connectivity Single Device Example

This example demonstrates creation of Network Edge Aviatrix Edge 7.1 HA device with private connectivity. It will:

- Upload Aviatrix bootstrap file
- Provision Aviatrix Edge 7.1 single device with private connectivity

## 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/aviatrix-edge-7.1-private-connectivity-ha
```

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

<!-- 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 |
| ---------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | --------- |
| | | |
| [Aviatrix_Edge_7.1aviatrix-edge-7.1-private-connectivity-ha](#aviatrix-edge-7.1-aviatrix-edge-7.1-private-connectivity-ha) | ../../modules/Aviatrix Edge 7.1<br /> | n/a |

## Resources

| Name | Type |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| [equinix_network_file.aviatrix_edge_7_1_bootstrap_file](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/equinix_network_file) | 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 -->
54 changes: 54 additions & 0 deletions examples/aviatrix-edge-7.1-private-connectivity-ha/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}

module "aviatrix_edge_7_1" {
source = "../../modules/aviatrix-edge-7.1"
name = "terraform-test-aviatrix-edge-7.1-primary"
metro_code = data.equinix_network_account.ny.metro_code
account_number = data.equinix_network_account.ny.number
platform = "small"
software_package = "STD"
vnf_version = 7.1
project_id = "c9a8e930-5f54-4d8b-8e4d-0fc2c3f034af"
term_length = 1
connectivity = "PRIVATE"
notifications = ["[email protected]"]
additional_bandwidth = 50
cloud_init_file_id = equinix_network_file.aviatrix_edge_7_1_bootstrap_file.uuid

secondary = {
enabled = true
name = "terraform-test-aviatrix-edge-7.1-secondary"
metro_code = var.metro_code_secondary
cloud_init_file_id = equinix_network_file.aviatrix_edge_7_1_ha_bootstrap_file_sec.uuid
account_number = data.equinix_network_account.ny.number
}
}

resource "equinix_network_file" "aviatrix_edge_7_1_bootstrap_file" {
file_name = "aviatrix.txt"
content = file("${path.module}/../../files/aviatrix-edge-7.1/aviatrix.txt")
metro_code = var.metro_code_primary
device_type_code = "AVIATRIX_EDGE"
process_type = "CLOUD_INIT"
self_managed = true
byol = true
}

data "equinix_network_account" "ny" {
name = "test"
metro_code = "NY"
project_id = "c9a8e930-5f54-4d8b-8e4d-0fc2c3f034af"
}

resource "equinix_network_file" "aviatrix_edge_7_1_ha_bootstrap_file_sec" {
file_name = "aviatrix.txt"
content = file("${path.module}/../../files/aviatrix-edge-7.1/aviatrix.txt")
metro_code = var.metro_code_secondary
device_type_code = "AVIATRIX_EDGE"
process_type = "CLOUD_INIT"
self_managed = true
byol = true
}
4 changes: 4 additions & 0 deletions examples/aviatrix-edge-7.1-private-connectivity-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.aviatrix_edge_7_1
}
17 changes: 17 additions & 0 deletions examples/aviatrix-edge-7.1-private-connectivity-ha/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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 = "Primary device location metro code"
type = string
}
variable "metro_code_secondary" {
description = "Secondary device location metro code"
type = string
}
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

}
}
}
60 changes: 60 additions & 0 deletions examples/aviatrix-edge-7.1-private-connectivity-single/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Network Edge Device Aviatrix Edge 7.1 Private connectivity Single Device Example

This example demonstrates creation of Network Edge Aviatrix Edge 7.1 single device with private connectivity. It will:

- Upload Aviatrix bootstrap file
- Provision Aviatrix Edge 7.1 single device with private connectivity

## 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/aviatrix-edge-7.1-private-connectivity-single
```

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

<!-- 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 |
| ------------------------------------------------------------------------------------------------- | --------------------------------------- | --------- |
| [Aviatrix_Edge_7.1-private-connectivity-single](#aviatrix-edge-7.1-private-connectivity-single) | ../../modules/Aviatrix Edge 7.1<br /> | n/a |

## Resources

| Name | Type |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| [equinix_network_file.aviatrix_edge_7_1_bootstrap_file](https://registry.terraform.io/providers/equinix/equinix/latest/docs/resources/equinix_network_file) | 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 -->
Loading
Loading