-
Notifications
You must be signed in to change notification settings - Fork 17
/
compute.tf
72 lines (64 loc) · 1.99 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
64
65
66
67
68
69
70
71
72
data "oci_identity_availability_domains" "ads" {
compartment_id = var.oci_compartment_id
}
data "oci_core_images" "ampere-ubuntu-images" {
compartment_id = var.oci_compartment_id
operating_system = "Canonical Ubuntu"
operating_system_version = "20.04"
shape = "VM.Standard.A1.Flex"
sort_by = "TIMECREATED"
sort_order = "DESC"
}
resource "oci_core_instance" "oracle-arm" {
display_name = "oracle-arm"
compartment_id = var.oci_compartment_id
shape = data.oci_core_images.ampere-ubuntu-images.shape
shape_config {
memory_in_gbs = "24"
ocpus = "4"
}
source_details {
boot_volume_size_in_gbs = "200"
# Platform Image: Ubuntu 20.04
# source_id = "ocid1.image.oc1.iad.aaaaaaaa2tex34yxzqunbwnfnat6pkh2ztqchvfyygnnrhfv7urpbhozdw2a"
source_id = data.oci_core_images.ampere-ubuntu-images.images[0].id
source_type = "image"
}
metadata = {
"user_data" = base64encode(
templatefile(
"userdata.tpl.yaml",
{
github_user = var.github_user,
tailscale_auth_key = var.tailscale_auth_key,
}
)
)
}
create_vnic_details {
assign_private_dns_record = "true"
assign_public_ip = "true" # this instance has a Public IP
hostname_label = "oracle-arm"
subnet_id = oci_core_subnet.subnet_0.id
}
availability_config {
recovery_action = "RESTORE_INSTANCE"
}
availability_domain = data.oci_identity_availability_domains.ads.availability_domains[0].name
instance_options {
are_legacy_imds_endpoints_disabled = "false"
}
is_pv_encryption_in_transit_enabled = "true"
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"
}
}
}