forked from jetbrains-infra/terraform-aws-rds-mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rds.tf
64 lines (63 loc) · 3.31 KB
/
rds.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
resource "aws_db_instance" "default" {
count = local.rds_without_param_group
instance_class = local.instance_type
engine = "mysql"
engine_version = local.engine_version
vpc_security_group_ids = [aws_security_group.default.id]
db_subnet_group_name = aws_db_subnet_group.default.name
identifier = local.id
skip_final_snapshot = true
allocated_storage = local.disk_size
max_allocated_storage = 1000
storage_type = local.storage_type
storage_encrypted = true
multi_az = local.multi_az
backup_window = local.backup_window
backup_retention_period = local.backup_retention_period
db_name = local.database
username = local.username
password = local.password
publicly_accessible = local.publicly_accessible
apply_immediately = local.apply_immediately
deletion_protection = local.deletion_protection
enabled_cloudwatch_logs_exports = local.logs_set
monitoring_interval = local.enhanced_monitoring_interval
performance_insights_enabled = local.performance_insights_enabled
iam_database_authentication_enabled = local.iam_database_authentication_enabled
tags = local.tags
lifecycle {
ignore_changes = [password]
}
}
resource "aws_db_instance" "parameterized" {
count = local.rds_with_param_group
instance_class = local.instance_type
engine = "mysql"
engine_version = local.engine_version
vpc_security_group_ids = [aws_security_group.default.id]
db_subnet_group_name = aws_db_subnet_group.default.name
identifier = local.id
parameter_group_name = local.parameter_group_name
skip_final_snapshot = true
allocated_storage = local.disk_size
max_allocated_storage = 1000
storage_type = local.storage_type
storage_encrypted = true
multi_az = local.multi_az
backup_window = local.backup_window
backup_retention_period = local.backup_retention_period
db_name = local.database
username = local.username
password = local.password
publicly_accessible = local.publicly_accessible
apply_immediately = local.apply_immediately
deletion_protection = local.deletion_protection
enabled_cloudwatch_logs_exports = local.logs_set
monitoring_interval = local.enhanced_monitoring_interval
performance_insights_enabled = local.performance_insights_enabled
iam_database_authentication_enabled = local.iam_database_authentication_enabled
tags = local.tags
lifecycle {
ignore_changes = [password]
}
}