Skip to content

Commit 83e6a97

Browse files
chore: Update example-rds-instance and rds-aurora modules
- 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.
1 parent 93d489e commit 83e6a97

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

live/common-infra/example-rds-instance.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ module "exampledb" {
1717

1818
vpc_id = data.aws_ssm_parameter.vpc_id.value
1919
db_subnet_group = data.aws_ssm_parameter.database_subnet_group.value
20+
vpc_security_group_ids = [module.security_group.security_group_id]
2021

2122
db_name = var.example_db_name
2223
db_master_username = var.example_db_master_username
2324
db_port = 5432
2425

26+
db_instance_class = "db.t4g.small"
27+
2528
allocated_storage = 20
2629

2730
manage_master_user_password = true
2831

29-
vpc_security_group_ids = [module.security_group.this_security_group_id]
30-
3132
tags = merge(
3233
module.label.tags,
3334
{
@@ -46,8 +47,8 @@ module "security_group" {
4647

4748
ingress_with_cidr_blocks = [
4849
{
49-
from_port = module.exampledb.db_instance_port
50-
to_port = module.exampledb.db_instance_port
50+
from_port = 5432
51+
to_port = 5432
5152
protocol = "tcp"
5253
description = "RDS DB Instance access from within VPC"
5354
cidr_blocks = data.aws_vpc.main.cidr_block

modules/rds/docs/MODULE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
| <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 |
3838
| <a name="input_db_engine_version"></a> [db\_engine\_version](#input\_db\_engine\_version) | The database engine version. | `string` | `"16.3"` | no |
3939
| <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 |
40-
| <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 |
40+
| <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 |
4141
| <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 |
4242
| <a name="input_db_major_engine_version"></a> [db\_major\_engine\_version](#input\_db\_major\_engine\_version) | The major engine version. | `string` | `"16"` | no |
4343
| <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 |
@@ -82,4 +82,4 @@
8282
| <a name="output_db_subnet_group_arn"></a> [db\_subnet\_group\_arn](#output\_db\_subnet\_group\_arn) | The ARN of the db subnet group |
8383
| <a name="output_db_subnet_group_id"></a> [db\_subnet\_group\_id](#output\_db\_subnet\_group\_id) | The db subnet group name |
8484
| <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 |
85-
<!-- END_TF_DOCS -->
85+
<!-- END_TF_DOCS -->

modules/rds/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ variable "db_port" {
5454
variable "db_instance_class" {
5555
description = "The instance class to use for RDS."
5656
type = string
57-
default = "db.t4g.large"
57+
default = "db.t4g.small"
5858
}
5959

6060
variable "db_engine" {

modules/vpc/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ output "vpc_id" {
33
value = module.vpc.vpc_id
44
}
55

6+
output "vpc_cidr_block" {
7+
description = "value of the vpc_cidr_block output from the vpc module"
8+
value = module.vpc.vpc_cidr_block
9+
}
10+
611
output "public_subnets" {
712
description = "value of the public_subnets output from the vpc module"
813
value = module.vpc.public_subnets

0 commit comments

Comments
 (0)