terraform-oci-freestuff/a1_flex.tf
2022-12-03 14:54:36 +01:00

32 lines
811 B
HCL

resource "oci_core_instance" "a1_flex_instances" {
for_each = var.a1_flex
display_name = each.key
shape = "VM.Standard.A1.Flex"
compartment_id = var.compartment_ocid
availability_domain = data.oci_identity_availability_domains.ads.availability_domains[each.value.ad].name
# fault_domain = "FAULT-DOMAIN-3"
metadata = {
"ssh_authorized_keys" = var.ssh_key
}
create_vnic_details {
assign_public_ip = "true"
display_name = each.key
hostname_label = each.key
subnet_id = oci_core_subnet.list[each.value.vcn].id
}
shape_config {
memory_in_gbs = each.value.ram
ocpus = each.value.cpu
}
source_details {
source_id = data.oci_core_images.latest_ubuntu_image_arm_minimal.images.0.id
source_type = "image"
}
}