Skip to content

Commit

Permalink
Merge pull request #67 from rancherlabs/equinix-tf-1.34.1
Browse files Browse the repository at this point in the history
Bump equinix terraform provider to v1.34.1 and revert workaround. Bump GH actions to terraform v1.8.0
  • Loading branch information
devenkulkarni authored Apr 11, 2024
2 parents cdc2f16 + 17abc7d commit c832b8a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ghactions-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.7.5
terraform_version: 1.8.0

- name: Terraform Format Check
run: terraform fmt -diff -check -recursive
Expand Down
13 changes: 6 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
locals {
project_id = var.metal_create_project ? equinix_metal_project.new_project[0].id : data.equinix_metal_project.project.project_id
metro = lower(var.metro)
}

// IP attachment to be added to seed node, and this is subsequently assigned as Harvester vip
Expand All @@ -22,7 +21,7 @@ resource "equinix_metal_project" "new_project" {

resource "equinix_metal_reserved_ip_block" "harvester_vip" {
project_id = local.project_id
metro = local.metro
metro = var.metro
type = "public_ipv4"
quantity = 1
}
Expand All @@ -31,7 +30,7 @@ resource "equinix_metal_device" "seed" {
hostname = "${var.hostname_prefix}-1"
count = var.node_count >= 1 && !var.spot_instance ? 1 : 0
plan = var.plan
metro = local.metro
metro = var.metro
operating_system = "custom_ipxe"
billing_cycle = var.billing_cylce
project_id = local.project_id
Expand All @@ -44,7 +43,7 @@ resource "equinix_metal_spot_market_request" "seed_spot_request" {
count = var.node_count >= 1 && var.spot_instance ? 1 : 0
project_id = local.project_id
max_bid_price = var.max_bid_price
metro = local.metro
metro = var.metro
devices_min = 1
devices_max = 1
wait_for_devices = true
Expand All @@ -69,7 +68,7 @@ resource "equinix_metal_device" "join" {
hostname = "${var.hostname_prefix}-${count.index + 2}"
count = var.spot_instance ? 0 : var.node_count - 1
plan = var.plan
metro = local.metro
metro = var.metro
operating_system = "custom_ipxe"
billing_cycle = var.billing_cylce
project_id = local.project_id
Expand All @@ -82,7 +81,7 @@ resource "equinix_metal_spot_market_request" "join_spot_request" {
count = var.spot_instance ? var.node_count - 1 : 0
project_id = local.project_id
max_bid_price = var.max_bid_price
metro = local.metro
metro = var.metro
devices_min = 1
devices_max = 1
wait_for_devices = true
Expand All @@ -101,7 +100,7 @@ resource "equinix_metal_vlan" "vlans" {
count = var.num_of_vlans
description = "VLAN for ${var.hostname_prefix}"
project_id = local.project_id
metro = local.metro
metro = var.metro
}

resource "equinix_metal_port_vlan_attachment" "vlan_attach_seed" {
Expand Down
2 changes: 1 addition & 1 deletion provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
equinix = {
source = "equinix/equinix"
version = "1.34.0"
version = "1.34.1"
}
rancher2 = {
source = "rancher/rancher2"
Expand Down

0 comments on commit c832b8a

Please sign in to comment.