This module creates and manages DocumentDB (MongoDB-compatible) in AWS, providing capabilities for managing parameter and security groups, maintenance and backup windows

Log in to Corewide IaC registry

Once you have a Corewide Solutions Portal account, this one-time action will use your browser session to retrieve credentials:

 shellterraform login solutions.corewide.com
Provision instructions

Initialize mandatory providers:

Copy and paste into your Terraform configuration and insert the variables:

 hclmodule "tf_aws_documentdb_mongo" {
  source  = "solutions.corewide.com/aws/tf-aws-documentdb-mongo/aws"
  version = "~> 1.0.0"

  # specify module inputs here or try one of the examples below
  ...
}

Initialize the setup:

 shellterraform init
Define update strategy

Corewide DevOps team strictly follows Semantic Versioning Specification to provide our clients with products that have predictable upgrades between versions. We recommend pinning patch versions of our modules using pessimistic constraint operator (~>) to prevent breaking changes during upgrades.

To get new features during the upgrades (without breaking compatibility), use ~> 1.0 and run terraform init -upgrade

For the safest setup, use strict pinning with version = "1.0.0"

Managed DocumentDB (MongoDB-compatible) in AWS

Creates and manages DocumentDB cluster in AWS
$650
Dependencies included: $100
BUY
v1.0.0 released 7 months, 3 weeks ago
New version approx. every 7 weeks

This module creates and manages DocumentDB (MongoDB-compatible) in AWS, providing capabilities for managing parameter and security groups, maintenance and backup windows

Deploy DocumentDB cluster with multiple nodes, custom machine size, parameters, security groups, database credentials and engine version in specific subnets:

 hclmodule "db" {
  source  = "solutions.corewide.com/aws/tf-aws-documentdb-mongo/aws"
  version = "~> 1.0"

  name_prefix        = "foo"
  username           = "mongo"
  password           = "sensitive_password"
  engine_version     = "4.0.0"
  machine_size       = "db.t4g.medium"
  node_count         = 2
  backup_window_hour = 3

  subnet_ids = [
    "subnet-0f12bcde3456fg78h",
    "subnet-9i01234j567klm890",
  ]

  allowed_security_group_ids = [
    "sg-01234a5b678901234",
  ]

  db_parameters = [
    {
      name  = "tls"
      value = "enabled"
    },
    {
      name  = "ttl_monitor"
      value = "enabled"
    },
  ]

  tags = {
    foo = "bar"
  }
}

Minimal setup with required parameters only:

 hclmodule "db" {
  source  = "solutions.corewide.com/aws/tf-aws-documentdb-mongo/aws"
  version = "~> 1.0"

  name_prefix = "foo"
  subnet_ids  = ["subnet-0f12bcde3456fg78h"]
}
Variable Description Type Default Required Sensitive
name_prefix Name prefix for the created resources string yes no
password Password for the master DB user (randomly generated if not specified) string yes no
subnet_ids List of VPC subnet IDs for DocumentDB subnet group creation list(string) yes no
allowed_security_group_ids List of security group IDs to allow connections to the cluster list(string) [] no no
apply_during_maintenance_window Apply changes to the cluster during maintenance window bool true no no
backup_retention_period Days to retain backups for number 2 no no
backup_window_hour One hour time range in which daily automatic backups are created number 5 no no
db_parameters List of database parameters objects list(object) [] no no
db_parameters[*].apply_method Method in which parameter should be applied. Possible values are: immediate and pending-reboot string pending-reboot no no
db_parameters[*].name Name of the DocumentDB parameter string yes no
db_parameters[*].value Value for DocumentDB parameter string yes no
deletion_protection_enabled Whether the DB cluster has deletion protection enabled bool false no no
engine_version Database engine version. Possible values are: 3.6.0, 4.0.0 and 5.0.0 string 5.0.0 no no
machine_size Instance class to use for the cluster nodes string db.t3.medium no no
maintenance_window Maintenance window configuration object {} no no
maintenance_window.day The day of the week (Mon, Tue, Wed, etc.) the maintenance window occurs string Mon no no
maintenance_window.hour The hour when the maintenance updates are applied, in UTC 24-hour format. Examples: 02, 03, 23 number 6 no no
major_upgrade_allowed Whether engine major version upgrades are allowed bool false no no
node_count Number of nodes in a DocumentDB cluster number 1 no no
storage_type Storage type to associate with the DB cluster. Possible values are: standard and iopt1 string standard no no
tags Tags that must be assigned to resources map(string) {} no no
username Username for the master DB user string docdb no no
Output Description Type Sensitive
connection_parameters Database connection parameters (db_host, db_port, db_user, db_password, db_connection_url) map yes
database_cluster DocumentDB cluster resource attributes resource yes
security_group Security group of the DocumentDB cluster resource no
Dependency Version Kind
terraform >= 1.3 CLI
hashicorp/aws ~> 5.0 provider
hashicorp/random ~> 3.3 provider
tf-aws-security-group ~> 2.0 module

Not sure where to start?
Let's find your perfect match.