{"id":51448092,"url":"https://github.com/osgurisdosre/terraform-aws-documentdb","last_synced_at":"2026-07-05T18:01:34.542Z","repository":{"id":64957812,"uuid":"579973171","full_name":"osgurisdosre/terraform-aws-documentdb","owner":"osgurisdosre","description":"Terraform module which creates DocumentDB resources on AWS","archived":false,"fork":false,"pushed_at":"2023-04-26T12:17:25.000Z","size":28,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-04-26T13:50:03.873Z","etag":null,"topics":["aws","documentdb","terraform-aws","terraform-aws-documentdb","terraform-module"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/osgurisdosre/documentdb/aws/latest","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/osgurisdosre.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-12-19T12:04:54.000Z","updated_at":"2023-04-26T13:50:03.873Z","dependencies_parsed_at":"2023-01-13T14:59:07.966Z","dependency_job_id":null,"html_url":"https://github.com/osgurisdosre/terraform-aws-documentdb","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/osgurisdosre/terraform-aws-documentdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osgurisdosre%2Fterraform-aws-documentdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osgurisdosre%2Fterraform-aws-documentdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osgurisdosre%2Fterraform-aws-documentdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osgurisdosre%2Fterraform-aws-documentdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osgurisdosre","download_url":"https://codeload.github.com/osgurisdosre/terraform-aws-documentdb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osgurisdosre%2Fterraform-aws-documentdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35163846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-05T02:00:06.290Z","response_time":100,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["aws","documentdb","terraform-aws","terraform-aws-documentdb","terraform-module"],"created_at":"2026-07-05T18:01:33.735Z","updated_at":"2026-07-05T18:01:34.536Z","avatar_url":"https://github.com/osgurisdosre.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS DocumentDB Terraform module\n\nTerraform module which creates DocumentDB resources on AWS\n\nRoot module calls these modules which can also be used separately to create independent resources:\n\n- [db_subnet_group](https://github.com/osgurisdosre/terraform-aws-documentdb/tree/main/modules/docdb_subnet_group) - creates DocumentDB subnet group\n- [db_parameter_group](https://github.com/osgurisdosre/terraform-aws-documentdb/tree/main/modules/docdb_parameter_group) - creates DocumentDB parameter group\n\n## Usage\n\n```hcl\nmodule \"docdb\" {\n  source                    = \"osgurisdosre/documentdb/aws\"\n\n  cluster_identifier        = \"demodb\"\n\n  engine                 = \"docdb\"\n  engine_version         = \"4.0.0\"\n  cluster_size = 3\n  instance_class = \"db.t3.medium\"\n  \n  # Credentials\n  master_username           = \"user\"\n  create_db_password        = true\n\n  availability_zones        = [\"us-east-1a\", \"us-east-1b\", \"us-east-1c\"]\n  vpc_security_group_ids = [\"sg-12345678\"]\n\n  # DB subnet group\n  create_db_subnet_group    = true\n  subnet_ids = [\"subnet-123456789\", \"subnet-987654321\" \"subnet-123321123\"] \n\n  # Database Deletion Protection\n  deletion_protection = true\n\n  # DB parameter group\n  create_db_parameter_group = true\n  parameters = [{\n    name  = \"tls\"\n    value = \"enabled\"\n  }]\n\n}\n```\n\n## Conditional creation\n\n```hcl\nmodule \"docdb\" {\n  source                    = \"osgurisdosre/documentdb/aws\"\n  \n  # Disable creation of DocumentDB instance(s)\n  create_db                 = false\n\n  # Enable creation of a random password\n  create_db_password        = true\n\n  # Enable creation of subnet group\n  create_db_subnet_group    = true\n  \n  # Enable creation of parameter group\n  create_db_parameter_group = true\n\n}\n```\n\n### Parameter Groups\n\n[Reference](https://docs.aws.amazon.com/documentdb/latest/developerguide/cluster_parameter_groups.html)\n\nUsers have the ability to:\n\n- Create a new parameter group (use cluster identifier as name):\n\n```hcl\n  create_db_parameter_group = true\n  parameters = [{\n    name  = \"tls\"\n    value = \"enabled\"\n  }]\n```\n\n- Pass the name of a parameter group to use that has been created outside of the module:\n\n```hcl\n  create_db_parameter_group = false\n  db_parameter_group_name   = \"custom-docdb-4.0\" # must already exist in AWS\n```\n\n- Use a default parameter group provided by AWS\n\n```hcl\n  create_db_parameter_group = false\n```\n\n## Examples\n\nTo-do:\n\n## Notes\n\n1. This module does not create DocumentDB security group. Use [terraform-aws-security-group](https://github.com/terraform-aws-modules/terraform-aws-security-group) module for this.\n2. By default, the variable `create_db_password` is set to true. Therefore, even if the user provides a password, it will not be read. The `create_db_password` variable should be set to false and the `password` variable should have a non-null value to be read and used.\n\n\n\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 1.0 |\n| \u003ca name=\"requirement_aws\"\u003e\u003c/a\u003e [aws](#requirement\\_aws) | \u003e= 5.50 |\n| \u003ca name=\"requirement_random\"\u003e\u003c/a\u003e [random](#requirement\\_random) | \u003e= 3.1 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | \u003e= 5.50 |\n| \u003ca name=\"provider_random\"\u003e\u003c/a\u003e [random](#provider\\_random) | \u003e= 3.1 |\n\n## Modules\n\n| Name | Source | Version |\n|------|--------|---------|\n| \u003ca name=\"module_docdb_parameter_group\"\u003e\u003c/a\u003e [docdb\\_parameter\\_group](#module\\_docdb\\_parameter\\_group) | ./modules/docdb_parameter_group | n/a |\n| \u003ca name=\"module_docdb_subnet_group\"\u003e\u003c/a\u003e [docdb\\_subnet\\_group](#module\\_docdb\\_subnet\\_group) | ./modules/docdb_subnet_group | n/a |\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_docdb_cluster.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/docdb_cluster) | resource |\n| [aws_docdb_cluster_instance.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/docdb_cluster_instance) | resource |\n| [random_password.master_password](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password) | resource |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_apply_immediately\"\u003e\u003c/a\u003e [apply\\_immediately](#input\\_apply\\_immediately) | Specifies whether any database modifications are applied immediately, or during the next maintenance window. | `bool` | `false` | no |\n| \u003ca name=\"input_auto_minor_version_upgrade\"\u003e\u003c/a\u003e [auto\\_minor\\_version\\_upgrade](#input\\_auto\\_minor\\_version\\_upgrade) | This parameter does not apply to Amazon DocumentDB.Amazon DocumentDB does not perform minor version upgrades regardless of the value set. | `bool` | `false` | no |\n| \u003ca name=\"input_availability_zones\"\u003e\u003c/a\u003e [availability\\_zones](#input\\_availability\\_zones) | A list of EC2 Availability Zones that instances in the DB cluster can be created in. | `list(string)` | n/a | no |\n| \u003ca name=\"input_backup_retention_period\"\u003e\u003c/a\u003e [backup\\_retention\\_period](#input\\_backup\\_retention\\_period) | The days to retain backups for. | `number` | `7` | no |\n| \u003ca name=\"input_cluster_identifier\"\u003e\u003c/a\u003e [cluster\\_identifier](#input\\_cluster\\_identifier) | The cluster identifier. If omitted, Terraform will assign a random, unique identifier. | `string` | n/a | yes |\n| \u003ca name=\"input_cluster_size\"\u003e\u003c/a\u003e [cluster\\_size](#input\\_cluster\\_size) | Number of instances. | `number` | `3` | no |\n| \u003ca name=\"input_create\"\u003e\u003c/a\u003e [create](#input\\_create) | Create the resource? | `bool` | `true` | no |\n| \u003ca name=\"input_create_db\"\u003e\u003c/a\u003e [create\\_db](#input\\_create\\_db) | Create the resource? | `bool` | `true` | no |\n| \u003ca name=\"input_create_db_parameter_group\"\u003e\u003c/a\u003e [create\\_db\\_parameter\\_group](#input\\_create\\_db\\_parameter\\_group) | Create the resource? | `bool` | `false` | no |\n| \u003ca name=\"input_create_db_password\"\u003e\u003c/a\u003e [create\\_db\\_password](#input\\_create\\_db\\_password) | Create the resource? | `bool` | `false` | no |\n| \u003ca name=\"input_create_db_subnet_group\"\u003e\u003c/a\u003e [create\\_db\\_subnet\\_group](#input\\_create\\_db\\_subnet\\_group) | Create the resource? | `bool` | `false` | no |\n| \u003ca name=\"input_db_cluster_parameter_group_name\"\u003e\u003c/a\u003e [db\\_cluster\\_parameter\\_group\\_name](#input\\_db\\_cluster\\_parameter\\_group\\_name) | A cluster parameter group to associate with the cluster. | `string` | `null` | no |\n| \u003ca name=\"input_db_parameter_group_name\"\u003e\u003c/a\u003e [db\\_parameter\\_group\\_name](#input\\_db\\_parameter\\_group\\_name) | A cluster parameter group name. | `string` | `\"\"` | no |\n| \u003ca name=\"input_db_subnet_group_name\"\u003e\u003c/a\u003e [db\\_subnet\\_group\\_name](#input\\_db\\_subnet\\_group\\_name) | The DB subnet group to associate with this DB instance. | `string` | `\"\"` | no |\n| \u003ca name=\"input_deletion_protection\"\u003e\u003c/a\u003e [deletion\\_protection](#input\\_deletion\\_protection) | A value that indicates whether the DB cluster has deletion protection enabled. | `bool` | `false` | no |\n| \u003ca name=\"input_enable_performance_insights\"\u003e\u003c/a\u003e [enable\\_performance\\_insights](#input\\_enable\\_performance\\_insights) | A value that indicates whether to enable Performance Insights for the DB Instance. | `bool` | `true` | no |\n| \u003ca name=\"input_enabled_cloudwatch_logs_exports\"\u003e\u003c/a\u003e [enabled\\_cloudwatch\\_logs\\_exports](#input\\_enabled\\_cloudwatch\\_logs\\_exports) | List of log types to export to cloudwatch. If omitted, no logs will be exported. The following log types are supported: audit, profiler. | `list(string)` | \u003cpre\u003e[\u003cbr\u003e  \"audit\",\u003cbr\u003e  \"profiler\"\u003cbr\u003e]\u003c/pre\u003e | no |\n| \u003ca name=\"input_engine\"\u003e\u003c/a\u003e [engine](#input\\_engine) | The name of the database engine to be used for this DB cluster. | `string` | `\"docdb\"` | no |\n| \u003ca name=\"input_engine_version\"\u003e\u003c/a\u003e [engine\\_version](#input\\_engine\\_version) | The database engine version. Updating this argument results in an outage. | `string` | n/a | yes |\n| \u003ca name=\"input_family\"\u003e\u003c/a\u003e [family](#input\\_family) | The family of the documentDB cluster parameter group. | `string` | `\"docdb4.0\"` | no |\n| \u003ca name=\"input_final_snapshot_identifier\"\u003e\u003c/a\u003e [final\\_snapshot\\_identifier](#input\\_final\\_snapshot\\_identifier) | The name of your final DB snapshot when this DB cluster is deleted. If omitted, no final snapshot will be made. | `string` | `null` | no |\n| \u003ca name=\"input_identifier_prefix\"\u003e\u003c/a\u003e [identifier\\_prefix](#input\\_identifier\\_prefix) | Creates a unique identifier beginning with the specified prefix. | `string` | `null` | no |\n| \u003ca name=\"input_instance_class\"\u003e\u003c/a\u003e [instance\\_class](#input\\_instance\\_class) | The instance class to use. | `string` | `null` | no |\n| \u003ca name=\"input_kms_key_id\"\u003e\u003c/a\u003e [kms\\_key\\_id](#input\\_kms\\_key\\_id) | The ARN for the KMS encryption key. | `string` | `null` | no |\n| \u003ca name=\"input_master_password\"\u003e\u003c/a\u003e [master\\_password](#input\\_master\\_password) | Password for the master DB user. | `string` | `null` | no |\n| \u003ca name=\"input_master_username\"\u003e\u003c/a\u003e [master\\_username](#input\\_master\\_username) | Username for the master DB user. | `string` | n/a | yes |\n| \u003ca name=\"input_parameter_description\"\u003e\u003c/a\u003e [parameter\\_description](#input\\_parameter\\_description) | Description for the parameter group. | `string` | `\"Parameter group for\"` | no |\n| \u003ca name=\"input_parameters\"\u003e\u003c/a\u003e [parameters](#input\\_parameters) | List of DB parameters to apply. | `list(map(string))` | `[]` | no |\n| \u003ca name=\"input_password\"\u003e\u003c/a\u003e [password](#input\\_password) | Password for the master DB user. | `string` | `null` | no |\n| \u003ca name=\"input_performance_insights_kms_key_id\"\u003e\u003c/a\u003e [performance\\_insights\\_kms\\_key\\_id](#input\\_performance\\_insights\\_kms\\_key\\_id) | The KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the KMS key. | `string` | `null` | no |\n| \u003ca name=\"input_port\"\u003e\u003c/a\u003e [port](#input\\_port) | The port on which the DB accepts connections. | `number` | `27017` | no |\n| \u003ca name=\"input_preferred_backup_window\"\u003e\u003c/a\u003e [preferred\\_backup\\_window](#input\\_preferred\\_backup\\_window) | The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter. | `string` | `\"03:00-05:00\"` | no |\n| \u003ca name=\"input_preferred_maintenance_window\"\u003e\u003c/a\u003e [preferred\\_maintenance\\_window](#input\\_preferred\\_maintenance\\_window) | The weekly time range during which system maintenance can occur, in (UTC). | `string` | `\"sat:05:00-sat:08:00\"` | no |\n| \u003ca name=\"input_promotion_tier\"\u003e\u003c/a\u003e [promotion\\_tier](#input\\_promotion\\_tier) | Failover Priority setting on instance level. | `number` | `0` | no |\n| \u003ca name=\"input_random_password_length\"\u003e\u003c/a\u003e [random\\_password\\_length](#input\\_random\\_password\\_length) | The length of the string desired. | `number` | `16` | no |\n| \u003ca name=\"input_sg_name_prefix\"\u003e\u003c/a\u003e [sg\\_name\\_prefix](#input\\_sg\\_name\\_prefix) | Creates a unique name beginning with the specified prefix. | `string` | `null` | no |\n| \u003ca name=\"input_skip_final_snapshot\"\u003e\u003c/a\u003e [skip\\_final\\_snapshot](#input\\_skip\\_final\\_snapshot) | Determines whether a final DB snapshot is created before the DB cluster is deleted. | `bool` | `true` | no |\n| \u003ca name=\"input_snapshot_identifier\"\u003e\u003c/a\u003e [snapshot\\_identifier](#input\\_snapshot\\_identifier) | Specifies whether or not to create this cluster from a snapshot. | `string` | `null` | no |\n| \u003ca name=\"input_storage_encrypted\"\u003e\u003c/a\u003e [storage\\_encrypted](#input\\_storage\\_encrypted) | Specifies whether the DB cluster is encrypted. | `bool` | `true` | no |\n| \u003ca name=\"input_subnet_description\"\u003e\u003c/a\u003e [subnet\\_description](#input\\_subnet\\_description) | Allowed subnets for DB cluster instances. | `string` | `null` | no |\n| \u003ca name=\"input_subnet_ids\"\u003e\u003c/a\u003e [subnet\\_ids](#input\\_subnet\\_ids) | A list of VPC subnet IDs. | `list(string)` | `[]` | no |\n| \u003ca name=\"input_vpc_security_group_ids\"\u003e\u003c/a\u003e [vpc\\_security\\_group\\_ids](#input\\_vpc\\_security\\_group\\_ids) | List of VPC security groups to associate with the Cluster. | `list(string)` | n/a | yes |\n| \u003ca name=\"input_tags\"\u003e\u003c/a\u003e [vpc\\_tags](#input\\_tags) | A map of tags to add to all resources. | `map(string)` | `{}` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_db_instance_endpoint\"\u003e\u003c/a\u003e [db\\_instance\\_endpoint](#output\\_db\\_instance\\_endpoint) | The DNS address of the DocDB Cluster |\n| \u003ca name=\"output_db_instance_endpoint_reader\"\u003e\u003c/a\u003e [db\\_instance\\_endpoint\\_reader](#output\\_db\\_instance\\_endpoint\\_reader) | The DNS address of the DocDB Cluster |\n| \u003ca name=\"output_db_instance_password\"\u003e\u003c/a\u003e [db\\_instance\\_password](#output\\_db\\_instance\\_password) | The database password (this password may be old, because Terraform doesn't track it after initial creation) |\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n\n## Authors\n\nModule is maintained by [Emidio Neto](https://github.com/emdneto), [Leonardo Jardim](https://github.com/leojaardim) and [Yuri Azeredo](https://github.com/yuriazeredo)\n## License\n\nApache 2 Licensed. See [LICENSE](https://github.com/osgurisdosre/terraform-aws-documentdb/blob/main/LICENSE) for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosgurisdosre%2Fterraform-aws-documentdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosgurisdosre%2Fterraform-aws-documentdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosgurisdosre%2Fterraform-aws-documentdb/lists"}