# Generic smartgears_service instance module "ssh_settings" { source = "../../modules/ssh-key-ref" } module "common_variables" { source = "../../modules/common_variables" } resource "openstack_compute_instance_v2" "smartgears_service" { for_each = var.smartgears_service_instances_map name = each.value.name availability_zone_hints = module.common_variables.availability_zone_no_gpu_name flavor_name = each.value.flavor key_pair = module.ssh_settings.ssh_key_name security_groups = each.value.security_groups block_device { uuid = each.value.block_device_uuid source_type = "image" volume_size = 10 boot_index = 0 destination_type = "volume" delete_on_termination = false } dynamic "network" { for_each = each.value.networks content { name = network.value } } user_data = file("${module.common_variables.ubuntu1804_data_file}") }