Skip to content

Commit

Permalink
fix: primary Virtual Network Interface will be named after the VSI it…
Browse files Browse the repository at this point in the history
… is associated with (#751)
  • Loading branch information
Aashiq-J authored Nov 19, 2024
1 parent 11b4e9d commit c45ceff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ data "ibm_is_vpc" "vpc" {
##############################################################################
resource "ibm_is_virtual_network_interface" "primary_vni" {
for_each = { for vsi_key, vsi_value in local.vsi_map : vsi_key => vsi_value if !var.use_legacy_network_interface }
name = "${each.key}-vni"
name = "${each.value.vsi_name}-vni"
subnet = each.value.subnet_id
security_groups = flatten([
(var.create_security_group ? [ibm_is_security_group.security_group[var.security_group.name].id] : []),
Expand Down Expand Up @@ -229,7 +229,7 @@ resource "ibm_is_instance" "vsi" {
dynamic "primary_network_attachment" {
for_each = var.use_legacy_network_interface ? [] : [1]
content {
name = "${each.value.subnet_name}-eth0"
name = ibm_is_virtual_network_interface.primary_vni[each.key].name
virtual_network_interface {
id = ibm_is_virtual_network_interface.primary_vni[each.key].id
}
Expand Down

0 comments on commit c45ceff

Please sign in to comment.