resource "openstack_compute_instance_v2" "followers" { count = var.num_followers name = "terratest_follower_${count.index}" image_id = var.image_id flavor_name = var.follower_flavor key_pair = openstack_compute_keypair_v2.this.name security_groups = [openstack_networking_secgroup_v2.ssh_ping.name] network { name = openstack_networking_network_v2.private.name } } resource "openstack_networking_floatingip_v2" "followers" { count = var.num_followers pool = "public" } resource "openstack_compute_floatingip_associate_v2" "followers" { count = var.num_followers floating_ip = openstack_networking_floatingip_v2.followers[count.index].address instance_id = openstack_compute_instance_v2.followers[count.index].id connection { type = "ssh" host = openstack_networking_floatingip_v2.followers[count.index].address user = "ubuntu" agent = false private_key = file(var.private_key_file) } provisioner "remote-exec" { script = "install_numpy.sh" } } output "follower_floatingips" { value = openstack_compute_floatingip_associate_v2.followers.*.floating_ip }