@@ -50,7 +50,9 @@ resource "aws_db_parameter_group" "this" {
5050}
5151
5252resource "aws_db_instance" "this" {
53- name_prefix = regex (var. name , " /[^A-Za-Z0-9]/" , " " )
53+ identifier = var. identifier
54+ identifier_prefix = var. identifier_prefix
55+
5456 allocated_storage = var. storage
5557 backup_retention_period = var. backup_retention_period
5658 copy_tags_to_snapshot = true
@@ -61,12 +63,11 @@ resource "aws_db_instance" "this" {
6163 engine_version = var. engine_version
6264 final_snapshot_identifier = local. final_snapshot_identifier
6365 iam_database_authentication_enabled = var. iam_database_authentication_enabled
64- identifier = var. identifier
65- identifier_prefix = var. identifier_prefix
6666 instance_class = var. instance_class
6767 monitoring_interval = var. monitoring_interval
6868 monitoring_role_arn = var. monitoring_role_arn
6969 multi_az = var. multi_az
70+ name = replace (var. name , " /[^A-Za-Z0-9]/" , " " )
7071 parameter_group_name = local. parameter_group_name
7172 password = local. password
7273 performance_insights_enabled = var. performance_insights_enabled
@@ -77,12 +78,4 @@ resource "aws_db_instance" "this" {
7778 tags = local. db_tags
7879 username = var. username
7980 vpc_security_group_ids = [aws_security_group . this . id ]
80-
81- # Ignore changes to name and name_prefix so the transition to name_prefix doesn't break anything already using this.
82- lifecycle {
83- ignore_changes = [
84- name ,
85- name_prefix
86- ]
87- }
8881}
0 commit comments