Newer
Older
# is created in internal-network module and called in root module
variable "internal_subnet_id" {type = string}
# is created in key-pair module and called in root module
variable "key_pair" {type = "string"}
# creates compute node
resource "openstack_compute_instance_v2" "c0" {
depends_on = [var.internal_subnet_id]
name = "c${count.index}"
image_name = var.image_compute
flavor_name = var.flavor
security_groups = ["default"]
count = var.compute_node_count
# defines the networks of the instance
network {
name = var.internal_net
}
}