forked from AviatrixSystems/terraform-modules-copilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
180 lines (150 loc) · 3.94 KB
/
variables.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
174
175
176
177
178
179
180
variable "tenancy_ocid" {
type = string
description = "Tenancy OCID"
}
variable "compartment_ocid" {
type = string
description = "Compartment OCID"
}
variable "availability_domain_number" {
type = number
description = "Availability domain number"
}
variable "use_existing_vcn" {
type = bool
description = "Flag to indicate whether to use an existing VCN"
default = false
}
variable "vcn_id" {
type = string
description = "VCN ID"
default = ""
}
variable "subnet_id" {
type = string
description = "Subnet ID"
default = ""
}
variable "vcn_cidr_block" {
type = string
description = "VCN CIDR"
default = "10.1.0.0/16"
}
variable "vcn_display_name" {
type = string
description = "VCN display name"
default = "copilot-vcn"
}
variable "vcn_dns_label" {
type = string
description = "VCN DNS label"
default = "aviatrix"
}
variable "subnet_cidr_block" {
type = string
description = "Subnet CIDR"
default = "10.1.20.0/24"
}
variable "subnet_display_name" {
type = string
description = "Subnet display name"
default = "copilot-subnet"
}
variable "subnet_dns_label" {
type = string
description = "Subnet DNS label"
default = "management"
}
variable "igw_display_name" {
type = string
description = "IGW display name"
default = "copilot-igw"
}
variable "routetable_display_name" {
type = string
description = "Route table display name"
default = "copilot-rt"
}
variable "nsg_display_name" {
type = string
description = "NSG display name"
default = "copilot-nsg"
}
variable "https_allowed_cidrs" {
type = set(string)
description = "Allowed CIDRs for HTTPS access"
}
variable "udp_allowed_cidrs" {
type = map(object({
port = number
cidr = string,
}))
description = "Allowed CIDRs for UDP access"
}
variable "ssh_allowed_cidrs" {
type = set(string)
description = "Allowed CIDRs for SSH access"
default = []
}
variable "instance_shape" {
type = string
description = "Instance shape"
default = "VM.Standard2.8"
}
variable "boot_volume_size" {
type = number
description = "Boot volume size for copilot"
default = 50
validation {
condition = var.boot_volume_size >= 50
error_message = "The minimum boot volume size is 50G."
}
}
variable "vm_display_name" {
type = string
description = "VM display name"
default = "copilot-vm"
}
variable "copilot_version" {
type = string
description = "Copilot version"
default = ""
}
variable "use_existing_ssh_key" {
type = bool
description = "Flag to indicate whether to use an existing ssh key"
default = false
}
variable "ssh_public_key_file_path" {
type = string
description = "File path to the SSH public key"
default = ""
}
variable "ssh_public_key_file_content" {
type = string
description = "File content of the SSH public key"
default = ""
}
variable "default_data_volume_size" {
default = 0
type = number
description = "Size of default data disk. If not set, no default data disk will be created."
}
variable "additional_volumes" {
default = {}
type = map(object({
attachment_type = string,
volume_id = string,
}))
}
data "http" "image_info" {
url = "https://cdn.prod.sre.aviatrix.com/image-details/oci_copilot_image_details.json"
request_headers = {
"Accept" = "application/json"
}
}
locals {
ssh_key = var.use_existing_ssh_key == false ? tls_private_key.key_pair_material[0].public_key_openssh : (var.ssh_public_key_file_path != "" ? file(var.ssh_public_key_file_path) : var.ssh_public_key_file_content)
listing_resource_version = keys(jsondecode(data.http.image_info.response_body)["BYOL"])[0]
listing_id = values(jsondecode(data.http.image_info.response_body)["BYOL"])[0]
}