Postgres Cluster

postgres_cluster

This is a module that supports creating, updating, restoring or destroying Postgres Clusters

Example Syntax


name: Create Cluster
ionoscloudsdk.ionoscloud.postgres_cluster:
  postgres_version: 12
  instances: 1
  cores: 1
  ram: 2048
  storage_size: 20480
  storage_type: SSD Premium
  location: de/fra
  backup_location: eu-central-2
  connections:
  - cidr: 192.168.1.106/24
    datacenter: 'AnsibleAutoTestDBaaS - DBaaS'
    lan: test_lan1
  display_name: backuptest-04
  synchronization_mode: ASYNCHRONOUS
  db_username: clusteruser
  db_password: 7357cluster
  wait: true
register: cluster_response


name: Update Cluster
ionoscloudsdk.ionoscloud.postgres_cluster:
  postgres_cluster: ''
  instances: 2
  cores: 2
  ram: 4096
  storage_size: 30480
  state: update
  wait: true
register: updated_cluster_response


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

Returned object

{
    "changed": true,
    "failed": false,
    "action": "create",
    "postgres_cluster": {
        "type": "cluster",
        "id": "46c151c7-55f8-42a4-86c3-06ad6b4b91ea",
        "metadata": {
            "created_date": "2023-05-30T14:35:40+00:00",
            "created_by": "<USER_EMAIL>",
            "created_by_user_id": "<USER_ID>",
            "last_modified_date": null,
            "last_modified_by": null,
            "last_modified_by_user_id": null,
            "state": "BUSY"
        },
        "properties": {
            "display_name": "backuptest-04",
            "postgres_version": "12",
            "location": "de/fra",
            "backup_location": "eu-central-2",
            "instances": 1,
            "ram": 2048,
            "cores": 1,
            "storage_size": 20480,
            "storage_type": "SSD Premium",
            "connections": [
                {
                    "datacenter_id": "03a8fdf1-fbc4-43f6-91ce-0506444e17dd",
                    "lan_id": "2",
                    "cidr": "<CIDR>"
                }
            ],
            "maintenance_window": {
                "time": "12:15:19",
                "day_of_the_week": "Monday"
            },
            "synchronization_mode": "ASYNCHRONOUS"
        }
    }
}

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:

  • connections

  • backup_location

  • location

  • synchronization_mode

  • storage_type

state: present

  
name: Create Cluster
ionoscloudsdk.ionoscloud.postgres_cluster:
  postgres_version: 12
  instances: 1
  cores: 1
  ram: 2048
  storage_size: 20480
  storage_type: SSD Premium
  location: de/fra
  backup_location: eu-central-2
  connections:
  - cidr: 192.168.1.106/24
    datacenter: 'AnsibleAutoTestDBaaS - DBaaS'
    lan: test_lan1
  display_name: backuptest-04
  synchronization_mode: ASYNCHRONOUS
  db_username: clusteruser
  db_password: 7357cluster
  wait: true
register: cluster_response

Available parameters for state present:

state: absent

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

Available parameters for state absent:

state: update

  
name: Update Cluster
ionoscloudsdk.ionoscloud.postgres_cluster:
  postgres_cluster: ''
  instances: 2
  cores: 2
  ram: 4096
  storage_size: 30480
  state: update
  wait: true
register: updated_cluster_response

Available parameters for state update:

state: restore

  

Available parameters for state restore:

Last updated