MongoDB

MongoDB standalone deployment for document-based database storage.

Requirements

Name

Version

terraform

>= 1.0

helm

>= 2.10.1, < 3.0.0

kubernetes

>= 2.21.1

local

>= 2.4.0

random

>= 3.5.1

Providers

Name

Version

helm

>= 2.10.1, < 3.0.0

kubernetes

>= 2.21.1

local

>= 2.4.0

random

>= 3.5.1

Modules

No modules.

Resources

Name

Type

helm_release.mongodb

resource

kubernetes_secret.mongodb

resource

kubernetes_secret.mongodb_admin

resource

kubernetes_secret.mongodb_connection_string

resource

kubernetes_secret.mongodb_monitoring_connection_string

resource

kubernetes_secret.mongodb_user

resource

kubernetes_storage_class.mongodb

resource

local_sensitive_file.mongodb_client_certificate

resource

random_password.mongodb_admin_password

resource

random_password.mongodb_application_password

resource

random_password.mongodb_monitoring_password

resource

random_string.mongodb_admin_user

resource

random_string.mongodb_application_user

resource

random_string.mongodb_monitoring_user

resource

kubernetes_secret.mongodb_certificates

data source

Inputs

Name

Description

Type

Default

Required

arbiter_resources

CPU and Memory limits and requests for MongoDB arbiter

object({
limits = optional(map(string))
requests = optional(map(string))
})

{}

no

labels

Labels for the Kubernetes StatefulSet to be deployed

map(string)

{
“app”: “storage”,
“type”: “table”
}

no

mongodb

Parameters of the MongoDB deployment

object({
databases_names = optional(list(string), [“database”])
helm_chart_repository = optional(string, “oci://registry-1.docker.io/bitnamicharts”)
helm_chart_name = optional(string, “mongodb”)
helm_chart_version = string
image = optional(string, “bitnamilegacy/mongodb”)
image_pull_secrets = optional(any, []) # can be a string or a list of strings
node_selector = optional(map(string), {})
registry = optional(string)
replicas = optional(number, 1)
tag = string
})

n/a

yes

mongodb_resources

CPU and Memory limits and requests for MongoDB

object({
limits = optional(map(string))
requests = optional(map(string))
})

{}

no

name

Name used for the helm chart release and the associated resources

string

"mongodb-armonik"

no

namespace

Namespace of ArmoniK resources

string

"default"

no

persistent_volume

Persistent Volume parameters for MongoDB pods

object({
access_mode = optional(list(string), [“ReadWriteOnce”])
reclaim_policy = optional(string, “Delete”)
storage_provisioner = optional(string)
volume_binding_mode = optional(string, “WaitForFirstConsumer”)
parameters = optional(map(string), {})

# Resources for PVC
resources = optional(object({
limits = optional(object({
storage = string
}))
requests = optional(object({
storage = string
}))
}))
})

null

no

security_context

Security context for MongoDB pods

object({
run_as_user = number
fs_group = number
})

{
“fs_group”: 999,
“run_as_user”: 999
}

no

timeout

Timeout limit in seconds per replica for the helm release creation

number

480

no

validity_period_hours

Validity period of the TLS certificate in hours

string

"8760"

no

Outputs

Name

Description

endpoints

Endpoints of MongoDB

env

Elements to be set as environment variables

env_from_secret

Environment variables from secrets

host

Hostname or IP address of MongoDB server

mount_secret

Secrets to be mounted as volumes

number_of_replicas

Number of replicas of MongoDB

port

Port of MongoDB server

unused_variables

Map of variables that are not used yet but might be in the future

url

URL of MongoDB server

user_credentials

User credentials of MongoDB

Examples