terraform-provider-openstack: FloatingIP trys to attach even if it is already attached and results in error

Hi there,

Terraform Version

Terraform v0.10.2 provider-openstack_v0.2.0_x4

Affected Resource(s)

Please list the resources as a list, for example:

  • openstack_compute_floatingip_associate_v2

Terraform Configuration Files

resource "openstack_compute_floatingip_associate_v2" "fip_1" {
  count       = "${var.instance_count}"
  floating_ip = "${element(openstack_networking_floatingip_v2.fip.*.address, count.index)}"
  instance_id = "${element(openstack_compute_instance_v2.webserver.*.id, count.index)}"
}

On my current OpenStack provider, floating IP association works, but the resource is unable to realized in subsequent runs that the IP is still associated. Since the resource uses the compute API and check for the external IP adress in the addresses list returned, this isn’t working for me, since the external network is not listed. Also the APIs used in this resource are mostly marked as deprecated in OpenStack. This is also stated in this comment: https://github.com/terraform-providers/terraform-provider-openstack/blob/master/openstack/resource_openstack_compute_floatingip_associate_v2.go#L73-L75

For me, this results in Terraform trying to associate the floating IP again, which then results in an error. I don’t have that deep of an OpenStack knowledge but aren’t the API options that allow for a more generic check if a floating IP is attached?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 46 (39 by maintainers)

Most upvoted comments

Nice! Thank you both for testing 😃