{"id":22347756,"url":"https://github.com/wearetechnative/terraform-aws-module-rds-instance","last_synced_at":"2026-03-19T22:29:55.810Z","repository":{"id":258504964,"uuid":"713707483","full_name":"wearetechnative/terraform-aws-module-rds-instance","owner":"wearetechnative","description":"AWS RDS (Relational Database Service) instance module for Terraform","archived":false,"fork":false,"pushed_at":"2025-03-05T14:33:41.000Z","size":178,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-05T15:32:04.307Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wearetechnative.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-03T04:31:33.000Z","updated_at":"2025-03-05T14:33:45.000Z","dependencies_parsed_at":"2025-03-05T15:36:14.349Z","dependency_job_id":null,"html_url":"https://github.com/wearetechnative/terraform-aws-module-rds-instance","commit_stats":null,"previous_names":["wearetechnative/terraform-aws-module-rds-instance"],"tags_count":1,"template":false,"template_full_name":"TechNative-B-V/terraform-aws-module-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fterraform-aws-module-rds-instance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fterraform-aws-module-rds-instance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fterraform-aws-module-rds-instance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fterraform-aws-module-rds-instance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wearetechnative","download_url":"https://codeload.github.com/wearetechnative/terraform-aws-module-rds-instance/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245641317,"owners_count":20648637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-04T10:10:48.167Z","updated_at":"2026-01-05T19:42:10.816Z","avatar_url":"https://github.com/wearetechnative.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](we-are-technative.png)](https://www.technative.nl)\n\n# Terraform AWS [terraform-aws-module-rds-instance] ![](https://img.shields.io/github/actions/workflow/status/wearetechnative/terraform-aws-module-rds-instance/tflint.yaml?style=plastic)\n\n# rds_instance\n\nUse this module for any RDS that is not Aurora. Use the rds_cluster for Aurora instances.\n\nKnown issues:\n\nIf you receive:\n\n╷\n│ Error: Creating CloudWatch Log Group failed: ResourceAlreadyExistsException: The specified log group already exists:  The CloudWatch Log Group '/aws/rds/instance/website-stack-20220819105124303000000001/error' already exists.\n│\n│   with module.website_stack.module.website_database.aws_cloudwatch_log_group.log_exports[\"error\"],\n│   on ../../modules/rds_instance/cloudwatch_logs_exports.tf line 1, in resource \"aws_cloudwatch_log_group\" \"log_exports\":\n│    1: resource \"aws_cloudwatch_log_group\" \"log_exports\" {\n│\n╵\n\nUpon initial creation then import the resource or delete it and rerun the TerraForm module. The reason this happens is because we want to control automically created CloudWatch log groups. This happens in more places in AWS unfortunately.\n\n## max_allocated_storage\nThis Terraform command uses the coalesce function, which is commonly used to set default values or to check values for null or zero.\n```\nmax_allocated_storage = coalesce(\n    var.max_allocated_storage != null ? (\n      var.max_allocated_storage != 0 ? var.max_allocated_storage : null\n    ) : null,\n    var.max_allocated_storage\n)\n```\nExplanation:\n\n- coalesce is a Terraform function that selects one of the given values, starting from left to right, and returns the first non-null value. If all values are null, it returns null.\n\n- var.max_allocated_storage != null ? ... : null checks if the variable max_allocated_storage is not null. If it's not null, it proceeds to check if it's not equal to 0. If it's not null and not equal to 0, it uses the value of max_allocated_storage. Otherwise, it returns null.\n\n- If var.max_allocated_storage != null ? ... : null returns null (because var.max_allocated_storage is null), then the default value of null is re-evaluated in the coalesce function, and then the value of var.max_allocated_storage is used.\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | \u003e=4.8.0 |\n| \u003ca name=\"provider_random\"\u003e\u003c/a\u003e [random](#provider\\_random) | \u003e=3.1.2 |\n\n## Modules\n\n| Name | Source | Version |\n|------|--------|---------|\n| \u003ca name=\"module_iam_role\"\u003e\u003c/a\u003e [iam\\_role](#module\\_iam\\_role) | git@github.com:wearetechnative/terraform-aws-iam-role.git | v1.0.0 |\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_cloudwatch_log_group.log_exports](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |\n| [aws_db_instance.replica](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance) | resource |\n| [aws_db_instance.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance) | resource |\n| [aws_db_option_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_option_group) | resource |\n| [aws_db_parameter_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_parameter_group) | resource |\n| [aws_db_subnet_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_subnet_group) | resource |\n| [random_password.login_suffix](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource |\n| [random_password.password](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource |\n| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_additional_tags\"\u003e\u003c/a\u003e [additional\\_tags](#input\\_additional\\_tags) | Additional tags to be added to resources. | `map(string)` | `{}` | no |\n| \u003ca name=\"input_allocated_storage\"\u003e\u003c/a\u003e [allocated\\_storage](#input\\_allocated\\_storage) | Set the amount of storage to be used by RDS. | `number` | `20` | no |\n| \u003ca name=\"input_auto_minor_version_upgrade\"\u003e\u003c/a\u003e [auto\\_minor\\_version\\_upgrade](#input\\_auto\\_minor\\_version\\_upgrade) | Allow minor updates during maintenance window. | `bool` | `true` | no |\n| \u003ca name=\"input_az\"\u003e\u003c/a\u003e [az](#input\\_az) | specify availability zone for instance if preferred | `string` | `null` | no |\n| \u003ca name=\"input_az_replica\"\u003e\u003c/a\u003e [az\\_replica](#input\\_az\\_replica) | specify availability zone for replica instance if preferred | `string` | `null` | no |\n| \u003ca name=\"input_backup_retention_period\"\u003e\u003c/a\u003e [backup\\_retention\\_period](#input\\_backup\\_retention\\_period) | number of days to retain backups | `number` | `35` | no |\n| \u003ca name=\"input_backup_window\"\u003e\u003c/a\u003e [backup\\_window](#input\\_backup\\_window) | Add a window in the folling format: 03:00-04:00 | `string` | `\"03:00-04:00\"` | no |\n| \u003ca name=\"input_db_name\"\u003e\u003c/a\u003e [db\\_name](#input\\_db\\_name) | Name of the database to create when the DB instance is created. | `string` | `null` | no |\n| \u003ca name=\"input_deletion_protection\"\u003e\u003c/a\u003e [deletion\\_protection](#input\\_deletion\\_protection) | protect the instance from deletion | `bool` | `false` | no |\n| \u003ca name=\"input_enable_aws_backup_tag\"\u003e\u003c/a\u003e [enable\\_aws\\_backup\\_tag](#input\\_enable\\_aws\\_backup\\_tag) | To enable aws backup service tag to RDS instance. | `bool` | `false` | no |\n| \u003ca name=\"input_enable_aws_backup_tag_replica\"\u003e\u003c/a\u003e [enable\\_aws\\_backup\\_tag\\_replica](#input\\_enable\\_aws\\_backup\\_tag\\_replica) | To enable aws backup service tag to RDS replica instance. | `bool` | `false` | no |\n| \u003ca name=\"input_enabled_cloudwatch_logs_exports\"\u003e\u003c/a\u003e [enabled\\_cloudwatch\\_logs\\_exports](#input\\_enabled\\_cloudwatch\\_logs\\_exports) | Enabled CloudWatch log exports. | `list(string)` | \u003cpre\u003e[\u003cbr\u003e  \"audit\",\u003cbr\u003e  \"error\",\u003cbr\u003e  \"general\",\u003cbr\u003e  \"slowquery\"\u003cbr\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_engine\"\u003e\u003c/a\u003e [engine](#input\\_engine) | RDS database engine to use. | `string` | `\"mariadb\"` | no |\n| \u003ca name=\"input_engine_family\"\u003e\u003c/a\u003e [engine\\_family](#input\\_engine\\_family) | RDS database parameter group family. | `string` | `\"mariadb10.5\"` | no |\n| \u003ca name=\"input_engine_major_version\"\u003e\u003c/a\u003e [engine\\_major\\_version](#input\\_engine\\_major\\_version) | RDS database engine version to use for option group. | `string` | `\"10.5\"` | no |\n| \u003ca name=\"input_engine_version\"\u003e\u003c/a\u003e [engine\\_version](#input\\_engine\\_version) | RDS database engine version to use. | `string` | `\"10.5.12\"` | no |\n| \u003ca name=\"input_instance_class\"\u003e\u003c/a\u003e [instance\\_class](#input\\_instance\\_class) | Instance class to be used for database instance. | `string` | `\"db.t3.medium\"` | no |\n| \u003ca name=\"input_kms_key_arn\"\u003e\u003c/a\u003e [kms\\_key\\_arn](#input\\_kms\\_key\\_arn) | KMS key to use for encrypting RDS instances. | `string` | n/a | yes |\n| \u003ca name=\"input_maintenance_window\"\u003e\u003c/a\u003e [maintenance\\_window](#input\\_maintenance\\_window) | maintenance window for rds instance updates | `string` | `\"Sun:02:00-Sun:03:00\"` | no |\n| \u003ca name=\"input_max_allocated_storage\"\u003e\u003c/a\u003e [max\\_allocated\\_storage](#input\\_max\\_allocated\\_storage) | Set the maximum storage to be used by RDS. | `number` | `20` | no |\n| \u003ca name=\"input_multi_az\"\u003e\u003c/a\u003e [multi\\_az](#input\\_multi\\_az) | Use 2 AZs for high availability. | `bool` | `true` | no |\n| \u003ca name=\"input_name\"\u003e\u003c/a\u003e [name](#input\\_name) | Unique name for RDS instance. | `string` | n/a | yes |\n| \u003ca name=\"input_parameter_group_overrides\"\u003e\u003c/a\u003e [parameter\\_group\\_overrides](#input\\_parameter\\_group\\_overrides) | Optional map of user defined parameters. The map key is the parameter name. The map contains value and apply\\_method as attributes. | \u003cpre\u003emap(object({\u003cbr\u003e    value        = string\u003cbr\u003e    apply_method = string\u003cbr\u003e  }))\u003c/pre\u003e | `{}` | no |\n| \u003ca name=\"input_password\"\u003e\u003c/a\u003e [password](#input\\_password) | Set a password for username. If set to null, a random password will be created | `string` | `null` | no |\n| \u003ca name=\"input_performance_insights_enabled\"\u003e\u003c/a\u003e [performance\\_insights\\_enabled](#input\\_performance\\_insights\\_enabled) | performance insights | `bool` | `false` | no |\n| \u003ca name=\"input_performance_insights_retention_period\"\u003e\u003c/a\u003e [performance\\_insights\\_retention\\_period](#input\\_performance\\_insights\\_retention\\_period) | Retention period of performance insights data | `number` | `31` | no |\n| \u003ca name=\"input_replica\"\u003e\u003c/a\u003e [replica](#input\\_replica) | create a read replica or not | `bool` | `false` | no |\n| \u003ca name=\"input_security_group_ids\"\u003e\u003c/a\u003e [security\\_group\\_ids](#input\\_security\\_group\\_ids) | Provide at least one security group to be associated with this instance. | `list(string)` | n/a | yes |\n| \u003ca name=\"input_storage_io1_iops\"\u003e\u003c/a\u003e [storage\\_io1\\_iops](#input\\_storage\\_io1\\_iops) | Overrides storage\\_type to io1 if set and defines the provisioned iops required. | `number` | `null` | no |\n| \u003ca name=\"input_storage_type\"\u003e\u003c/a\u003e [storage\\_type](#input\\_storage\\_type) | Storage type to be used for instances. | `string` | `\"gp2\"` | no |\n| \u003ca name=\"input_subnet_ids\"\u003e\u003c/a\u003e [subnet\\_ids](#input\\_subnet\\_ids) | Required list of subnets to launch instances in. | `list(string)` | n/a | yes |\n| \u003ca name=\"input_username\"\u003e\u003c/a\u003e [username](#input\\_username) | Set a username for database. If set to null, a random username will be created | `string` | `null` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_db_dns_address\"\u003e\u003c/a\u003e [db\\_dns\\_address](#output\\_db\\_dns\\_address) | n/a |\n| \u003ca name=\"output_db_name\"\u003e\u003c/a\u003e [db\\_name](#output\\_db\\_name) | n/a |\n| \u003ca name=\"output_db_port\"\u003e\u003c/a\u003e [db\\_port](#output\\_db\\_port) | n/a |\n| \u003ca name=\"output_domain\"\u003e\u003c/a\u003e [domain](#output\\_domain) | n/a |\n| \u003ca name=\"output_instance_arn\"\u003e\u003c/a\u003e [instance\\_arn](#output\\_instance\\_arn) | n/a |\n| \u003ca name=\"output_master_db_user_name\"\u003e\u003c/a\u003e [master\\_db\\_user\\_name](#output\\_master\\_db\\_user\\_name) | n/a |\n| \u003ca name=\"output_master_db_user_password\"\u003e\u003c/a\u003e [master\\_db\\_user\\_password](#output\\_master\\_db\\_user\\_password) | n/a |\n\u003c!-- END_TF_DOCS --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwearetechnative%2Fterraform-aws-module-rds-instance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwearetechnative%2Fterraform-aws-module-rds-instance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwearetechnative%2Fterraform-aws-module-rds-instance/lists"}