Mongo Cluster

mongo_cluster

This is a module that supports creating and destroying Mongo Clusters

Example Syntax


name: Create Cluster
ionoscloudsdk.ionoscloud.mongo_cluster:
  mongo_db_version: 5.0
  instances: 3
  location: de/fra
  template_id: 6b78ea06-ee0e-4689-998c-fc9c46e781f6
  connections:
  - cidr_list:
    - 192.168.1.116/24
    - 192.168.1.117/24
    - 192.168.1.118/24
    datacenter: 'AnsibleAutoTestDBaaSMongo - DBaaS Mongo'
    lan: test_lan
  display_name: 'AnsibleTestMongoDBCluster'
  wait: true
  wait_timeout: 7200
register: cluster_response


name: Update Cluster
ionoscloudsdk.ionoscloud.mongo_cluster:
  mongo_cluster: 'AnsibleTestMongoDBCluster'
  display_name: 'AnsibleTestMongoDBCluster UPDATED'
  state: update
  allow_replace: false
  wait: true
register: cluster_response

- name: Restore Mongo Cluster
    mongo_cluster:
      mongo_cluster: backuptest-05
      backup_id: 9ab6545c-b138-4a86-b6ca-0d872a2b0953
      state: restore
  

name: Delete Cluster
ionoscloudsdk.ionoscloud.mongo_cluster:
  mongo_cluster: ''
  state: absent
  wait: false

Returned object

For more examples please check out the tests here.

NOTE: If you are using a versions 7.0.0 and up: modules can replace resources if certain set parameters differ from the results found in the API!

Parameters that can trigger a resource replacement:

  • location

  • mongo_db_version

state: present

Available parameters for state present:

Name
Required
Description

maintenance_window dict

False

A weekly window of 4 hours during which maintenance work can be performed.

mongo_db_version str

True

The MongoDB version of your cluster.

instances int

True

The total number of instances in the cluster (one primary and n-1 secondaries).

connections list

True

Array of datacenters to connect to your cluster.

template_id str

True

The unique ID of the template, which specifies the number of cores, storage size, and memory. You cannot downgrade to a smaller template or minor edition (e.g. from business to playground). To get a list of all templates to confirm the changes use the /templates endpoint.

location str

True

The physical location where the cluster will be created. This is the location where all your instances will be located. This property is immutable.

display_name str

True

The name of your cluster.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update', 'restore']

state: absent

Available parameters for state absent:

Name
Required
Description

mongo_cluster str

True

The ID or name of an existing Mongo Cluster.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update', 'restore']

state: update

Available parameters for state update:

Name
Required
Description

mongo_cluster str

True

The ID or name of an existing Mongo Cluster.

maintenance_window dict

False

A weekly window of 4 hours during which maintenance work can be performed.

mongo_db_version str

False

The MongoDB version of your cluster.

instances int

False

The total number of instances in the cluster (one primary and n-1 secondaries).

connections list

False

Array of datacenters to connect to your cluster.

template_id str

False

The unique ID of the template, which specifies the number of cores, storage size, and memory. You cannot downgrade to a smaller template or minor edition (e.g. from business to playground). To get a list of all templates to confirm the changes use the /templates endpoint.

location str

False

The physical location where the cluster will be created. This is the location where all your instances will be located. This property is immutable.

display_name str

False

The name of your cluster.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update', 'restore']

state: restore

Available parameters for state restore:

Name
Required
Description

mongo_cluster str

True

The ID or name of an existing Mongo Cluster.

backup_id str

True

The ID of the backup to be used.

api_url str

False

The Ionos API base URL.

certificate_fingerprint str

False

The Ionos API certificate fingerprint.

username str

False

The Ionos username. Overrides the IONOS_USERNAME environment variable.

password str

False

The Ionos password. Overrides the IONOS_PASSWORD environment variable.

token str

False

The Ionos token. Overrides the IONOS_TOKEN environment variable.

wait bool

False

Wait for the resource to be created before returning. Default: True Options: [True, False]

wait_timeout int

False

How long before wait gives up, in seconds. Default: 600

state str

False

Indicate desired state of the resource. Default: present Options: ['present', 'absent', 'update', 'restore']

Last updated