Skip to content

Commit

Permalink
Prepare Module for Publishing (#12)
Browse files Browse the repository at this point in the history
* Move terraform block to versions.tf file with version arguments

* Terraform fmt repo

* Add usage to examples README.md's

* Add base README.md to module for publishing
  • Loading branch information
thogarty authored Dec 1, 2023
1 parent fd18306 commit 4bbfe03
Show file tree
Hide file tree
Showing 69 changed files with 1,283 additions and 320 deletions.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# terraform-equinix-fabric
[![Maintainer](https://img.shields.io/badge/maintained%20by-equinix-red?style=flat-square)](https://www.equinix.com/)
[![License](https://img.shields.io/github/license/equinix/terraform-equinix-fabric?style=flat-square)](LICENSE)
[![Release](https://img.shields.io/github/v/release/equinix/terraform-equinix-fabric?style=flat-square)](https://github.com/equinix/terraform-equinix-fabric/releases)
[![Terraform version](https://img.shields.io/badge/terraform-%3E%3D1.5.4-623CE4.svg?style=flat-square&logo=terraform)](https://github.com/hashicorp/terraform)
[![Terraform registry](https://img.shields.io/badge/terraform-registry-623CE4.svg?style=flat-square&logo=terraform)](https://registry.terraform.io/modules/equinix/terraform-equinix-fabric)

Initial Content Fill. TODO: Create Modules and Migrate Examples to use of Modules
> This is a empty module that houses multiple submodules for Equinix Fabric Terraform usage.
### Modules

This repository consists in a collection of modules that will accelerate your adoption of Equinix Terraform for Fabric use cases.
Each module is fully independent and it is dedicated to be used as its own module. They are placed here for organization of
all of Fabric's use cases as well as efficient discovery and selection of the product offerings outside of the base Fabric
Data Sources and Resources.

Each module has:

* Terraform source code to be used as a module
* README.md file containing instructions and specific notes to work with the module

### Examples

Each example is a specific use case in Equinix Fabric that the specific sub-module can be used for. Each example has the following:

* Terraform code leveraging the module for a simple use case
* Example definition of .tfvars file
* README.md explaining multiple ways the example can be leveraged.
47 changes: 47 additions & 0 deletions examples/cloud-router-2-aws-connection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## Usage

*Note:* This example creates resources which cost money. Run 'terraform destroy' when you don't need these resources.

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

```bash
git clone https://github.com/equinix/terraform-equinix-fabric.git
cd terraform-equinix-fabric/examples/cloud-router-2-aws-connection
terraform init
terraform apply
```

To use this example of the module in your own terraform configuration outside of the repo include the following:

```hcl
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}
module "cloud_router_aws_connection" {
source = "equinix/fabric/equinix//modules/cloud-router-connection"
connection_name = var.connection_name
connection_type = var.connection_type
notifications_type = var.notifications_type
notifications_emails = var.notifications_emails
additional_info = [{ key = "accessKey", value = var.aws_access_key }, { key = "secretKey", value = var.aws_secret_key }]
bandwidth = var.bandwidth
purchase_order_number = var.purchase_order_number
#Aside
aside_fcr_uuid = var.aside_fcr_uuid
aside_ap_type = var.aside_ap_type
#Zside
zside_ap_type = var.zside_ap_type
zside_ap_authentication_key = var.zside_ap_authentication_key
zside_ap_profile_type = var.zside_ap_profile_type
zside_location = var.zside_location
zside_seller_region = var.zside_seller_region
zside_fabric_sp_name = var.zside_fabric_sp_name
}
```
8 changes: 0 additions & 8 deletions examples/cloud-router-2-aws-connection/main.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
terraform {
required_providers {
equinix = {
source = "equinix/equinix"
}
}
}

provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
Expand Down
9 changes: 9 additions & 0 deletions examples/cloud-router-2-aws-connection/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.5.4"
required_providers {
equinix = {
source = "equinix/equinix"
version = ">= 1.20.0"
}
}
}
47 changes: 47 additions & 0 deletions examples/cloud-router-2-azure-connection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## Usage

*Note:* This example creates resources which cost money. Run 'terraform destroy' when you don't need these resources.

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

```bash
git clone https://github.com/equinix/terraform-equinix-fabric.git
cd terraform-equinix-fabric/examples/cloud-router-2-azure-connection
terraform init
terraform apply
```

To use this example of the module in your own terraform configuration include the following
(You must also have variables/values defined and have the contents of versions.tf somewhere in your config):

```hcl
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}
module "cloud_router_azure_connection" {
source = "equinix/fabric/equinix//modules/cloud-router-connection"
connection_name = var.connection_name
connection_type = var.connection_type
notifications_type = var.notifications_type
notifications_emails = var.notifications_emails
bandwidth = var.bandwidth
purchase_order_number = var.purchase_order_number
#Aside
aside_ap_type = var.aside_ap_type
aside_fcr_uuid = var.aside_fcr_uuid
#Zside
zside_ap_type = var.zside_ap_type
zside_ap_authentication_key = var.zside_ap_authentication_key
zside_ap_profile_type = var.zside_ap_profile_type
zside_location = var.zside_location
zside_peering_type = var.zside_peering_type
zside_fabric_sp_name = var.zside_fabric_sp_name
}
```
8 changes: 0 additions & 8 deletions examples/cloud-router-2-azure-connection/main.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
terraform {
required_providers {
equinix = {
source = "equinix/equinix"
}
}
}

provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
Expand Down
9 changes: 9 additions & 0 deletions examples/cloud-router-2-azure-connection/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.5.4"
required_providers {
equinix = {
source = "equinix/equinix"
version = ">= 1.20.0"
}
}
}
52 changes: 52 additions & 0 deletions examples/cloud-router-2-azure-redundant-connection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## Usage

*Note:* This example creates resources which cost money. Run 'terraform destroy' when you don't need these resources.

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

```bash
git clone https://github.com/equinix/terraform-equinix-fabric.git
cd terraform-equinix-fabric/examples/cloud-router-2-azure-redundant-connection
terraform init
terraform apply
```

To use this example of the module in your own terraform configuration outside of the repo include the following:

```hcl
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}
module "cloud_router_azure_redundant_connection" {
source = "equinix/fabric/equinix//modules/cloud-router-connection"
#Primary Connection
connection_name = var.connection_name
connection_type = var.connection_type
notifications_type = var.notifications_type
notifications_emails = var.notifications_emails
bandwidth = var.bandwidth
purchase_order_number = var.purchase_order_number
#Aside
aside_ap_type = var.aside_ap_type
aside_fcr_uuid = var.aside_fcr_uuid
#Zside
zside_ap_type = var.zside_ap_type
zside_ap_authentication_key = var.zside_ap_authentication_key
zside_ap_profile_type = var.zside_ap_profile_type
zside_location = var.zside_location
zside_fabric_sp_name = var.zside_fabric_sp_name
zside_peering_type = var.zside_peering_type
#Secondary-Connection
secondary_connection_name = var.secondary_connection_name
secondary_bandwidth = var.secondary_bandwidth
aside_sec_fcr_uuid = var.aside_sec_fcr_uuid
}
```
14 changes: 3 additions & 11 deletions examples/cloud-router-2-azure-redundant-connection/main.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
terraform {
required_providers {
equinix = {
source = "equinix/equinix"
}
}
}

provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
Expand Down Expand Up @@ -35,7 +27,7 @@ module "cloud_router_azure_redundant_connection" {
zside_peering_type = var.zside_peering_type

#Secondary-Connection
secondary_connection_name = var.secondary_connection_name
secondary_bandwidth = var.secondary_bandwidth
aside_sec_fcr_uuid = var.aside_sec_fcr_uuid
secondary_connection_name = var.secondary_connection_name
secondary_bandwidth = var.secondary_bandwidth
aside_sec_fcr_uuid = var.aside_sec_fcr_uuid
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.5.4"
required_providers {
equinix = {
source = "equinix/equinix"
version = ">= 1.20.0"
}
}
}
46 changes: 46 additions & 0 deletions examples/cloud-router-2-gcp-connection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## Usage

*Note:* This example creates resources which cost money. Run 'terraform destroy' when you don't need these resources.

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

```bash
git clone https://github.com/equinix/terraform-equinix-fabric.git
cd terraform-equinix-fabric/examples/cloud-router-2-gcp-connection
terraform init
terraform apply
```

To use this example of the module in your own terraform configuration outside of the repo include the following:

```hcl
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}
module "cloud_router_gcp_connection" {
source = "equinix/fabric/equinix//modules/cloud-router-connection"
connection_name = var.connection_name
connection_type = var.connection_type
notifications_type = var.notifications_type
notifications_emails = var.notifications_emails
bandwidth = var.bandwidth
purchase_order_number = var.purchase_order_number
#Aside
aside_ap_type = var.aside_ap_type
aside_fcr_uuid = var.aside_fcr_uuid
#Zside
zside_ap_type = var.zside_ap_type
zside_ap_authentication_key = var.zside_ap_authentication_key
zside_ap_profile_type = var.zside_ap_profile_type
zside_location = var.zside_location
zside_seller_region = var.zside_seller_region
zside_fabric_sp_name = var.zside_fabric_sp_name
}
```
8 changes: 0 additions & 8 deletions examples/cloud-router-2-gcp-connection/main.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
terraform {
required_providers {
equinix = {
source = "equinix/equinix"
}
}
}

provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
Expand Down
9 changes: 9 additions & 0 deletions examples/cloud-router-2-gcp-connection/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.5.4"
required_providers {
equinix = {
source = "equinix/equinix"
version = ">= 1.20.0"
}
}
}
47 changes: 47 additions & 0 deletions examples/cloud-router-2-oracle-connection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## Usage

*Note:* This example creates resources which cost money. Run 'terraform destroy' when you don't need these resources.

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

```bash
git clone https://github.com/equinix/terraform-equinix-fabric.git
cd terraform-equinix-fabric/examples/cloud-router-2-oracle-connection
terraform init
terraform apply
```

To use this example of the module in your own terraform configuration outside of the repo include the following:

```hcl
provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
}
module "cloud_router_oracle_connection" {
source = "equinix/fabric/equinix//modules/cloud-router-connection"
connection_name = var.connection_name
connection_type = var.connection_type
notifications_type = var.notifications_type
notifications_emails = var.notifications_emails
bandwidth = var.bandwidth
purchase_order_number = var.purchase_order_number
#Aside
aside_ap_type = var.aside_ap_type
aside_fcr_uuid = var.aside_fcr_uuid
#Zside
zside_ap_type = var.zside_ap_type
zside_ap_authentication_key = var.zside_ap_authentication_key
zside_ap_profile_type = var.zside_ap_profile_type
zside_location = var.zside_location
zside_peering_type = var.zside_peering_type
zside_seller_region = var.zside_seller_region
zside_fabric_sp_name = var.zside_fabric_sp_name
}
```
8 changes: 0 additions & 8 deletions examples/cloud-router-2-oracle-connection/main.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
terraform {
required_providers {
equinix = {
source = "equinix/equinix"
}
}
}

provider "equinix" {
client_id = var.equinix_client_id
client_secret = var.equinix_client_secret
Expand Down
9 changes: 9 additions & 0 deletions examples/cloud-router-2-oracle-connection/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.5.4"
required_providers {
equinix = {
source = "equinix/equinix"
version = ">= 1.20.0"
}
}
}
Loading

0 comments on commit 4bbfe03

Please sign in to comment.