Skip to content

Commit

Permalink
update provider version and improve provider config in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar Cobles committed Jul 22, 2022
1 parent 2c5b4d0 commit 7ce2dc6
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 20 deletions.
4 changes: 2 additions & 2 deletions examples/fabric-port-connection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

This example demonstrates usage of the Equinix Connection GCP module to establish a non-redundant Equinix Fabric L2 Connection from a Equinix Fabric port to Google Cloud Interconnect. It will:

- Use VPC 'default'.
- Use project specified in provider.
- Use an existing GCP project.
- Use 'default' VPC.
- Create a Google Cloud Router.
- Create a Google Cloud Interconnect/VLAN Attachment.
- Create an Equinix Fabric l2 connection with minimun available bandwidth for Google Cloud service profile.
Expand Down
18 changes: 14 additions & 4 deletions examples/fabric-port-connection/main.tf
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
provider "equinix" {}
# Configure the Equinix Provider
# Please refer to provider documentation for details on supported authentication methods and parameters.
# https://registry.terraform.io/providers/equinix/equinix/latest/docs
provider "equinix" {
client_id = var.equinix_provider_client_id
client_secret = var.equinix_provider_client_secret
}

# Configure the Google Cloud Platform Provider
# https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/getting_started#adding-credentials
provider "google" {
project = var.project_name
project = var.gcp_project
# 'region' and 'fabric_destination_metro_code' must correspond to same location.
# If unspecified, it will use the default region configured with gcloud CLI.
region = "europe-west3"
}

module "equinix-fabric-connection-gcp" {
source = "github.com/equinix-labs/terraform-equinix-fabric-connection-gcp"
source = "equinix-labs/fabric-connection-gcp/equinix"

# required variables
fabric_notification_users = ["[email protected]"]

# optional variables
fabric_port_name = var.port_name
fabric_port_name = var.fabric_port_name
fabric_vlan_stag = 1010
fabric_destination_metro_code = "FR"
}
25 changes: 20 additions & 5 deletions examples/fabric-port-connection/variables.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
variable "project_name" {
variable "equinix_provider_client_id" {
type = string
description = "The default GCP project to manage resources in."
description = <<EOF
API Consumer Key available under 'My Apps' in developer portal. This argument can also be specified with the
EQUINIX_API_CLIENTID shell environment variable.
EOF
default = null
}

variable "port_name" {
variable "equinix_provider_client_secret" {
type = string
description = <<EOF
Name of the [Equinix Fabric port](https://docs.equinix.com/en-us/Content/Interconnection/Fabric/ports/Fabric-port-details.htm)
from which the connection would originate.
API Consumer secret available under 'My Apps' in developer portal. This argument can also be specified with the
EQUINIX_API_CLIENTSECRET shell environment variable.
EOF
default = null
}

variable "gcp_project" {
type = string
description = "(Required) Name of the GCP project to manage resources in."
}

variable "fabric_port_name" {
type = string
description = "(Required) Name of the [Equinix Fabric port](https://docs.equinix.com/en-us/Content/Interconnection/Fabric/ports/Fabric-port-details.htm) from which the connection would originate."
}
2 changes: 1 addition & 1 deletion examples/fabric-port-connection/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
equinix = {
source = "equinix/equinix"
version = ">= 1.5.0"
version = ">= 1.7.0"
}
google = {
source = "hashicorp/google"
Expand Down
2 changes: 1 addition & 1 deletion examples/network-edge-device-connection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

This example demonstrates usage of the Equinix Connection GCP module to establish a non-redundant Equinix Fabric L2 Connection from a Equinix Network Edge device to Google Cloud Interconnect. It will:

- Use an existing GCP project.
- Use 'default' VPC.
- Use the `project` specified in provider.
- Create a Google Cloud Router.
- Create a Google Cloud Interconnect/VLAN Attachment.
- Create Equinix Fabric l2 connection with 200 Mbps bandwidth.
Expand Down
16 changes: 13 additions & 3 deletions examples/network-edge-device-connection/main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
provider "equinix" {}
# Configure the Equinix Provider
# Please refer to provider documentation for details on supported authentication methods and parameters.
# https://registry.terraform.io/providers/equinix/equinix/latest/docs
provider "equinix" {
client_id = var.equinix_provider_client_id
client_secret = var.equinix_provider_client_secret
}

# Configure the Google Cloud Platform Provider
# https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/getting_started#adding-credentials
provider "google" {
project = var.project_name
project = var.gcp_project
# 'region' and 'fabric_destination_metro_code' must correspond to same location.
# If unspecified, it will use the default region configured with gcloud CLI.
region = "europe-west3"
}

module "equinix-fabric-connection-gcp" {
source = "github.com/equinix-labs/terraform-equinix-fabric-connection-gcp"
source = "equinix-labs/fabric-connection-gcp/equinix"

# required variables
fabric_notification_users = ["[email protected]"]
Expand Down
22 changes: 20 additions & 2 deletions examples/network-edge-device-connection/variables.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
variable "project_name" {
variable "equinix_provider_client_id" {
type = string
description = "The default GCP project to manage resources in."
description = <<EOF
API Consumer Key available under 'My Apps' in developer portal. This argument can also be specified with the
EQUINIX_API_CLIENTID shell environment variable.
EOF
default = null
}

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

variable "gcp_project" {
type = string
description = "(Required) Name of the GCP project to manage resources in."
}

variable "device_id" {
Expand Down
2 changes: 1 addition & 1 deletion examples/network-edge-device-connection/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
equinix = {
source = "equinix/equinix"
version = ">= 1.5.0"
version = ">= 1.7.0"
}
google = {
source = "hashicorp/google"
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
equinix = {
source = "equinix/equinix"
version = ">= 1.5.0"
version = ">= 1.7.0"
}
google = {
source = "hashicorp/google"
Expand Down

0 comments on commit 7ce2dc6

Please sign in to comment.