In-Memory DB Cluster (v2)
inmemorydb_cluster_v2
This module supports creating, updating, restoring or destroying In-Memory DB Clusters using the DBaaS In-Memory DB v2 API. The cluster region is selected through the I(location) option; I(api_url) overrides the base API URL globally (for a proxy/test endpoint, not for region selection).
Example Syntax
name: Create Cluster
ionoscloudsdk.ionoscloud.inmemorydb_cluster_v2:
location: 'de/fra'
inmemorydb_version: '9.0'
instances: 1
cores: 1
ram: 4
connection:
datacenter: 'AnsibleAutoTestDBaaS - InMemoryDB v2'
lan: test_lan1
primary_instance_address: 192.168.1.101/24
name: 'ansible-test-v2'
eviction_policy: noeviction
persistence_mode: RDB
maintenance_window: ''
snapshot_location: 'eu-central-3'
snapshot_retention_days: 7
snapshot_hours:
- 2
db_username: 'clusteruser'
db_password_hash: ''
wait: true
wait_timeout: '3600'
register: cluster_response
name: Update Cluster
ionoscloudsdk.ionoscloud.inmemorydb_cluster_v2:
location: 'de/fra'
inmemorydb_cluster: ''
instances: 2
cores: 2
ram: 6
db_username: 'clusteruser'
db_password_hash: ''
state: update
wait: true
wait_timeout: '3600'
name: Restore Cluster (in-place)
ionoscloudsdk.ionoscloud.inmemorydb_cluster_v2:
location: ''
inmemorydb_cluster: ''
recovery_target_time: "2023-07-01T13:00:00Z"
state: restore
wait: true
name: Delete Cluster (async)
ionoscloudsdk.ionoscloud.inmemorydb_cluster_v2:
location: 'de/fra'
inmemorydb_cluster: ''
state: absent
wait: false
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:
connection
snapshot_location
state: present
Available parameters for state present:
maintenance_window dict
True
A weekly 4 hour-long window, during which maintenance might occur. A dict with keys `time` (start of the maintenance window in UTC, e.g. "16:30:00") and `day_of_the_week` (e.g. "Sunday").
inmemorydb_version str
True
The In-Memory DB version of the cluster. Use the inmemorydb_version_v2_info module (GET /versions) to retrieve the list of supported versions. To upgrade, provide a version listed in `can_upgrade_to` for the current version; downgrades are not supported.
instances int
True
The total number of instances in the cluster. A value of 1 creates a standalone instance; values 2-5 create a replicated setup with one primary and n-1 passive secondaries.
cores int
True
The number of dedicated CPU cores per instance.
ram int
True
The amount of memory per instance in gigabytes (GB). RAM cannot be downgraded because storage size is automatically derived from RAM.
connection dict
True
Connection information of the In-Memory DB cluster. A dict with keys `datacenter` (ID or name), `lan` (ID or name) and `primary_instance_address` (IP and netmask of the cluster's primary instance in CIDR notation, e.g. 192.168.1.101/24).
eviction_policy str
True
The key eviction policy applied when the memory limit is reached. Options: ['noeviction', 'allkeys-lru', 'allkeys-lfu', 'allkeys-random', 'volatile-lru', 'volatile-lfu', 'volatile-random', 'volatile-ttl']
persistence_mode str
False
Specifies how and whether data is persisted to disk. `None` disables persistence; `AOF` logs every write operation; `RDB` takes periodic point-in-time snapshots; `RDB_AOF` combines both. Options: ['None', 'AOF', 'RDB', 'RDB_AOF']
name str
True
The name of your In-Memory DB cluster. Must be 2-63 characters and must begin and end with an alphanumeric character (`[A-Za-z0-9]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
db_username str
False
The username for the initial In-Memory DB user. Must be 2-16 characters and may only contain alphanumeric characters (`[A-Za-z0-9]`) and underscores (`_`). Restricted usernames (for example, admin, standby) are not allowed. Required when creating a cluster (the module fails with an explicit message if it is missing on create); omit it against an existing cluster to keep the current user unchanged and the run idempotent. Supply db_username and db_password_hash together to (re)set the user or rotate its password; because the API never returns the hash for comparison, providing them always triggers an update (reported as changed). Ignored on restore: an in-place restore always reinstates the credentials stored in the snapshot, so a password cannot be rotated through state=restore.
db_password_hash str
False
The pre-hashed password for the initial In-Memory DB user. The hex-encoded hash of the password; must be exactly 64 lowercase hexadecimal characters (the standard output of SHA-256). Note: base64-encoded SHA-256 hashes (44 characters) are not accepted. The plaintext password is never sent to nor returned by the API. Required when creating a cluster (the module fails with an explicit message if it is missing on create); omit it against an existing cluster to leave the current password unchanged. Supplying it (together with db_username) always (re)sets the password and reports the task as changed, since the API never returns the hash for comparison; omit it for idempotent runs. Ignored on restore: an in-place restore always reinstates the credentials stored in the snapshot, so a password cannot be rotated through state=restore.
db_password_algorithm str
False
The hashing algorithm used to produce db_password_hash. Default: SHA-256 Options: ['SHA-256']
snapshot_location str
True
The Object Storage location where snapshots will be stored. For added data safety, use a different location than the cluster. The inmemorydb_snapshot_location_v2_info module provides a list of supported locations. Changing this forces the cluster to be re-created.
snapshot_retention_days int
True
The number of days snapshots are retained before being automatically deleted. Reducing this value causes the platform to purge any existing snapshots that fall outside the new retention window.
snapshot_hours list
True
Hours of the day (UTC) at which snapshots are scheduled to be taken. Each value must be between 0 and 23. At least one hour must be specified.
description str
False
A human-readable description for the cluster.
logs_enabled bool
False
Activates or deactivates log collection and reporting for this cluster's observability. If the observability service is not activated on the contract, this setting is accepted but has no effect until the service is activated.
metrics_enabled bool
False
Activates or deactivates metrics collection and reporting for this cluster's observability. If the observability service is not activated on the contract, this setting is accepted but has no effect until the service is activated.
source_snapshot_id str
False
The ID of the snapshot to initialize the cluster from when creating (restore from an existing snapshot).
recovery_target_time str
False
Recovery target time (ISO 8601). Restores the cluster from the most recent snapshot taken at or before that time. Optional on create (used together with source_snapshot_id); required for an in-place restore when state is `restore`. In-Memory DB does not provide continuous point-in-time recovery; the nearest preceding snapshot is used.
location str
False
The location (region) in which the cluster will be created. Different service endpoints are used based on location, possible options are: "de/fra", "de/txl", "es/vit", "fr/par", "gb/lhr", "gb/bhx", "us/ewr", "us/las", "us/mci". If not set, the endpoint will be the one corresponding to "de/fra". The api_url, if set, overrides this.
allow_replace bool
False
Boolean indicating if the resource should be recreated when the state cannot be reached in another way. This may be used to prevent resources from being deleted from specifying a different value to an immutable property. An error will be thrown instead Default: False
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:
inmemorydb_cluster str
True
The ID or name of an existing In-Memory DB Cluster.
location str
False
The location (region) in which the cluster will be created. Different service endpoints are used based on location, possible options are: "de/fra", "de/txl", "es/vit", "fr/par", "gb/lhr", "gb/bhx", "us/ewr", "us/las", "us/mci". If not set, the endpoint will be the one corresponding to "de/fra". The api_url, if set, overrides this.
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:
maintenance_window dict
False
A weekly 4 hour-long window, during which maintenance might occur. A dict with keys `time` (start of the maintenance window in UTC, e.g. "16:30:00") and `day_of_the_week` (e.g. "Sunday").
inmemorydb_version str
False
The In-Memory DB version of the cluster. Use the inmemorydb_version_v2_info module (GET /versions) to retrieve the list of supported versions. To upgrade, provide a version listed in `can_upgrade_to` for the current version; downgrades are not supported.
instances int
False
The total number of instances in the cluster. A value of 1 creates a standalone instance; values 2-5 create a replicated setup with one primary and n-1 passive secondaries.
cores int
False
The number of dedicated CPU cores per instance.
ram int
False
The amount of memory per instance in gigabytes (GB). RAM cannot be downgraded because storage size is automatically derived from RAM.
eviction_policy str
False
The key eviction policy applied when the memory limit is reached. Options: ['noeviction', 'allkeys-lru', 'allkeys-lfu', 'allkeys-random', 'volatile-lru', 'volatile-lfu', 'volatile-random', 'volatile-ttl']
persistence_mode str
False
Specifies how and whether data is persisted to disk. `None` disables persistence; `AOF` logs every write operation; `RDB` takes periodic point-in-time snapshots; `RDB_AOF` combines both. Options: ['None', 'AOF', 'RDB', 'RDB_AOF']
name str
False
The name of your In-Memory DB cluster. Must be 2-63 characters and must begin and end with an alphanumeric character (`[A-Za-z0-9]`) with dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between.
db_username str
False
The username for the initial In-Memory DB user. Must be 2-16 characters and may only contain alphanumeric characters (`[A-Za-z0-9]`) and underscores (`_`). Restricted usernames (for example, admin, standby) are not allowed. Required when creating a cluster (the module fails with an explicit message if it is missing on create); omit it against an existing cluster to keep the current user unchanged and the run idempotent. Supply db_username and db_password_hash together to (re)set the user or rotate its password; because the API never returns the hash for comparison, providing them always triggers an update (reported as changed). Ignored on restore: an in-place restore always reinstates the credentials stored in the snapshot, so a password cannot be rotated through state=restore.
db_password_hash str
False
The pre-hashed password for the initial In-Memory DB user. The hex-encoded hash of the password; must be exactly 64 lowercase hexadecimal characters (the standard output of SHA-256). Note: base64-encoded SHA-256 hashes (44 characters) are not accepted. The plaintext password is never sent to nor returned by the API. Required when creating a cluster (the module fails with an explicit message if it is missing on create); omit it against an existing cluster to leave the current password unchanged. Supplying it (together with db_username) always (re)sets the password and reports the task as changed, since the API never returns the hash for comparison; omit it for idempotent runs. Ignored on restore: an in-place restore always reinstates the credentials stored in the snapshot, so a password cannot be rotated through state=restore.
db_password_algorithm str
False
The hashing algorithm used to produce db_password_hash. Default: SHA-256 Options: ['SHA-256']
snapshot_retention_days int
False
The number of days snapshots are retained before being automatically deleted. Reducing this value causes the platform to purge any existing snapshots that fall outside the new retention window.
snapshot_hours list
False
Hours of the day (UTC) at which snapshots are scheduled to be taken. Each value must be between 0 and 23. At least one hour must be specified.
description str
False
A human-readable description for the cluster.
logs_enabled bool
False
Activates or deactivates log collection and reporting for this cluster's observability. If the observability service is not activated on the contract, this setting is accepted but has no effect until the service is activated.
metrics_enabled bool
False
Activates or deactivates metrics collection and reporting for this cluster's observability. If the observability service is not activated on the contract, this setting is accepted but has no effect until the service is activated.
inmemorydb_cluster str
True
The ID or name of an existing In-Memory DB Cluster.
location str
False
The location (region) in which the cluster will be created. Different service endpoints are used based on location, possible options are: "de/fra", "de/txl", "es/vit", "fr/par", "gb/lhr", "gb/bhx", "us/ewr", "us/las", "us/mci". If not set, the endpoint will be the one corresponding to "de/fra". The api_url, if set, overrides this.
allow_replace bool
False
Boolean indicating if the resource should be recreated when the state cannot be reached in another way. This may be used to prevent resources from being deleted from specifying a different value to an immutable property. An error will be thrown instead Default: False
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:
db_username str
False
The username for the initial In-Memory DB user. Must be 2-16 characters and may only contain alphanumeric characters (`[A-Za-z0-9]`) and underscores (`_`). Restricted usernames (for example, admin, standby) are not allowed. Required when creating a cluster (the module fails with an explicit message if it is missing on create); omit it against an existing cluster to keep the current user unchanged and the run idempotent. Supply db_username and db_password_hash together to (re)set the user or rotate its password; because the API never returns the hash for comparison, providing them always triggers an update (reported as changed). Ignored on restore: an in-place restore always reinstates the credentials stored in the snapshot, so a password cannot be rotated through state=restore.
db_password_hash str
False
The pre-hashed password for the initial In-Memory DB user. The hex-encoded hash of the password; must be exactly 64 lowercase hexadecimal characters (the standard output of SHA-256). Note: base64-encoded SHA-256 hashes (44 characters) are not accepted. The plaintext password is never sent to nor returned by the API. Required when creating a cluster (the module fails with an explicit message if it is missing on create); omit it against an existing cluster to leave the current password unchanged. Supplying it (together with db_username) always (re)sets the password and reports the task as changed, since the API never returns the hash for comparison; omit it for idempotent runs. Ignored on restore: an in-place restore always reinstates the credentials stored in the snapshot, so a password cannot be rotated through state=restore.
db_password_algorithm str
False
The hashing algorithm used to produce db_password_hash. Default: SHA-256 Options: ['SHA-256']
recovery_target_time str
True
Recovery target time (ISO 8601). Restores the cluster from the most recent snapshot taken at or before that time. Optional on create (used together with source_snapshot_id); required for an in-place restore when state is `restore`. In-Memory DB does not provide continuous point-in-time recovery; the nearest preceding snapshot is used.
inmemorydb_cluster str
True
The ID or name of an existing In-Memory DB Cluster.
location str
False
The location (region) in which the cluster will be created. Different service endpoints are used based on location, possible options are: "de/fra", "de/txl", "es/vit", "fr/par", "gb/lhr", "gb/bhx", "us/ewr", "us/las", "us/mci". If not set, the endpoint will be the one corresponding to "de/fra". The api_url, if set, overrides this.
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
Was this helpful?