From 7ce2dc67fa47e7c06b7ffa2f04cf3a39cfbeb9e8 Mon Sep 17 00:00:00 2001 From: Oscar Cobles Date: Fri, 22 Jul 2022 13:50:48 +0200 Subject: [PATCH] update provider version and improve provider config in examples --- examples/fabric-port-connection/README.md | 4 +-- examples/fabric-port-connection/main.tf | 18 ++++++++++--- examples/fabric-port-connection/variables.tf | 25 +++++++++++++++---- examples/fabric-port-connection/versions.tf | 2 +- .../network-edge-device-connection/README.md | 2 +- .../network-edge-device-connection/main.tf | 16 +++++++++--- .../variables.tf | 22 ++++++++++++++-- .../versions.tf | 2 +- versions.tf | 2 +- 9 files changed, 73 insertions(+), 20 deletions(-) diff --git a/examples/fabric-port-connection/README.md b/examples/fabric-port-connection/README.md index 129f8b2..e575dfc 100644 --- a/examples/fabric-port-connection/README.md +++ b/examples/fabric-port-connection/README.md @@ -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. diff --git a/examples/fabric-port-connection/main.tf b/examples/fabric-port-connection/main.tf index 76c6b94..4651dc6 100644 --- a/examples/fabric-port-connection/main.tf +++ b/examples/fabric-port-connection/main.tf @@ -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 = ["example@equinix.com"] # optional variables - fabric_port_name = var.port_name + fabric_port_name = var.fabric_port_name fabric_vlan_stag = 1010 fabric_destination_metro_code = "FR" } diff --git a/examples/fabric-port-connection/variables.tf b/examples/fabric-port-connection/variables.tf index bc8c20d..df396e9 100644 --- a/examples/fabric-port-connection/variables.tf +++ b/examples/fabric-port-connection/variables.tf @@ -1,12 +1,27 @@ -variable "project_name" { +variable "equinix_provider_client_id" { type = string - description = "The default GCP project to manage resources in." + description = <