1+ locals  {
2+ 
3+   #  Automatically load environment-level variables
4+   account_vars  =  read_terragrunt_config (find_in_parent_folders (" account.hcl" 
5+ 
6+   #  Extract out common variables for reuse
7+   project  =  . account_vars . locals . project 
8+   app      =  " marlowe-runtime" 
9+ 
10+   database_name  =  " ${ local . project } -${ local . app } -database-new" 
11+ 
12+   tags  =  
13+     Environment =  " prod" 
14+     Terraform   =  " true" 
15+     Project     =  local.project
16+   }
17+ 
18+ }
19+ 
20+ dependency  "vpc"  {
21+   config_path  =  " ../vpc" 
22+ }
23+ 
24+ dependency  "eks"  {
25+   config_path  =  " ../k8s/eks" 
26+ }
27+ 
28+ terraform  {
29+   source  =  " github.com/terraform-aws-modules/terraform-aws-rds//.?ref=v6.1.1" 
30+ }
31+ 
32+ #  Include all settings from the root terragrunt.hcl file
33+ include  {
34+   path  =  find_in_parent_folders ()
35+ }
36+ 
37+ inputs  =  
38+   identifier            =  local.database_name
39+   instance_class        =  " db.m6g.2xlarge" 
40+   multi_az              =  true 
41+   storage_type          =  " gp3" 
42+   allocated_storage     =  1500 
43+   max_allocated_storage =  3000 
44+   domain                =  " " 
45+   publicly_accessible   =  false 
46+   monitoring_interval   =  60 
47+   monitoring_role_arn   =  " arn:aws:iam::${ local . account_vars . locals . aws_account_id } :role/rds-monitoring-role" 
48+ 
49+   username =  " postgres" 
50+ 
51+   create_db_subnet_group =  true 
52+   subnet_ids             =  dependency.vpc.outputs.intra_subnets
53+ 
54+   vpc_security_group_ids =  [dependency.eks.outputs.node_security_group_id]
55+ 
56+   engine               =  " postgres" 
57+   major_engine_version =  " 15" 
58+   family               =  " postgres15" 
59+ 
60+   snapshot_identifier     =  " rds:dapps-marlowe-runtime-database-2023-10-09-07-59" 
61+   skip_final_snapshot     =  false 
62+   copy_tags_to_snapshot   =  true 
63+   backup_retention_period =  21 
64+ 
65+   performance_insights_enabled          =  true 
66+   performance_insights_retention_period =  31 
67+ 
68+   ca_cert_identifier =  " rds-ca-rsa2048-g1" 
69+ 
70+   auto_minor_version_upgrade =  false 
71+   apply_immediately          =  true 
72+   deletion_protection        =  true 
73+ 
74+   tags =  local.tags
75+ }
0 commit comments