forked from itwonderlab/terraform-aws-ec2-rds-basic-free
-
Notifications
You must be signed in to change notification settings - Fork 0
/
terraform.tfvars
275 lines (233 loc) · 8.29 KB
/
terraform.tfvars
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# Copyright (C) 2018 - 2020 IT Wonder Lab (https://www.itwonderlab.com)
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
#------------------------
# MAIN
#------------------------
is_production = false
#------------------------
# PROVIDERS
#------------------------
# DEFAULT AWS
provider_default_aws_profile = "ditwl_infradmin"
provider_default_aws_region = "us-east-1" #US East (N. Virginia), Cheapests region as https://www.concurrencylabs.com/blog/choose-your-aws-region-wisely/
provider_default_aws_account_id = [""]
provider_default_aws_shared_credentials_file = "~/.aws/credentials"
provider_default_aws_key_file = "~/keys/ditwl_kp_infradmin.pem"
#------------------------
# VPC
#------------------------
aws_vpc_tag_name = "ditwl-vpc"
aws_vpc_block = "172.17.32.0/19" #172.17.32.1 - 172.17.63.254
#------------------------
# SUBNETS
#------------------------
#------------------------
# For EC2 instances
#------------------------
#Zone: A, Env: PRO, Type: PUBLIC, Code: 32
aws_sn_za_pro_pub_32={
cidr ="172.17.32.0/23" #172.17.32.1 - 172.17.33.254
name ="ditwl-sn-za-pro-pub-32"
az ="us-east-1a"
public = "true"
}
#Zone: A, Env: PRO, Type: PRIVATE, Code: 34
aws_sn_za_pro_pri_34={
cidr = "172.17.34.0/23" #172.17.34.1 - 172.17.35.254
name = "ditwl-sn-za-pro-pri-34"
az = "us-east-1a"
public = "false"
}
#Zone: B, Env: PRO, Type: PUBLIC, Code: 36
aws_sn_zb_pro_pub_36={
cidr = "172.17.36.0/23" #172.17.36.1 - 172.17.37.254
name = "ditwl-sn-zb-pro-pub-36"
az = "us-east-1b"
public = "false"
}
#Zone: B, Env: PRO, Type: PRIVATE, Code: 38
aws_sn_zb_pro_pri_38={
cidr = "172.17.38.0/23" #172.17.38.1 - 172.17.39.254
name = "ditwl-sn-zb-pro-pri-38"
az = "us-east-1b"
public = "false"
}
#------------------------
# For RDS instances
#------------------------
aws_rds_sn_pub_pro_01 = {
name = "ditwl-rds-sn-pub-pro-01"
description = "ditwl-RDS-SN-pub-PRO-01"
#See aws_rds_sn_pro.tf for subnet_ids
#subnet_ids = ${module.aws_sn_za_pro_pub_32.id},${module.aws_sn_zb_pro_pub_36.id
}
#------------------------
# VPC ROUTING
#------------------------
aws_main_route_table_name = "ditwl-rt-pub-main"
aws_internet_gw_name = "ditwl-igw-pub"
aws_internet_route = {
name = "ditwl-ir"
destination_cidr_block = "0.0.0.0/0"
}
aws_private_route_table_za_name = "ditwl-rt-pri-za"
aws_private_route_table_zb_name = "ditwl-rt-pri-zb"
#------------------------
# ROUTE53
#------------------------
#------------------------
# PUBLIC - PRO
#------------------------
aws_route53_delegation_set_reference_name = "ditwl-r53-del"
aws_route53_public = {
name = "demo.itwonderlab.com"
comment = "ditwl - Public DNS"
tags_environment = "pro"
}
#------------------------
# SECURITY
#------------------------
#------------------------
# Default EC2
#------------------------
aws_sg_ec2_default = {
sec_name = "ditwl-sg-ec2-def"
sec_description = "ditwl - Default Security Group - Env: PRO"
allow_all_outbound = true
}
#------------------------
# Allow SSH from my Internet IP to ...
#------------------------
aws_sr_ec2_default_internet_to_ssh = {
type = "ingress"
from_port = "22"
to_port = "22"
protocol = "tcp"
cidr_blocks = "" #data.external.whatismyip.result["internet_ip"]}/32"
description = "Access from Internet to SSH port"
}
#------------------------
# Default RDS
#------------------------
aws_sg_rds_mariadb_default = {
sec_name = "ditwl-sg-rds-mariadb-def"
sec_description = "ditwl - Default Security Group RDS MariaDB"
allow_all_outbound = true
}
#------------------------
# Allow access from my Internet IP to DB port
#------------------------
aws_sr_rds_mariadb_default_internet_to_db_port = {
type = "ingress"
from_port = "3306"
to_port = "3306"
protocol = "tcp"
cidr_blocks = "" #data.external.whatismyip.result["internet_ip"]}/32"
description = "Access from My Internet IP to DB port"
}
#------------------------
# RDS INSTANCES
#------------------------
#------------------------
# MariaDB PRO 01
#------------------------
aws_rds_mariadb_pro_pub_01 = {
identifier = "ditwl-rds-mariadb-pro-pub-01"
allocated_storage = 20 #GB
storage_type = "gp2"
final_snapshot_id = "ditwl-rds-mariadb-pro-pub-01-final"
skip_final_snapshot = false
engine = "mariadb"
engine_version = "10.2.11"
instance_class = "db.t2.micro"
password = "*************"
username = "ditwlRDSPROdb01" #Start with a letter. Only numbers, letters, and _ accepted, 1 to 16 characters long
availability_zone = "us-east-1a"
backup_retention_period = 5
#db_subnet_group_name = See var aws_rds_sn_pro_01["name"]
multi_az = false
vpc_security_group_ids = ""
parameter_group_name = ""
allow_major_version_up = false
publicly_accessible = true
tag_private_name = "ditwl-rds-mariadb-pro-pub-01"
tag_public_name = "ditwl-rds-mariadb-pro-pub-01"
tag_app = "mariadb"
tag_app_id = "mariadb-01"
tag_os = "rds"
tags_environment = "pro"
tag_cost_center = "ditwl-permanent"
}
#------------------------
# RDS Security Group
#------------------------
aws_sg_rds_mariadb_pro_pub_01 = {
sec_name = "ditwl-aws-sg-rds-mariadb-pro-pub-01"
sec_description = "ditwl - MariaDb server access rules - Pub, Env: PRO"
allow_all_outbound = false
}
#------------------------
# Allow access from my Instances to DB port
#------------------------
aws_sr_rds_mariadb_pro_pub_01_instances_to_db_port = {
type = "ingress"
from_port = "3306"
to_port = "3306"
protocol = "tcp"
#source_security_group_id module.aws_sec_group_ec2_default.id
description = "Access from Instances to DB port"
}
#------------------------
# EC2 INSTANCES
#------------------------
#------------------------
# WP PRO
#------------------------
aws_ec2_pro_pub_wp_01 = {
name = "ditwl-ec2-pro-pub-wp01"
ami = "" #Uses data.aws_ami.ubuntu1604.id
instance_type = "t2.micro" #AWS Free Tier: 750 hours per month of Linux, RHEL, or SLES t2.micro instance usage
availability_zone = "us-east-1a"
key_name = "ditwl_kp_infradmin"
# vpc_security_group_ids = SEE TF file
# subnet_id = SEE TF file
associate_public_ip_address = true
root_block_device_size = 8
# See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html
root_block_device_volume_type = "gp2"
tag_private_name = "ditwl-ec2-pro-pub-wp-01"
tag_public_name = "www"
tag_app = "wp"
tag_app_id = "wp-01"
tag_os = "ubuntu"
tag_os_id = "ubuntu-16"
tags_environment = "pro"
tag_cost_center = "ditwl-permanent"
tags_volume = "ditwl-ec2-pro-pub-wp-01-root"
}
#------------------------
# WP PRO Security Group
#------------------------
aws_sg_ec2_pro_pub_wp_01 = {
sec_name = "ditwl-sg-ec2-pro-pub-01"
sec_description = "ditwl - WP server access rules - Pub, Env: PRO"
allow_all_outbound = false
}
aws_sr_ec2_pro_pub_wp_01_internet_to_80 = {
type = "ingress"
from_port = 80
to_port = 80
protocol = "tcp"
cidr_blocks = "0.0.0.0/0"
description = "Access from Internet to port 80"
}
aws_sr_ec2_pro_pub_wp_01_internet_to_443 = {
type = "ingress"
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = "0.0.0.0/0"
description = "Access from Internet to port 443"
}