community.mongodb.mongodb_atlas_cluster module – Manage database clusters in Atlas

Note

This module is part of the community.mongodb collection (version 1.7.8).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.mongodb.

To use it in a playbook, specify: community.mongodb.mongodb_atlas_cluster.

Synopsis

  • The clusters module provides access to your cluster configurations.

  • The module lets you create, edit and delete clusters.

  • API Documentation

Parameters

Parameter

Comments

api_password

aliases: apiPassword

string / required

The password for use in authentication with the Atlas API.

Can use API users and tokens (private key is password)

api_username

aliases: apiUsername

string / required

The username for use in authentication with the Atlas API.

Can use API users and tokens (public key is username)

auto_scaling

aliases: autoScaling

dictionary

Configure your cluster to automatically scale its storage and cluster tier.

disk_gb_enabled

aliases: diskGBEnabled

boolean

Specifies whether disk auto-scaling is enabled. The default is true.

Choices:

  • false

  • true

cluster_type

aliases: clusterType

string

Type of the cluster that you want to create.

Choices:

  • "REPLICASET" ← (default)

  • "SHARDED"

disk_size_gb

aliases: diskSizeGB

integer

Capacity, in gigabytes, of the host’s root volume. Increase this number to add capacity, up to a maximum possible value of 4096 (i.e., 4 TB). This value must be a positive integer.

group_id

aliases: groupId

string / required

Unique identifier for the Atlas project.

mongo_db_major_version

aliases: mongoDBMajorVersion

string

Version of the cluster to deploy.

Atlas always deploys the cluster with the latest stable release of the specified version.

You can upgrade to a newer version of MongoDB when you modify a cluster.

Choices:

  • "4.2"

  • "4.4"

  • "5.0"

  • "6.0"

  • "7.0"

name

string / required

Name of the cluster as it appears in Atlas. Once the cluster is created, its name cannot be changed.

pit_enabled

aliases: pitEnabled

boolean

Flag that indicates the cluster uses continuous cloud backups.

Choices:

  • false

  • true

provider_backup_enabled

aliases: providerBackupEnabled

boolean

Flag that indicates if the cluster uses Cloud Backups for backups.

Choices:

  • false

  • true

provider_settings

aliases: providerSettings

dictionary / required

Configuration for the provisioned servers on which MongoDB runs.

The available options are specific to the cloud service provider.

instance_size_name

aliases: instanceSizeName

string / required

Atlas provides different cluster tiers, each with a default storage capacity and RAM size.

The cluster you select is used for all the data-bearing servers in your cluster tier.

provider_name

aliases: providerName

string / required

Cloud service provider on which the servers are provisioned.

region_name

aliases: regionName

string / required

Physical location of your MongoDB cluster.

replication_factor

aliases: replicationFactor

integer

Number of replica set members. Each member keeps a copy of your databases, providing high availability and data redundancy.

Choices:

  • 3 ← (default)

  • 5

  • 7

state

string

State of the ressource.

Choices:

  • "present" ← (default)

  • "absent"

Examples

    - name: test cluster
      community.mongodb.mongodb_atlas_cluster:
        api_username: "API_user"
        api_password: "API_passwort_or_token"
        group_id: "GROUP_ID"
        name: "testcluster"
        mongo_db_major_version: "4.0"
        cluster_type: "REPLICASET"
        provider_settings:
          provider_name: "GCP"
          region_name: "EUROPE_WEST_3"
          instance_size_name: "M10"
...

Authors

  • Martin Schurz (@schurzi)