-
Notifications
You must be signed in to change notification settings - Fork 0
/
instances.tf
90 lines (75 loc) · 2.35 KB
/
instances.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
resource "oci_core_instance" "instance1" {
availability_domain = data.oci_identity_availability_domains.ads.availability_domains[0].name
compartment_id = local.availability_domain
display_name = "instance1"
shape = "VM.Standard.E2.1.Micro"
shape_config {
ocpus = 1
memory_in_gbs = 1
}
source_details {
source_type = "image"
source_id = local.ubuntu2204ocid
}
metadata = {
ssh_authorized_keys = local.ssh_pubkey_data
}
preserve_boot_volume = false
create_vnic_details {
assign_public_ip = true
subnet_id = oci_core_subnet.main_subnet.id
# Security group here to allow incoming connections
nsg_ids = [oci_core_network_security_group.my_security_group_http.id, ]
}
}
resource "oci_core_instance" "instance2" {
availability_domain = data.oci_identity_availability_domains.ads.availability_domains[0].name
compartment_id = local.availability_domain
display_name = "instance2"
shape = "VM.Standard.E2.1.Micro"
shape_config {
ocpus = 1
memory_in_gbs = 1
}
source_details {
source_type = "image"
source_id = local.ubuntu2204ocid
}
metadata = {
ssh_authorized_keys = local.ssh_pubkey_data
}
preserve_boot_volume = false
create_vnic_details {
assign_public_ip = true
subnet_id = oci_core_subnet.main_subnet.id
# Security group here to allow incoming connections
nsg_ids = [oci_core_network_security_group.my_security_group_http.id, ]
}
}
resource "oci_core_instance" "instance3" {
availability_domain = data.oci_identity_availability_domains.ads.availability_domains[0].name
compartment_id = local.availability_domain
display_name = "instance3"
shape = "VM.Standard.A1.Flex"
shape_config {
ocpus = 4
memory_in_gbs = 24
}
source_details {
source_type = "image"
source_id = local.ubuntu2204_arm_ocid
}
metadata = {
ssh_authorized_keys = local.ssh_pubkey_data
}
preserve_boot_volume = false
create_vnic_details {
assign_public_ip = true
subnet_id = oci_core_subnet.main_subnet.id
# Security group here to allow incoming connections
nsg_ids = [
oci_core_network_security_group.my_security_group_http.id,
oci_core_network_security_group.my_security_group_wg_vpn.id,
]
}
}