-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
173 lines (155 loc) · 5.18 KB
/
main.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# Main instance
resource "oci_core_instance" "dokploy_main" {
display_name = "dokploy-main-${random_string.resource_code.result}"
compartment_id = var.compartment_id
availability_domain = var.availability_domain_main
is_pv_encryption_in_transit_enabled = local.instance_config.is_pv_encryption_in_transit_enabled
shape = local.instance_config.shape
metadata = {
ssh_authorized_keys = local.instance_config.ssh_authorized_keys
user_data = base64encode(file("./bin/dokploy-main.sh"))
}
create_vnic_details {
display_name = "dokploy-main-${random_string.resource_code.result}"
subnet_id = oci_core_subnet.dokploy_subnet.id
assign_ipv6ip = false
assign_private_dns_record = true
assign_public_ip = true
}
availability_config {
recovery_action = local.instance_config.availability_config.recovery_action
}
instance_options {
are_legacy_imds_endpoints_disabled = local.instance_config.instance_options.are_legacy_imds_endpoints_disabled
}
shape_config {
memory_in_gbs = local.instance_config.shape_config.memory_in_gbs
ocpus = local.instance_config.shape_config.ocpus
}
source_details {
source_id = local.instance_config.source_details.source_id
source_type = local.instance_config.source_details.source_type
}
agent_config {
is_management_disabled = "false"
is_monitoring_disabled = "false"
plugins_config {
desired_state = "DISABLED"
name = "Vulnerability Scanning"
}
plugins_config {
desired_state = "DISABLED"
name = "Management Agent"
}
plugins_config {
desired_state = "ENABLED"
name = "Custom Logs Monitoring"
}
plugins_config {
desired_state = "DISABLED"
name = "Compute RDMA GPU Monitoring"
}
plugins_config {
desired_state = "ENABLED"
name = "Compute Instance Monitoring"
}
plugins_config {
desired_state = "DISABLED"
name = "Compute HPC RDMA Auto-Configuration"
}
plugins_config {
desired_state = "DISABLED"
name = "Compute HPC RDMA Authentication"
}
plugins_config {
desired_state = "ENABLED"
name = "Cloud Guard Workload Protection"
}
plugins_config {
desired_state = "DISABLED"
name = "Block Volume Management"
}
plugins_config {
desired_state = "DISABLED"
name = "Bastion"
}
}
}
# Worker instances (similar to main instance)
resource "oci_core_instance" "dokploy_worker" {
count = var.num_worker_instances
display_name = "dokploy-worker-${count.index + 1}-${random_string.resource_code.result}"
compartment_id = var.compartment_id
availability_domain = var.availability_domain_workers
is_pv_encryption_in_transit_enabled = local.instance_config.is_pv_encryption_in_transit_enabled
shape = local.instance_config.shape
metadata = {
ssh_authorized_keys = local.instance_config.ssh_authorized_keys
user_data = base64encode(file("./bin/dokploy-worker.sh"))
}
create_vnic_details {
display_name = "dokploy-worker-${count.index + 1}-${random_string.resource_code.result}"
subnet_id = oci_core_subnet.dokploy_subnet.id
assign_ipv6ip = false
assign_private_dns_record = true
assign_public_ip = true
}
availability_config {
recovery_action = local.instance_config.availability_config.recovery_action
}
instance_options {
are_legacy_imds_endpoints_disabled = local.instance_config.instance_options.are_legacy_imds_endpoints_disabled
}
shape_config {
memory_in_gbs = local.instance_config.shape_config.memory_in_gbs
ocpus = local.instance_config.shape_config.ocpus
}
source_details {
source_id = local.instance_config.source_details.source_id
source_type = local.instance_config.source_details.source_type
}
agent_config {
is_management_disabled = "false"
is_monitoring_disabled = "false"
plugins_config {
desired_state = "DISABLED"
name = "Vulnerability Scanning"
}
plugins_config {
desired_state = "DISABLED"
name = "Management Agent"
}
plugins_config {
desired_state = "ENABLED"
name = "Custom Logs Monitoring"
}
plugins_config {
desired_state = "DISABLED"
name = "Compute RDMA GPU Monitoring"
}
plugins_config {
desired_state = "ENABLED"
name = "Compute Instance Monitoring"
}
plugins_config {
desired_state = "DISABLED"
name = "Compute HPC RDMA Auto-Configuration"
}
plugins_config {
desired_state = "DISABLED"
name = "Compute HPC RDMA Authentication"
}
plugins_config {
desired_state = "ENABLED"
name = "Cloud Guard Workload Protection"
}
plugins_config {
desired_state = "DISABLED"
name = "Block Volume Management"
}
plugins_config {
desired_state = "DISABLED"
name = "Bastion"
}
}
}