44 family = " postgres15"
55 vpc_cidr = " 10.20.0.0/16"
66 environment = " prod"
7+ create_namespace = true
8+ namespace = " postgres"
79 storage_type = " gp3"
810 engine_version = " 15.2"
911 instance_class = " db.m5d.large"
@@ -81,7 +83,7 @@ module "vpc" {
8183}
8284
8385module "rds-pg" {
84- source = " squareops/rds-postgresql/aws "
86+ source = " ../.. "
8587 name = local. name
8688 db_name = " postgres"
8789 family = local. family
@@ -101,7 +103,7 @@ module "rds-pg" {
101103 publicly_accessible = false
102104 skip_final_snapshot = true
103105 backup_window = " 03:00-06:00"
104- maintenance_window = " Mon:00:00-Mon:03:00"
106+ maintenance_window = " Mon:00:00-Mon:03:00
105107 final_snapshot_identifier_prefix = " final"
106108 major_engine_version = local.engine_version
107109 deletion_protection = true
@@ -113,4 +115,23 @@ module "rds-pg" {
113115 slack_channel = " postgresql- notification"
114116 slack_webhook_url = " https: // hooks/xxxxxxxx"
115117 custom_user_password = local. custom_user_password
118+ # if you want backup and restore then you have to create your cluster with rds vpc , subnet, key_arn.
119+ # And allow cluster security group in rds security group
120+ # cluster_name = "cluster-name"
121+ # namespace = local.namespace
122+ # create_namespace = local.create_namespace
123+ # postgresdb_backup_enabled = false
124+ # postgresdb_backup_config = {
125+ # postgres_database_name = "" # which database backup you want
126+ # s3_bucket_region = "" #s3 bucket region
127+ # cron_for_full_backup = "*/3 * * * *"
128+ # bucket_uri = "s3://xyz" #s3 bucket uri
129+ # }
130+ # postgresdb_restore_enabled = false
131+ # postgresdb_restore_config = {
132+ # bucket_uri = "s3://xyz" #s3 bucket uri which have dackup dump file
133+ # backup_file_name = "abc.dump" #Give only .sql or .zip file for restore
134+ # s3_bucket_region = "" # bucket region
135+ # DB_NAME = "" # which db to restore backup file
136+ # }
116137}
0 commit comments