terraformer icon indicating copy to clipboard operation
terraformer copied to clipboard

Alternating value in OpenStack resources access_ip_v4 attribute

Open martonivan opened this issue 1 year ago • 1 comments

We are using Terraformer to have a snapshot of our current OpenStack infrastructure in Terraform format and an automated job keeps it up to date.

We've realized that the in case of resources that have multiple interfaces (with different IPv4 addresses), this leads to an alternating value of the access_ip_v4 attribute. It seems like the address is randomly selected from the available values.

resource "openstack_compute_instance_v2" "tfer--machine" {
  access_ip_v4      = "<1.2.3.4 or 10.2.3.4 depending on the dice roll>"
  access_ip_v6      = "<The single IPv6 address from below>"
  availability_zone = "nova"
  flavor_id         = "[Random UUID]"
  flavor_name       = "small"
  image_id          = "[Random UUID]"
  image_name        = "Image not found"
  key_pair          = "super secret"
  name              = "machine"

  network {
    access_network = "false"
    fixed_ip_v4    = "10.2.3.4"
    name           = "mgmt"
  }

  network {
    access_network = "false"
    fixed_ip_v4    = "1.2.3.4"
    fixed_ip_v6    = "<IPv6 address>"
    name           = "Ext-Net"
  }

  power_state     = "active"
  region          = "REGION"
  security_groups = ["default"]
}

Is this something decided in Terraformer, which one to use, or is it the OpenStack API that returns alternating values?

martonivan avatar Dec 20 '23 13:12 martonivan

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Feb 20 '24 01:02 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Feb 29 '24 01:02 github-actions[bot]