-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
152 lines (134 loc) · 3.61 KB
/
variables.tf
File metadata and controls
152 lines (134 loc) · 3.61 KB
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
variable "droplet_name" {
description = "The name of the droplet"
type = string
}
variable "droplet_size" {
description = "Droplet size (ex: s-1vcpu-1gb, s-2vcpu-2gb, etc)"
type = string
default = "s-1vcpu-1gb"
}
variable "droplet_image" {
description = "Base image of the droplet"
type = string
default = "ubuntu-22-04-x64"
}
variable "region" {
description = "Region where the droplet will be created"
type = string
}
variable "vpc_id" {
description = "VPC ID where the droplet will be placed"
type = string
default = null
}
variable "enable_ipv6" {
description = "Enable IPv6 for the droplet"
type = bool
default = false
}
variable "floating_ip" {
description = "ID for a Floating IP assigned to the droplet"
type = string
default = null
}
# SSH Keys
variable "ssh_keys" {
description = "List of IDs or fingerprints for the droplet access"
type = list(string)
default = []
}
# Configuración adicional
variable "user_data" {
description = "cloud-init script for droplet startup"
type = string
default = null
}
variable "tags" {
description = "Tag list applied to the droplet and the firewall"
type = list(string)
default = []
}
variable "project_id" {
description = "Project ID where the resources will be assigned"
type = string
default = null
}
# Opciones de respaldo y monitoreo
variable "enable_monitoring" {
description = "Enable droplet monitoring"
type = bool
default = true
}
variable "enable_backups" {
description = "Enable automatic backups"
type = bool
default = false
}
variable "droplet_agent" {
description = "Install DigitalOcean agent"
type = bool
default = true
}
variable "graceful_shutdown" {
description = "Enable graceful shutdown"
type = bool
default = true
}
variable "resize_disk" {
description = "Resize disk on droplet shape change"
type = bool
default = true
}
# Variables del Firewall
variable "inbound_rules" {
description = "Inbound rules"
type = list(object({
protocol = string
port_range = optional(string)
source_addresses = optional(list(string))
source_droplet_ids = optional(list(string))
source_tags = optional(list(string))
source_load_balancer_uids = optional(list(string))
source_kubernetes_ids = optional(list(string))
}))
default = [
{
protocol = "tcp"
port_range = "22"
source_addresses = ["0.0.0.0/0", "::/0"]
}
]
}
variable "outbound_rules" {
description = "Outbound rules"
type = list(object({
protocol = string
port_range = optional(string)
destination_addresses = optional(list(string))
destination_droplet_ids = optional(list(string))
destination_tags = optional(list(string))
destination_load_balancer_uids = optional(list(string))
destination_kubernetes_ids = optional(list(string))
}))
default = [
{
protocol = "tcp"
port_range = "all"
destination_addresses = ["0.0.0.0/0", "::/0"]
},
{
protocol = "udp"
port_range = "all"
destination_addresses = ["0.0.0.0/0", "::/0"]
},
{
protocol = "icmp"
destination_addresses = ["0.0.0.0/0", "::/0"]
}
]
}
variable "firewall_tags" {
description = "Tags applied only for the firewall"
type = list(string)
default = []
}