Skip to content

Instantly share code, notes, and snippets.

@f4rx
Created January 22, 2020 15:03
Show Gist options
  • Save f4rx/7fa46eca87f52bb1477dc812177eba8a to your computer and use it in GitHub Desktop.
Save f4rx/7fa46eca87f52bb1477dc812177eba8a to your computer and use it in GitHub Desktop.
count terraform
resource "openstack_networking_port_v2" "port" {
count = "${var.server_count}"
name = "node-${count.index}-eth0"
...
}
resource "openstack_blockstorage_volume_v3" "volume" {
count = "${var.server_count}"
name = "volume-for-node-${count.index}"
...
}
resource "openstack_compute_instance_v2" "node" {
count = "${var.server_count}"
name = "node-${count.index}"
...
network {
port = "${openstack_networking_port_v2.port[count.index].id}"
}
block_device {
uuid = "${openstack_blockstorage_volume_v3.volume[count.index].id}"
...
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment