You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

65 lines
2.4 KiB

resource "oci_core_instance" "lon-matrix-bridges-g0" {
availability_domain = "JnpY:UK-LONDON-1-AD-3"
compartment_id = var.compartment_ocid
display_name = "lon-matrix-bridges-g0"
shape = "VM.Standard.A1.Flex"
# preserve the volume if instance is deleted
preserve_boot_volume = true
source_details {
source_type = "image"
# https://docs.oracle.com/en-us/iaas/images/ubuntu-2004/
source_id = "ocid1.image.oc1.uk-london-1.aaaaaaaaajga6k2rnywbyuyvwpw446vcfcokumn4ddrjpdvrddqhhlfvanuq"
boot_volume_size_in_gbs = "50"
}
metadata = {
ssh_authorized_keys = var.ssh_public_key
}
timeouts {
create = "60m"
}
agent_config {
are_all_plugins_disabled = true
is_management_disabled = true
is_monitoring_disabled = true
}
create_vnic_details {
assign_public_ip = true
private_ip = var.lon_instances_ips["lon-matrix-bridges-g0"]
skip_source_dest_check = true
subnet_id = oci_core_subnet.sshonly.id
display_name = "lon-matrix-bridges-g0_vnic"
hostname_label = "lon-matrix-bridges-g0"
#nsg_ids = [ oci_core_security_list.ssh.id ]
}
shape_config {
memory_in_gbs = "6"
ocpus = "1"
}
}
# terraform import "oci_core_vnic_attachment.lon-matrix-bridges-g0_vnic" ocid1.vnicattachment.oc1.uk-london-1.anwgiljsyefuk7ycqco7uueex7n3yzwlenaxlh2rthm4dszrqwcfgsur4enq
resource "oci_core_vnic_attachment" "lon-matrix-bridges-g0_vnic" {
instance_id = oci_core_instance.lon-matrix-bridges-g0.id
create_vnic_details {
assign_public_ip = true
private_ip = var.lon_instances_ips["lon-matrix-bridges-g0"]
skip_source_dest_check = true
subnet_id = oci_core_subnet.sshonly.id
display_name = "lon-matrix-bridges-g0_vnic"
hostname_label = "lon-matrix-bridges-g0"
}
}
# terraform import "oci_core_private_ip.lon-matrix-bridges-g0" ocid1.privateip.oc1.uk-london-1.abwgiljsdbqpvyvgyczxzqtdqndalgibmcc4vbocklvbji2v4fuzk2idrifq
resource "oci_core_private_ip" "lon-matrix-bridges-g0" {
ip_address = var.lon_instances_ips["lon-matrix-bridges-g0"]
vnic_id = oci_core_vnic_attachment.lon-matrix-bridges-g0_vnic.vnic_id
}
# data "oci_core_private_ip" "imported_lon-matrix-bridges-g0" {
# private_ip_id = "ocid1.privateip.oc1.uk-london-1.abwgiljsswdgcav62ktbc4lgu3dctjd5y7534hkusyhl67el57pce3p3arpq"
# }