From 940c650177375159c51ad12249324bdbc9c448d5 Mon Sep 17 00:00:00 2001 From: Marques Johansson Date: Wed, 17 Aug 2022 14:50:44 -0400 Subject: [PATCH] replace Facilities with Metros Signed-off-by: Marques Johansson --- .github/workflows/integration.yml | 2 +- BareMetal.tf | 8 ++++---- ProviderNetwork.tf | 6 ++---- sample-arm.terraform.tfvars | 2 +- sample-gen3.terraform.tfvars | 2 +- sample.terraform.tfvars | 2 +- variables.tf | 7 +++---- 7 files changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4d4e74d..8a87dfe 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -60,7 +60,7 @@ jobs: ssh-add <(echo $METAL_SSH_PRIVATE_KEY_BASE64 | base64 -d) # Arrays of strings are hard to define via TF env vars (in yaml) - run: | - echo 'metal_facilities = ["da11"]' > terraform.tfvars + echo 'metal_metro = "da"' > terraform.tfvars echo 'metal_project_id = "${{ steps.project.outputs.projectID }}"' >> terraform.tfvars - name: Terraform Plan id: plan diff --git a/BareMetal.tf b/BareMetal.tf index 7608d5b..d42e709 100644 --- a/BareMetal.tf +++ b/BareMetal.tf @@ -48,7 +48,7 @@ resource "equinix_metal_device" "controller" { private_key = local_file.cluster_private_key_pem.content } user_data = "#cloud-config\n\nssh_authorized_keys:\n - \"${local_file.cluster_public_key.content}\"" - facilities = var.metal_facilities + metro = var.metal_metro project_id = local.metal_project_id billing_cycle = "hourly" # ip_address { @@ -71,7 +71,7 @@ resource "equinix_metal_device" "dashboard" { } user_data = "#cloud-config\n\nssh_authorized_keys:\n - \"${local_file.cluster_public_key.content}\"" - facilities = var.metal_facilities + metro = var.metal_metro project_id = local.metal_project_id billing_cycle = "hourly" } @@ -91,7 +91,7 @@ resource "equinix_metal_device" "compute-x86" { private_key = file(local_file.cluster_private_key_pem) } user_data = "#cloud-config\n\nssh_authorized_keys:\n - \"${local_file.cluster_public_key.content}\"" - facilities = var.metal_facilities + metro = var.metal_metro project_id = local.metal_project_id billing_cycle = "hourly" } @@ -111,7 +111,7 @@ resource "equinix_metal_device" "compute-arm" { private_key = file(local_file.cluster_private_key_pem) } user_data = "#cloud-config\n\nssh_authorized_keys:\n - \"${local_file.cluster_public_key.content}\"" - facilities = var.metal_facilities + metro = var.metal_metro project_id = local.metal_project_id billing_cycle = "hourly" } diff --git a/ProviderNetwork.tf b/ProviderNetwork.tf index 02c6003..c356c20 100644 --- a/ProviderNetwork.tf +++ b/ProviderNetwork.tf @@ -4,8 +4,7 @@ # use private IPv4 addresses to save precious Internet resources data "equinix_metal_precreated_ip_block" "private_ipv4" { - - facility = equinix_metal_device.controller.deployed_facility + metro = equinix_metal_device.controller.metro project_id = local.metal_project_id address_family = 4 public = false @@ -22,8 +21,7 @@ resource "equinix_metal_ip_attachment" "controller_private_ipv4" { # ipv6 is free so let's go crazy data "equinix_metal_precreated_ip_block" "public_ipv6" { - - facility = equinix_metal_device.controller.deployed_facility + metro = equinix_metal_device.controller.metro project_id = local.metal_project_id address_family = 6 public = true diff --git a/sample-arm.terraform.tfvars b/sample-arm.terraform.tfvars index b12919a..dcbfc5f 100644 --- a/sample-arm.terraform.tfvars +++ b/sample-arm.terraform.tfvars @@ -11,4 +11,4 @@ metal_compute-arm_type = "c3.large.arm64" openstack_compute-arm_count = 1 openstack_compute-x86_count = 0 -metal_facilities = ["ewr1"] +metal_metro = "da" diff --git a/sample-gen3.terraform.tfvars b/sample-gen3.terraform.tfvars index 73c6afa..a19145d 100644 --- a/sample-gen3.terraform.tfvars +++ b/sample-gen3.terraform.tfvars @@ -11,4 +11,4 @@ metal_compute-x86_type = "s3.xlarge.x86" openstack_compute-arm_count = 1 openstack_compute-x86_count = 1 -metal_facilities = ["dfw2"] +metal_metro = "da" diff --git a/sample.terraform.tfvars b/sample.terraform.tfvars index b567a98..efb7c55 100644 --- a/sample.terraform.tfvars +++ b/sample.terraform.tfvars @@ -14,4 +14,4 @@ metal_compute-x86_type = "n3.xlarge.x86" openstack_compute-arm_count = 1 openstack_compute-x86_count = 1 -metal_facilities = ["sjc1"] +metal_metro = "da" diff --git a/variables.tf b/variables.tf index 6c924ea..249aecf 100644 --- a/variables.tf +++ b/variables.tf @@ -2,10 +2,9 @@ variable "metal_auth_token" { description = "Your metal API key" } -# for best results deploy all hosts in the same facility - list a single facility -variable "metal_facilities" { - description = "Metal facilities: US East(ewr1), US West(sjc1), Tokyo (nrt1) or EU(ams1). Default: ewr1" - default = ["sjc1"] +variable "metal_metro" { + description = "Metal Metro (https://metal.equinix.com/developers/docs/locations/metros/)" + default = "da" } variable "metal_project_id" {