-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
220 lines (197 loc) · 3.68 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
### IAM user
/*
## username
variable "username" {
type = string
}
*/
# 1.1. Create a VPC
variable "vpc_name" {
type = string
default = "TERA_VPC"
}
variable "vpc_cidr" {
type = string
default = "10.0.0.0/16"
}
variable "public_source_cidr" {
type = list(string)
default = ["10.0.0.0/16"]
}
variable "public_source_cidr_v6" {
type = list(string)
default = ["::/0"]
}
# 2. Create a Internet Gateway
variable "ig_name" {
type = string
default = "NEW_IG"
}
# 1.3. Create 2 Route tables
variable "public_rt" {
type = string
default = "Public_RT"
}
variable "private_rt" {
type = string
default = "Private_RT"
}
# 1.4. Create 3 Public Subnets
variable "public_sn_count" {
type = number
default = 1
}
variable "public_subnets" {
type = list(string)
default = ["10.0.1.0/24"]
}
# 1.5. Create 3 Private Subnets
variable "private_sn_count" {
type = number
default = 1
}
variable "private_subnets" {
type = list(string)
default = ["10.0.2.0/24"]
}
# 1.6. Create Public access Security Group
variable "public_access_sg_ingress_rules" {
type = list(object({
from_port = number
to_port = number
protocol = string
}))
default = [
]
}
/*
####### Database Creation related Variables
## DB Identifier
variable "db_identifier" {
type = string
default = "new-db"
}
## Alocated storage
variable "db_storage" {
type = number
default = 10
}
## MaX alocate
variable "max_allocated_storage_value" {
type = number
default = 100
}
## DB engine
variable "db_engine" {
type = string
default = "postgres"
}
## DB engine version
variable "db_engine_version" {
type = string
default = "12.9"
}
## Instance Class
variable "db_class" {
type = string
default = "db.t3.micro"
}
## DB name
variable "db_name" {
type = string
default = "mydb"
}
## DB username
variable "db_username" {
type = string
default = "myuser"
}
## DB Password
variable "db_pass" {
type = string
default = "myDbPass"
}
## DB Parameter group
variable "db_para_group_name" {
type = string
default = "default.postgres12"
}
## DB storeage type
variable "db_storage_type" {
type = string
default = "gp2"
}
## Backup retention period
variable "db_backup_retention_period" {
type = number
default = 7
}
## Multi AZ ?
variable "muli_az_enable" {
type = string
default = "true"
}
## storage_encrypted ?
variable "is_storage_encrypted" {
type = string
default = "true"
}
## Database subnet group name
variable "db_subnet_group_name" {
type = string
default = "default_sg"
}
## DB deletion protection
variable "db_delete_protect" {
type = string
default = "false"
}
############## Monitor and Alert ############
## Notification email address
variable "delivery_email" {
type = string
}
## Billing threshold
variable "bill_threshold_amount" {
type = number
}
############## ECS SErvice configure
## Autosacling EC2 parameters
# EC2 image id
variable "ec2_image_id" {
type = string
}
# EC2 instance type
variable "ec2_instance_type" {
type = string
}
## Created Keyname
variable "ssh_keyname" {
type = string
}
## ALB Access logs saving bucket name
variable "alb_access_log_s3_bucket" {
type = string
}
## MAX Running EC2 and task count
variable "max_tasks" {
type = number
}
## MIN Running EC2 and task count
variable "min_tasks" {
type = number
}
## EC2 AutoScaling AVG CPU threshold
variable "asg_avg_cpu_target" {
type = number
}
## ECS Task AutoScaling AVG CPU threshold
variable "ecs_task_avg_cpu_target" {
type = number
}
######### Route 53
## DNS Name- There should be a Hosted zone available for the DNS
variable "domain_name_used" {
type = string
}
*/