terraform-oci-freestuff/e2_micro.tf

32 lines
790 B
Terraform
Raw Normal View History

2022-12-03 13:54:36 +00:00
resource "oci_core_instance" "e2_micro_instances" {
for_each = var.e2_micro
display_name = each.key
shape = "VM.Standard.E2.1.Micro"
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 = 1
ocpus = 1
}
source_details {
source_id = data.oci_core_images.latest_ubuntu_image_amd_minimal.images.0.id
source_type = "image"
}
}