Skip to content

champ-oss/terraform-mongo-atlas

Repository files navigation

terraform-mongo-atlas

Summary: nosql mongo atlas resources

ci version

Table of Contents

General Information

  • automate setup of mongo atlas

Technologies Used

  • terraform
  • github actions

Features

  • create mongo project
  • mongo cluster
  • set default LTS version
  • create database app user
  • project allow network cidr list
  • manage mongo project teams
  • set default maintenance window
  • adding a few utility resources to manage snapshots and restore for new and existing clusters

Documentation

terraform mongo atlas provider resource documentation here

Usage

  • look at examples/complete/main.tf for usage

Requirements

Name Version
mongodbatlas 1.4.4

Providers

Name Version
mongodbatlas 1.4.4
random n/a

Modules

No modules.

Resources

Name Type
mongodbatlas_cloud_backup_snapshot.snapshot_target_restore resource
mongodbatlas_cloud_backup_snapshot_restore_job.ephemeral_restore resource
mongodbatlas_cloud_backup_snapshot_restore_job.ephemeral_restore_latest resource
mongodbatlas_cloud_backup_snapshot_restore_job.restore resource
mongodbatlas_cloud_backup_snapshot_restore_job.snapshot_target_restore resource
mongodbatlas_cluster.this resource
mongodbatlas_database_user.this resource
mongodbatlas_maintenance_window.this resource
mongodbatlas_project.this resource
mongodbatlas_project_ip_access_list.this resource
mongodbatlas_teams.this resource
random_password.this resource
random_string.this resource
mongodbatlas_cloud_backup_snapshots.ephemeral_restore_latest data source
mongodbatlas_clusters.ephemeral_restore data source
mongodbatlas_clusters.ephemeral_restore_latest data source

Inputs

Name Description Type Default Required
auto_scaling_disk_gb_enabled https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cluster#auto_scaling_disk_gb_enabled bool false no
cloud_backup https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cluster#cloud_backup bool false no
cluster_name https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cluster#name string null no
cluster_type https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cluster#cluster_type string "REPLICASET" no
component team name prefix string "team" no
day_of_week https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/maintenance_window#day_of_week number 1 no
disk_size_gb https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cluster#disk_size_gb number null no
enable_cluster_restore https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/data-sources/cloud_backup_snapshot_restore_job bool false no
enable_ephemeral_restore https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_provider_snapshot_restore_job bool false no
enable_ephemeral_restore_latest https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_provider_snapshot_restore_job bool false no
enable_snapshot_target_restore https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_provider_snapshot_restore_job bool false no
existing_teams https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/team#name map(any) {} no
git Name of the Git repo string n/a yes
hour_of_day https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/maintenance_window#hour_of_day number 6 no
mongo_db_major_version https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cluster#mongo_db_major_version string "5.0" no
mongo_region https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cluster#provider_region_name string "US_EAST_1" no
org_id org id string n/a yes
project_ip_address_allow_list https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/project_ip_access_list#ip_address list(any)
[
"0.0.0.0/0"
]
no
project_name Name of atlas project string n/a yes
provider_instance_size_name https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cluster#provider_instance_size_name string "M0" no
provider_name Cloud service provider on which the server for a multi-tenant cluster is provisioned. This setting is only valid when providerSetting.providerName is TENANT and providerSetting.instanceSizeName is M2 or M5. The possible values are: AWS, GCP, AZURE string "" no
replication_specs https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cluster#replication_specs list(map(any)) null no
source_project_id https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_provider_snapshot_restore_job#project_id string null no
source_snapshot_id https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/data-sources/cloud_backup_snapshot_restore_job#snapshot_id string null no
target_cluster_name https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cluster#name string null no
target_project_id https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/cloud_provider_snapshot_restore_job#project_id string null no
teams https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/team#name map(any) {} no

Outputs

Name Description
cluster_connection_string trimmed down mongo uri endpoint
id https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/project#id
password https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password
project_id https://registry.terraform.io/providers/mongodb/mongodbatlas/latest/docs/resources/project#id
standard_srv mongo uri endpoint

Project Status

Project is: in_progress