If you have any questions regarding this upgrade process, please consult the examples/
projects:
If you find a bug, please open an issue with supporting configuration to reproduce.
- Support for Terraform
<=v0.12.x
has been dropped;v0.13.1
is now the minimum supported version - Terraform AWS provider minimum version is now
v4.0.0
in order to support the replacement ofvar.name
(deprecated) forvar.db_name
- Separate RDS instance resource for MSSQL/SQLServer has been removed - all engines are supported under one resource
storage_encrypted
is now set totrue
by default; was previouslyfalse
create_random_password
is now set totrue
by default; was previouslyfalse
create_db_subnet_group
is now set tofalse
by default; was previouslytrue
; typically a shared DB subnet group will be used, most likely from the VPC modulerandom_password_length
is now set to16
by default, was previously10
- Random provider minimum version supported is now
v3.1.0
final_snapshot_identifier
no longer coalescesvar.final_snapshot_identifier
and instead relies onvar.final_snapshot_identifier_prefix
with a random suffix to avoid name collisions
latest_restorable_time
added to ignored changesreplica_mode
support added to DB instance
username
,password
, andengine
are set tonull
when areplicate_source_db
orsnapshot_identifier
is provided; these values are already provided in the respective sourceengine_version
is set tonull
when a value is provided forreplicate_source_db
db_subnet_group_name
has been updated to use full name when prefix is enabledName
tag removed from instance resource; name is set viaidentifier
and not through tags; users can add back into the tags they provide if desired- Outputs have been updated to use
try()
syntax; local variable usage has been removed within outputs engine
,major_engine_version
,family
,password
,db_subnet_group_name
,db_subnet_group_description
,parameter_group_name
,parameter_group_description
,option_group_name
,option_group_description
is now set tonull
by default; was previously""
timeouts
is now set to{}
by default; was previously a copy+paste of default value used by provider. This is a no-op but will show up in plans as a diff
-
Removed variables:
final_snapshot_identifier
-
Renamed variables:
name
(deprecated) ->db_name
master_password
->password
-
Added variables:
replica_mode
-
Removed outputs:
- None
-
Renamed outputs:
db_instance_master_password
->db_instance_password
-
Added outputs:
- None
The following examples demonstrate some of the changes that users can elect to make to avoid any potential disruptions when upgrading.
module "rds" {
source = "terraform-aws-modules/rds/aws"
version = "~> 3.0"
master_password = "MySuperStrongPassword!"
# Previously on read-replicas or restored from snapshot instances you needed to explicitly set these to null
# These can now be safely removed and instead on the module to resolve these appropriately
username = null
password = null
engine = null
}
module "asg" {
source = "terraform-aws-modules/rds/aws"
version = "~> 4.0"
password = "MySuperStrongPassword!"
# Set random password creation to false if providing your own password as input
create_random_password = false
# If you did not have storage encrypted in `v3.x`, you can explicitly disable in `v4.x` to avoid disruption
storage_encrypted = false
}
For MSSSQL/SQLServer, users will want to rename the resource in their Terraform state to align with the flattened DB instance resource module in v4.x:
terraform state mv 'module.<module-name>.module.db_instance.aws_db_instance.this_mssql[0]' 'module.<module-name>.module.db_instance.aws_db_instance.this[0]'
Where <module-name>
is the name of your module definition.