-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathvariables.tf
234 lines (191 loc) · 4.19 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
#####################
# Project specifics #
#####################
variable "project" {
type = string
description = "Name of the project."
}
variable "domain_name" {
type = string
description = "Add domain name for the project."
default = null
}
variable "cert" {
type = string
default = false
}
variable "profile" {
type = string
}
variable "ssh_key_name" {
type = string
}
variable "ssh_username" {
type = string
}
variable "ssh_key_pair_name" {
type = string
}
variable "magento_admin_firstname" {
description = "Firstname for Magento admin."
}
variable "magento_admin_lastname" {
description = "Lastname for Magento admin."
}
variable "magento_admin_username" {
description = "Username for Magento admin."
}
variable "magento_admin_password" {
description = "Password for Magento admin."
}
variable "magento_database_password" {
description = "Password for Magento DB."
}
variable "magento_admin_email" {
description = "Email address for Magento admin."
}
##############
# Base AMI #
##############
locals {
os_ami_queries = {
debian_10 = {
most_recent = true
owners = ["136693071363"] # debian
filters = {
name = ["debian-11-amd64*"]
}
}
amazon_linux_2 = {
most_recent = true
owners = ["amazon"]
filters = {
name = ["amzn2-ami-hvm-*-x86_64*"]
}
}
}
ami_query = local.os_ami_queries[var.base_ami_os]
}
data "aws_ami" "selected" {
most_recent = true
owners = local.ami_query.owners
dynamic "filter" {
for_each = local.ami_query.filters
content {
name = filter.key
values = filter.value
}
}
}
variable "base_ami_ids" {
description = "Base AMI for bastion host and Magento EC2 instances. Amazon Linux 2 or Debian 10."
type = map(string)
default = {
"amazon_linux_2" = "ami-02e136e904f3da870",
"debian_10" = "ami-07d02ee1eeb0c996c"
}
}
variable "base_ami_os" {
type = string
}
#######
# AZs #
#######
variable "region" {
type = string
default = "us-east-1"
}
variable "az1" {
type = string
default = "us-east-1a"
}
variable "az2" {
type = string
default = "us-east-1b"
}
##########################################
# Networking and External IP addresses #
##########################################
variable "create_vpc" {
type = bool
}
variable "vpc_cidr" {
type = string
description = "VPC CIDR"
}
variable "management_addresses" {
description = "Whitelisted IP addresses for e.g. Security Groups"
type = list(string)
}
variable "mage_composer_username" {
type = string
description = "Magento auth.json username"
}
variable "mage_composer_password" {
type = string
description = "Magento auth.json password"
}
##################
# Load Balancing #
##################
variable "lb_access_logs_enabled" {
type = bool
description = "Enable load balancer accesslogs to s3 bucket"
default = false
}
##################
# RDS Database #
##################
variable "magento_db_backup_retention_period" {
default = 3
}
variable "magento_db_allocated_storage" {
default = 60
}
variable "skip_rds_snapshot_on_destroy" {
type = bool
description = "Take a final snapshot on RDS destroy?"
default = false
}
variable "magento_db_performance_insights_enabled" {
default = true
}
##################
# ElasticSearch #
##################
variable "elasticsearch_domain" {
type = string
description = "ElasticSearch domain"
}
##################
# RabbitMQ #
##################
variable "rabbitmq_username" {
type = string
description = "Username for RabbitMQ"
}
################################################
# Existing VPC Configurations #
# Only applied if create_vpc is set to "true" #
################################################
variable "vpc_id" {
type = string
}
variable "vpc_public_subnet_id" {
type = string
}
variable "vpc_public2_subnet_id" {
type = string
}
variable "vpc_private_subnet_id" {
type = string
}
variable "vpc_private2_subnet_id" {
type = string
}
variable "vpc_rds_subnet_id" {
type = string
}
variable "vpc_rds_subnet2_id" {
type = string
}