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.xhas been dropped;v0.13.1is now the minimum supported version - Terraform AWS provider minimum version is now
v4.0.0in 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_encryptedis now set totrueby default; was previouslyfalsecreate_random_passwordis now set totrueby default; was previouslyfalsecreate_db_subnet_groupis now set tofalseby default; was previouslytrue; typically a shared DB subnet group will be used, most likely from the VPC modulerandom_password_lengthis now set to16by default, was previously10- Random provider minimum version supported is now
v3.1.0 final_snapshot_identifierno longer coalescesvar.final_snapshot_identifierand instead relies onvar.final_snapshot_identifier_prefixwith a random suffix to avoid name collisions
latest_restorable_timeadded to ignored changesreplica_modesupport added to DB instance
username,password, andengineare set tonullwhen areplicate_source_dborsnapshot_identifieris provided; these values are already provided in the respective sourceengine_versionis set tonullwhen a value is provided forreplicate_source_dbdb_subnet_group_namehas been updated to use full name when prefix is enabledNametag removed from instance resource; name is set viaidentifierand 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_descriptionis now set tonullby default; was previously""timeoutsis 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_namemaster_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.