-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathcompute.tf
61 lines (48 loc) · 1.41 KB
/
compute.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
resource "oci_core_instance" "ubuntu_oci_instance" {
agent_config {
is_management_disabled = "false"
is_monitoring_disabled = "false"
plugins_config {
desired_state = "DISABLED"
name = "Vulnerability Scanning"
}
plugins_config {
desired_state = "ENABLED"
name = "Compute Instance Monitoring"
}
plugins_config {
desired_state = "DISABLED"
name = "Bastion"
}
}
availability_config {
recovery_action = "RESTORE_INSTANCE"
}
availability_domain = var.availability_domain
compartment_id = var.compartment_ocid
fault_domain = var.default_fault_domain
create_vnic_details {
assign_private_dns_record = true
assign_public_ip = var.is_private == true ? false : true
subnet_id = var.is_private == true ? var.private_subnet_id : var.public_subnet_id
}
display_name = "Ubuntu Instance"
instance_options {
are_legacy_imds_endpoints_disabled = false
}
is_pv_encryption_in_transit_enabled = true
metadata = {
"ssh_authorized_keys" = file(var.PATH_TO_PUBLIC_KEY)
"user_data" = data.cloudinit_config.ubuntu_init.rendered
}
shape = var.shape
shape_config {
memory_in_gbs = var.memory_in_gbs
ocpus = var.ocpus
}
source_details {
source_id = var.os_image_id
source_type = "image"
}
freeform_tags = local.tags
}