Skip to content

Commit

Permalink
Updates module to use project name rather than ID, creates if does no…
Browse files Browse the repository at this point in the history
…t exist, references it via datasource if it does.

Signed-off-by: Joseph Marhee <[email protected]>
  • Loading branch information
jmarhee committed Mar 21, 2024
1 parent 9121818 commit ee3b278
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions kubernetes-controller-pool.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ resource "equinix_metal_ssh_key" "kubernetes-on-metal" {
}

resource "equinix_metal_reserved_ip_block" "kubernetes" {
project_id = var.metal_create_project ? equinix_metal_project.new_project[0].id : var.metal_create_project ? equinix_metal_project.new_project[0].id : data.equinix_metal_project.project.project_id
project_id = var.metal_create_project ? equinix_metal_project.new_project[0].id : data.equinix_metal_project.project.project_id
metro = var.metro != "" ? var.metro : null
quantity = 4
}
Expand All @@ -45,7 +45,7 @@ module "controllers" {
metro = var.metro
cluster_name = var.cluster_name
kubernetes_lb_block = equinix_metal_reserved_ip_block.kubernetes.cidr_notation
project_id = var.metal_create_project ? equinix_metal_project.new_project[0].id : var.metal_create_project ? equinix_metal_project.new_project[0].id : data.equinix_metal_project.project.project_id
project_id = var.metal_create_project ? equinix_metal_project.new_project[0].id : data.equinix_metal_project.project.project_id
auth_token = var.auth_token
secrets_encryption = var.secrets_encryption
configure_ingress = var.configure_ingress
Expand Down
4 changes: 2 additions & 2 deletions kubernetes-node-pool.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module "node_pool_blue" {
metro = var.metro
cluster_name = var.cluster_name
controller_address = module.controllers.controller_addresses
project_id = var.metal_create_project ? equinix_metal_project.new_project[0].id : var.metal_create_project ? equinix_metal_project.new_project[0].id : data.equinix_metal_project.project.project_id
project_id = var.metal_create_project ? equinix_metal_project.new_project[0].id : data.equinix_metal_project.project.project_id
storage = var.storage
ccm_enabled = var.ccm_enabled

Expand All @@ -28,7 +28,7 @@ module "node_pool_gpu_green" {
metro = var.metro
cluster_name = var.cluster_name
controller_address = module.controllers.controller_addresses
project_id = var.metal_create_project ? equinix_metal_project.new_project[0].id : var.metal_create_project ? equinix_metal_project.new_project[0].id : data.equinix_metal_project.project.project_id
project_id = var.metal_create_project ? equinix_metal_project.new_project[0].id : data.equinix_metal_project.project.project_id
storage = var.storage
ccm_enabled = var.ccm_enabled
}

0 comments on commit ee3b278

Please sign in to comment.