Skip to content

Terraform module for creating MongoDB cluster on the DigitalOcean cloud.

License

Notifications You must be signed in to change notification settings

opsd-io/terraform-module-digitalocean-mongodb

Repository files navigation

OPSd - the unique and effortless way of managing cloud infrastructure.

Meet OPSd. The unique and effortless way of managing cloud infrastructure.

terraform-module-template

Introduction

What does the module provide?

Usage

module "terraform-module-digitalocean-mongodb" {

  cluster_name            = "example-mongodb-cluster"
  engine                  = "pg"
  postgresql_version      = "11"
  node_size               = "db-s-1vcpu-1gb"
  region                  = "nyc1"
  node_count              = 1
  common_tags             = ["production"]
  database_users          = ["Admin", "Mark", "Robert"]
}

IMPORTANT: Make sure not to pin to master because there may be breaking changes between releases.

Requirements

Name Version
terraform >= 1.5.5
digitalocean >= 2.34.1

Providers

Name Version
digitalocean >= 2.34.1

Modules

No modules.

Resources

Name Type
digitalocean_database_cluster.main resource
digitalocean_database_firewall.main resource
digitalocean_database_user.main resource

Inputs

Name Description Type Default Required
cluster_name The name of the database cluster. string n/a yes
common_tags A list of tag names to be applied to the database cluster. set(string) [] no
database_users List of users. set(string) [] no
firewall_rules List of trusted sources associated with the cluster. set(string) [] no
mongodb_version Engine version used by the cluster. number 7 no
node_count Number of mongodb nodes that will be created. number 1 no
node_size The mongodb node instance size. string "db-s-1vcpu-1gb" no
region DigitalOcean region where the cluster will reside. string n/a yes

Outputs

Name Description
firewall_id A unique identifier for the firewall.
main_default_database Name of the cluster's default database.
main_default_user Username for the cluster's default user.
main_default_user_password Password for the cluster's default user.
main_host Database cluster's hostname.
main_host_id The ID of the database cluster.
main_port Network port that the database cluster is listening on.
main_private_host Same as host, but only accessible from resources within the account and in the same region.
main_private_uri Same as uri, but only accessible from resources within the account and in the same region.
main_uri The full URI for connecting to the database cluster.
user_ids A unique identifier for database users.

Examples of usage

Do you want to see how the module works? See all the usage examples.

Related modules

The list of related modules (if present).

Contributing

If you are interested in contributing to the project, see see our guide.

Support

If you have a problem with the module or want to propose a new feature, you can report it via the project's (Github) issue tracker.

If you want to discuss something in person, you can join our community on Slack.

License

Apache License 2.0

About

Terraform module for creating MongoDB cluster on the DigitalOcean cloud.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages