forked from garutilorenzo/oracle-cloud-terraform-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compute.tf
63 lines (50 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
62
63
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 = "true"
subnet_id = oci_core_subnet.default_oci_core_subnet10.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.template_cloudinit_config.ubuntu_init.rendered
}
shape = "VM.Standard.A1.Flex"
shape_config {
memory_in_gbs = "6"
ocpus = "1"
}
source_details {
source_id = var.os_image_id
source_type = "image"
}
freeform_tags = {
"${var.tutorial_tag_key}" = "${var.tutorial_tag_value}"
}
}