Skip to content

Commit

Permalink
chore: Update example-rds-instance and rds-aurora modules
Browse files Browse the repository at this point in the history
- Updated example-rds-instance.tf to include a new vpc_security_group_ids parameter.
- Updated example-rds-instance.tf to set the db_instance_class to "db.t4g.small".
- Updated example-rds-instance.tf to remove the deprecated vpc_security_group_ids parameter.
- Updated MODULE.md to reflect the new default value for db_instance_class.
- Updated variables.tf to change the default value of db_instance_class to "db.t4g.small".
- Updated outputs.tf to include a new vpc_cidr_block output.
  • Loading branch information
ulises-jeremias committed Sep 24, 2024
1 parent 93d489e commit 83e6a97
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
9 changes: 5 additions & 4 deletions live/common-infra/example-rds-instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ module "exampledb" {

vpc_id = data.aws_ssm_parameter.vpc_id.value
db_subnet_group = data.aws_ssm_parameter.database_subnet_group.value
vpc_security_group_ids = [module.security_group.security_group_id]

db_name = var.example_db_name
db_master_username = var.example_db_master_username
db_port = 5432

db_instance_class = "db.t4g.small"

allocated_storage = 20

manage_master_user_password = true

vpc_security_group_ids = [module.security_group.this_security_group_id]

tags = merge(
module.label.tags,
{
Expand All @@ -46,8 +47,8 @@ module "security_group" {

ingress_with_cidr_blocks = [
{
from_port = module.exampledb.db_instance_port
to_port = module.exampledb.db_instance_port
from_port = 5432
to_port = 5432
protocol = "tcp"
description = "RDS DB Instance access from within VPC"
cidr_blocks = data.aws_vpc.main.cidr_block
Expand Down
4 changes: 2 additions & 2 deletions modules/rds/docs/MODULE.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
| <a name="input_db_engine"></a> [db\_engine](#input\_db\_engine) | The name of the database engine to be used for RDS. | `string` | `"postgres"` | no |
| <a name="input_db_engine_version"></a> [db\_engine\_version](#input\_db\_engine\_version) | The database engine version. | `string` | `"16.3"` | no |
| <a name="input_db_family"></a> [db\_family](#input\_db\_family) | The family of the database engine to be used for RDS. | `string` | `"postgres16"` | no |
| <a name="input_db_instance_class"></a> [db\_instance\_class](#input\_db\_instance\_class) | The instance class to use for RDS. | `string` | `"db.t4g.large"` | no |
| <a name="input_db_instance_class"></a> [db\_instance\_class](#input\_db\_instance\_class) | The instance class to use for RDS. | `string` | `"db.t4g.small"` | no |
| <a name="input_db_maintenance_window"></a> [db\_maintenance\_window](#input\_db\_maintenance\_window) | Preferred maintenance window. | `string` | `"Mon:00:00-Mon:03:00"` | no |
| <a name="input_db_major_engine_version"></a> [db\_major\_engine\_version](#input\_db\_major\_engine\_version) | The major engine version. | `string` | `"16"` | no |
| <a name="input_db_master_password"></a> [db\_master\_password](#input\_db\_master\_password) | Password for the master DB user. Note that this may show up in logs, and it will be stored in the state file. Required unless `manage_master_user_password` is set to `true` or unless `snapshot_identifier` or `replication_source_identifier` is provided or unless a `global_cluster_identifier` is provided when the cluster is the secondary cluster of a global database | `string` | `null` | no |
Expand Down Expand Up @@ -82,4 +82,4 @@
| <a name="output_db_subnet_group_arn"></a> [db\_subnet\_group\_arn](#output\_db\_subnet\_group\_arn) | The ARN of the db subnet group |
| <a name="output_db_subnet_group_id"></a> [db\_subnet\_group\_id](#output\_db\_subnet\_group\_id) | The db subnet group name |
| <a name="output_enhanced_monitoring_iam_role_arn"></a> [enhanced\_monitoring\_iam\_role\_arn](#output\_enhanced\_monitoring\_iam\_role\_arn) | The Amazon Resource Name (ARN) specifying the monitoring role |
<!-- END_TF_DOCS -->
<!-- END_TF_DOCS -->
2 changes: 1 addition & 1 deletion modules/rds/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ variable "db_port" {
variable "db_instance_class" {
description = "The instance class to use for RDS."
type = string
default = "db.t4g.large"
default = "db.t4g.small"
}

variable "db_engine" {
Expand Down
5 changes: 5 additions & 0 deletions modules/vpc/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ output "vpc_id" {
value = module.vpc.vpc_id
}

output "vpc_cidr_block" {
description = "value of the vpc_cidr_block output from the vpc module"
value = module.vpc.vpc_cidr_block
}

output "public_subnets" {
description = "value of the public_subnets output from the vpc module"
value = module.vpc.public_subnets
Expand Down

0 comments on commit 83e6a97

Please sign in to comment.