DocumentDB
This module creates an Amazon DocumentDB cluster with the specified configuration.
It allows you to set parameters such as the number of instances, instance class, engine version, and more.
Usage example
module "document_db" {
source = "s3::https://apro-terraform-modules.s3.eu-west-1.amazonaws.com/SET_VERSION/document_db.zip"
name_prefix = "uat-core"
vpc_id = var.vpc_id
subnet_ids = var.database_subnets
}
Serverless Configuration
module "document_db_serverless" {
source = "s3::https://apro-terraform-modules.s3.eu-west-1.amazonaws.com/SET_VERSION/document_db.zip"
name_prefix = "uat-core"
vpc_id = var.vpc_id
subnet_ids = var.database_subnets
use_serverless = true
serverless_scaling_configuration = {
min_capacity = 0.5
max_capacity = 5
}
}
| Name |
Description |
Type |
Default |
Required |
| allowed_security_groups |
List of Security Groups to be allowed to access the DocumentDB cluster |
list(string) |
[] |
no |
| backup_retention_period |
Days to keep automated backups (1-35) |
number |
1 |
no |
| cluster_parameters |
List of DB parameters to apply |
list(object({ apply_method = string name = string value = string })) |
[] |
no |
| cluster_size |
Number of instances in the DocumentDB cluster |
number |
1 |
no |
| create |
Create the DocumentDB cluster and associated resources |
bool |
true |
no |
| db_port |
Port for the DocumentDB cluster |
number |
27017 |
no |
| deletion_protection |
Prevent the DocumentDB cluster from being deleted until this is set back to false |
bool |
false |
no |
| enable_performance_insights |
Enable performance insights for the DocumentDB cluster |
bool |
false |
no |
| enabled_cloudwatch_logs_exports |
Log types to export to CloudWatch Logs. Allowed values: audit, profiler |
list(string) |
[] |
no |
| engine_version |
Engine version for the DocumentDB cluster |
string |
"5.0.0" |
no |
| instance_class |
Instance class for the DocumentDB cluster |
string |
"db.t3.medium" |
no |
| master_username |
Master username for the DocumentDB cluster |
string |
"root" |
no |
| name_prefix |
Prefix for the resources |
string |
n/a |
yes |
| preferred_backup_window |
Daily UTC window for automated backups, e.g. 04:00-04:30. Must not overlap the maintenance window (mon:05:30-mon:06:00) |
string |
"04:00-04:30" |
no |
| serverless_scaling_configuration |
Serverless scaling configuration for the DocumentDB cluster |
object({ min_capacity = number max_capacity = number }) |
{ "max_capacity": 5, "min_capacity": 0.5 } |
no |
| storage_type |
Storage type for the DocumentDB cluster |
string |
"standard" |
no |
| subnet_ids |
List of subnet IDs where the DocumentDB cluster will be created |
list(string) |
n/a |
yes |
| use_serverless |
Use serverless for the DocumentDB cluster |
bool |
false |
no |
| vpc_id |
VPC ID where the DocumentDB cluster will be created |
string |
n/a |
yes |
Outputs