diff --git a/.changeset/hot-readers-relate.md b/.changeset/hot-readers-relate.md new file mode 100644 index 00000000..56d25fc5 --- /dev/null +++ b/.changeset/hot-readers-relate.md @@ -0,0 +1,5 @@ +--- +"@common-fate/terraform-aws-common-fate-deployment": patch +--- + +add variable to set custom rds database instance class type diff --git a/main.tf b/main.tf index b0cbb47c..5c093761 100644 --- a/main.tf +++ b/main.tf @@ -74,6 +74,7 @@ module "control_plane_db" { apply_immediately = var.rds_apply_immediately snapshot_identifier = var.rds_snapshot_identifier rds_instance_identifier_suffix = var.rds_instance_identifier_suffix + rds_instance_type = var.rds_instance_type } diff --git a/modules/database/main.tf b/modules/database/main.tf index ffc76d45..59a1c7c2 100644 --- a/modules/database/main.tf +++ b/modules/database/main.tf @@ -22,7 +22,7 @@ resource "aws_db_instance" "pg_db" { allocated_storage = 20 engine = "postgres" engine_version = "15" - instance_class = "db.t3.micro" + instance_class = var.rds_instance_type db_name = "postgres" username = "postgres" manage_master_user_password = true diff --git a/modules/database/variables.tf b/modules/database/variables.tf index 6513167c..f50ea6ac 100644 --- a/modules/database/variables.tf +++ b/modules/database/variables.tf @@ -74,3 +74,9 @@ variable "rds_instance_identifier_suffix" { type = string default = null } + +variable "rds_instance_type" { + description = "(Optional) specify the instance type of the RDS instance. defaults to db.t3.micro," + type = string + default = "db.t3.micro" +} diff --git a/variables.tf b/variables.tf index 2bbb6b08..23e397f1 100644 --- a/variables.tf +++ b/variables.tf @@ -509,3 +509,9 @@ variable "saml_allow_idp_initiated_sign_in" { default = false type = bool } + +variable "rds_instance_type" { + description = "(Optional) specify the instance type of the RDS instance. defaults to db.t3.micro," + type = string + default = "db.t3.micro" +}