-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
56 lines (46 loc) · 1.6 KB
/
main.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
module "database" {
source = "terraform-aws-modules/rds-aurora/aws"
version = "~> 9.8"
name = local.prefix
create_db_subnet_group = true
db_subnet_group_name = local.prefix
engine = "aurora-postgresql"
engine_mode = "provisioned"
storage_encrypted = true
kms_key_id = aws_kms_key.database.arn
master_username = "root"
subnets = var.subnets
copy_tags_to_snapshot = true
snapshot_identifier = var.snapshot_identifier
deletion_protection = !var.force_delete
vpc_id = var.vpc_id
security_group_rules = {
ingress = {
cidr_blocks = var.ingress_cidrs
}
}
manage_master_user_password = true
manage_master_user_password_rotation = true
master_user_password_rotation_automatically_after_days = 30
cloudwatch_log_group_kms_key_id = var.logging_key_arn
cloudwatch_log_group_retention_in_days = 7
performance_insights_kms_key_id = var.logging_key_arn
performance_insights_enabled = true
performance_insights_retention_period = 7
# TODO: Create a database KMS key
master_user_secret_kms_key_id = var.secrets_key_arn
monitoring_interval = 60
apply_immediately = var.apply_immediately
skip_final_snapshot = var.skip_final_snapshot
serverlessv2_scaling_configuration = {
min_capacity = var.min_capacity
max_capacity = var.max_capacity
}
instance_class = "db.serverless"
# TODO: Make the number of instances configurable.
instances = {
one = {}
two = {}
}
tags = var.tags
}