File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ Create and manage an RDS PostgreSQL instance. Includes the ability to manage the
3939| cloudwatch\_ log\_ exports | Log types to export to CloudWatch | ` list(string) ` | <pre >[ <br > "postgresql",<br > "upgrade"<br >] </pre > | no |
4040| create\_ secretmanager\_ secret | True to create a secretmanager secret containing DB password (not used if ` password ` is set) | ` bool ` | ` true ` | no |
4141| create\_ ssm\_ secret | True to create a SSM Parameter SecretString containing DB password (not used if ` password ` is set) | ` bool ` | ` false ` | no |
42+ | database\_ name | Name of the initial database to create. (null for none) | ` string ` | ` null ` | no |
4243| enable\_ deletion\_ protection | If ` true ` , deletion protection will be turned on for the RDS instance(s) | ` bool ` | ` true ` | no |
4344| engine\_ version | Version of database engine to use | ` string ` | ` "11.5" ` | no |
4445| final\_ snapshot\_ identifier | name of final snapshot (will be computed automatically if not specified) | ` string ` | ` null ` | no |
Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ resource "aws_db_parameter_group" "this" {
4444}
4545
4646resource "aws_db_instance" "this" {
47- identifier = var. identifier
48- identifier_prefix = var. identifier_prefix
47+ identifier = try ( substr ( var. identifier , 0 , 63 ), null )
48+ identifier_prefix = try ( substr ( var. identifier_prefix , 0 , 36 ), null )
4949
5050 allocated_storage = var. storage
5151 backup_retention_period = var. backup_retention_period
@@ -61,7 +61,7 @@ resource "aws_db_instance" "this" {
6161 monitoring_interval = var. monitoring_interval
6262 monitoring_role_arn = var. monitoring_role_arn
6363 multi_az = var. multi_az
64- name = replace ( var. name , " /[^A-Za-z0-9]/ " , " " )
64+ name = var. database_name
6565 parameter_group_name = local. parameter_group_name
6666 password = local. password
6767 performance_insights_enabled = var. performance_insights_enabled
Original file line number Diff line number Diff line change @@ -96,6 +96,12 @@ variable "cloudwatch_log_exports" {
9696 ]
9797}
9898
99+ variable "database_name" {
100+ default = null
101+ description = " Name of the initial database to create. (null for none)"
102+ type = string
103+ }
104+
99105variable "enable_deletion_protection" {
100106 default = true
101107 description = " If `true`, deletion protection will be turned on for the RDS instance(s)"
You can’t perform that action at this time.
0 commit comments