edbctl cluster v1.2
Manages database cluster resources. Use this command to create, edit, view, delete, and restore all types of clusters.
Commands
The edbctl cluster command has following options:
- edbctl cluster list — Displays active or deleted clusters.
- edbctl cluster list-connection-info — Lists the connection string for a specified cluster.
- edbctl cluster create — Creates a new cluster.
- edbctl cluster edit — Edits an existing cluster.
- edbctl cluster delete — Deletes a specified cluster.
- edbctl cluster restore — Restores a specified cluster
edbctl cluster list
Lists all active or deleted clusters. Use the [--deleted] flag to display deleted clusters. You can also filter results by cluster ID or architecture. When you provide the [--id] flag, detailed information about the cluster is displayed, including instance size, storage, and node count.
edbctl cluster list [--id] [--deleted] [options]
Where options are:
-i, --id string Cluster ID. Filter the list by a specific cluster ID. -n, --name string Cluster name. Filter the list by a specific cluster name. -d, --deleted The cluster is a deleted cluster. -A, --cluster-architecture string Cluster architecture ID. Filter the list by architecture (for example, single/ha). -o, --output string [table json yaml xml] (default "table") -c, --credential string The credential that you created via `credential create` command. The default is fetched from `context_credential` -P, --project string The project that groups your clusters and other resources. The default is taken from `context_project`. -h, --help Help for list.
Examples
edbctl cluster list edbctl cluster list --id p-c5fh47nfjcg4ci71uv32 edbctl cluster list --deleted
edbctl cluster list-connection-info
Retrieves and displays the connection string for a specified Postgres cluster using its cluster ID. The output includes the read/write URI, database name, host, port, and user.
edbctl cluster list-connection-info {--id} [options]
Where options are:
-i, --id string Cluster ID (required). The unique identifier for the cluster to list connection string. -o, --output string [table json yaml xml] (default "table") -c, --credential string The credential that you created via `credential create` command. The default is fetched from `context_credential`. -P, --project string The project that groups your clusters and other resources. the default is taken from `context_project`. -h, --help Help for list-connection-info.
These examples show how to retrieve and display the connection strings for specific clusters:
edbctl cluster list-connection-info --id <pg_id> edbctl cluster list-connection-info -i <pg_id>
edbctl cluster create
Creates a cluster using a specified configuration file.
This command provisions a new cluster based on the settings defined in a YAML configuration file. The file specifies key details such as:
- Cluster Type: single, ha, pgd, aha, or analytics
- PostgreSQL Configuration: pgConfig
- Resource Allocation: storage, memory
- Backup Settings
- Image
edbctl cluster create [options]
Where options are:
-F, --config-file string Path to the cluster config YAML file. -c, --credential string The credential that you created via the `credential create` command. The default is fetched from `context_credential`. -h, --help Help for create. -P, --project string The project that groups your clusters and other resources. The default is taken from `context_project`. -y, --yes Auto-confirm all confirmations.
This example shows how to create a cluster using a YAML configuration file:
edbctl cluster create -F <any sample YAML Configuration file>
create-single.yaml:
clusterType: single # required, type of the cluster tags: # Optional tags for the cluster with name and color(valid name or hex color code) - color: blue tagName: tag-1 networking: public # Network access type for the cluster. Valid values: private, public clusterName: create-single-name # required deploymentLocation: managed-devspatcher # required password: password@1234 # Password must be 12 characters or more #allowedIpRanges: # Must contain at least one IP range with subnet mask when specified # - cidrBlock: 127.0.0.1/24 # description: test backupRetentionPeriod: 30d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) backupSchedule: 39 13 23 * * * # Scheduled Backup Cron image: # required, user can fetch list of supported images with command `edbctl image list-image-tags` url: docker.enterprisedb.com/staging_pgai-platform/enterprisedb/starlight/postgres:15.10-deb-full digest: sha256:0053c3dfe9011f9b441967105ed980e21ba96ccf896f95e0c83305a89e176d34 postgresqlConfiguration: # Optional max_connections: 100 instanceSize: cpuCores: 1 # CPU must be between 0.1 and 15 Cores memoryGi: 1 # Memory must be between 0.1 and 10 Gi storage: databaseStorage: sizeGi: 1 # Size must be between 0 and Unlimited (0-Unlimited Gi) storageClass: standard-csi # Storage class must be valid (standard-csi, ssd-csi, etc.) walStorage: # Optionalfield. WAL Storage size in Gi, a separate storage volume for Write-Ahead Logs (Recommended for high write workloads) (Optional) sizeGi: 1 # Size must be between 0 and Unlimited (0-Unlimited Gi) storageClass: ssd-csi # Storage class must be valid (standard-csi, ssd-csi, etc.) #transparentDataEncryption: # passphrase: mypassphrase
create-ha.yaml:
clusterType: ha # Type of the cluster tags: # Optional tags for the cluster with name and color(valid name or hex color code) - color: blue tagName: tag-1 clusterName: create-ha-name # required deploymentLocation: managed-devspatcher # required password: password@1234 #Password must be 12 characters or more networking: public # Network access type for the cluster. Valid values: private, public #allowedIpRanges: # Must contain at least one IP range with subnet mask when specified # - cidrBlock: 127.0.0.1/24 # description: test backupRetentionPeriod: 30d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) backupSchedule: 39 13 23 * * * # Scheduled Backup Cron image: # required, user can fetch list of supported images with command `edbctl image list-image-tags` url: docker.enterprisedb.com/staging_pgai-platform/enterprisedb/starlight/postgres:15.10-deb-full digest: sha256:0053c3dfe9011f9b441967105ed980e21ba96ccf896f95e0c83305a89e176d34 postgresqlConfiguration: # Optional max_connections: 100 instanceSize: cpuCores: 1 # CPU must be between 0.1 and 15 Cores memoryGi: 1 # Memory must be between 0.1 and 10 Gi storage: databaseStorage: sizeGi: 1 # Size must be between 0 and Unlimited (0-Unlimited Gi) storageClass: standard-csi # Storage class must be valid (standard-csi, ssd-csi, etc.) walStorage: # Optionalfield. WAL Storage size in Gi, a separate storage volume for Write-Ahead Logs (Recommended for high write workloads) (Optional) sizeGi: 1 # Size must be between 0 and Unlimited (0-Unlimited Gi) storageClass: standard-csi # Storage class must be valid (standard-csi, ssd-csi, etc.) #transparentDataEncryption: # passphrase: mypassphrase standbyReplicas: 2 # for HA cluster
create-analytics.yaml:
clusterType: analytics # required, type of the cluster tags: # Optional tags for the cluster with name and color(valid name or hex color code) - color: blue tagName: tag-1 clusterName: create-analytics-name # required deploymentLocation: managed-devspatcher # required password: password@1234 #Password must be 12 characters or more networking: public # Network access type for the cluster. Valid values: private, public #allowedIpRanges: # Must contain at least one IP range with subnet mask when specified # - cidrBlock: 127.0.0.1/24 # description: test backupRetentionPeriod: 30d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) backupSchedule: 39 13 23 * * * # Scheduled Backup Cron image: # required, user can fetch list of supported images with command `edbctl image list-image-tags` digest: sha256:1af29d275b024bc2bb93d7f7acacfbbec2b5f91854815accd7b68396b611ad32 url: upmdev.azurecr.io/enterprisedb/starlight:16.4.1-34-debian-pgextended-full-ba postgresqlConfiguration: # Optional max_connections: 100 instanceSize: cpuCores: 1 # CPU must be between 0.1 and 15 Cores memoryGi: 1 # Memory must be between 0.1 and 10 Gi
create-pgd.yaml:
clusterType: pgd # Type of the cluster tags: # Optional tags for the cluster with name and color(valid name or hex color code) - color: blue tagName: tag-1 clusterName: create-pgd-name # required password: Password@1234 #Password must be 12 characters or more dataGroups: - deploymentLocation: managed-devspatcher # required groupName: Data Group A # required networking: public # Network access type for the cluster. Valid values: private, public # allowedIpRanges: # Must contain at least one IP range with subnet mask when specified # - cidrBlock: 9.9.9.9/28 # description: Allow traffic from App A # - cidrBlock: 10.10.10.10/27 # description: Allow traffic from App B backupRetentionPeriod: 30d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) nodes: 3 # only can be set to 2 or 3 image: # required, user can fetch list of supported images with command `edbctl image list-image-tags` url: upmdev.azurecr.io/enterprisedb/starlight:15.8.1-5.5.1-3-debian-bdr-pgextended-ba digest: sha256:392d793f5db1c42e20a7b34864e60f6fafbe71540543b3a86baf39dbb099f053 postgresqlConfiguration: max_connections: 100 max_locks_per_transaction: 64 backupSchedule: 27 26 0 * * * # Scheduled Backup Cron instanceSize: cpuCores: 1 # CPU must be between 0.1 and 15 Cores memoryGi: 2 # Memory must be between 0.1 and 10 Gi. For PGD clusters, the recommended memory is 2 Gi or more. storage: databaseStorage: sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). For PGD clusters, the recommended size is 10 Gi or more. storageClass: ssd-csi # valid storage class (standard-csi, ssd-csi, etc.) walStorage: # Optional, WAL Storage size in Gi, a separate storage volume for Write-Ahead Logs. sizeGi: 1 # Size must be between 0 and Unlimited (0-Unlimited Gi) storageClass: ssd-csi #Valid storage class (standard-csi, ssd-csi, etc.) - deploymentLocation: managed-devspatcher # required groupName: Data Group B networking: public # Network access type for the cluster. Valid values: private, public # allowedIpRanges: # - cidrBlock: 9.9.9.9/28 # description: Allow traffic from App A # - cidrBlock: 10.10.10.10/27 # description: Allow traffic from App B backupRetentionPeriod: 30d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) nodes: 3 # only can be set to 2 or 3 image: # required, user can fetch list of supported images with command `edbctl image list-image-tags` url: upmdev.azurecr.io/enterprisedb/starlight:15.8.1-5.5.1-3-debian-bdr-pgextended-ba # required digest: sha256:392d793f5db1c42e20a7b34864e60f6fafbe71540543b3a86baf39dbb099f053 # required postgresqlConfiguration: max_connections: 100 max_locks_per_transaction: 64 backupSchedule: 6 27 0 * * * # Scheduled Backup Cron instanceSize: cpuCores: 1 # CPU must be between 0.1 and 15 Cores memoryGi: 2 # Memory must be between 0.1 and 10 Gi. For PGD clusters, the recommended memory is 2 Gi or more. storage: databaseStorage: sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). For PGD clusters, the recommended size is 10 Gi or more. storageClass: standard-csi #valid storage class (standard-csi, ssd-csi, etc.) walStorage: # Optional field, but default value is 1 Gi sizeGi: 1 # Size must be between 0 and Unlimited (0-Unlimited Gi) storageClass: standard-csi # Storage class must be valid (standard-csi, ssd-csi, etc.) witnessGroups: - deploymentLocation: managed-devspatcher # required groupName: Witness Group # required image: # required, user can fetch list of supported images with command `edbctl image list-image-tags` url: upmdev.azurecr.io/enterprisedb/starlight:15.8.1-5.5.1-3-debian-bdr-pgextended-ba # required digest: sha256:392d793f5db1c42e20a7b34864e60f6fafbe71540543b3a86baf39dbb099f053 # required instanceSize: cpuCores: 1 # CPU must be between 0.1 and 15 Cores memoryGi: 2 # Memory must be between 0.1 and 10 Gi. For PGD clusters, the recommended memory is 2 Gi or more.
create-aha.yaml:
clusterType: aha # required, type of the cluster tags: # Optional tags for the cluster with name and color(valid name or hex color code) - color: blue tagName: tag-1 clusterName: create-aha-name # required password: Password@1234 # Password must be 12 characters or more dataGroup: deploymentLocation: managed-devspatcher # required groupName: Data Group A # required networking: public # Network access type for the cluster. Valid values: private, public # allowedIpRanges: # Optional, must contain at least one IP range with subnet mask when specified # - cidrBlock: 9.9.9.9/28 # description: Allow traffic from App A # - cidrBlock: 10.10.10.10/27 # description: Allow traffic from App B backupRetentionPeriod: 30d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) nodes: 3 # only can be set to 1, 2 or 3 image: # required, user can fetch list of supported images with command `edbctl image list-image-tags` url: 339713079902.dkr.ecr.us-east-1.amazonaws.com/uat-hcp/postgresql-testing:17.4-2505140720-pgds-full digest: sha256:581f5f126093163825a7ea0f2cd32883100ff2a01b032da59c3231c5748b94a4 postgresqlConfiguration: max_connections: 100 max_locks_per_transaction: 64 backupSchedule: 27 26 0 * * * # Scheduled Backup Cron instanceSize: cpuCores: 2 # CPU must be between 0.1 and 47.51 Cores memoryGi: 2 # Memory must be between 0.1 and 178.51 Gi. For Aha clusters, the recommended memory is 2 Gi or more. storage: databaseStorage: sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). For Aha clusters, the recommended size is 10 Gi or more. storageClass: ssd-csi # Storage class must be valid (standard-csi, ssd-csi, etc.) walStorage: sizeGi: 20 # Size must be between 0 and Unlimited (0-Unlimited Gi) storageClass: standard-csi # Storage class must be valid (standard-csi, ssd-csi, etc.)
edbctl cluster edit
Edits an existing cluster using a YAML configuration file. This command allows you to modify cluster settings, database configurations, backup policies, extensions, and resource allocations.
edbctl cluster edit [options]
Where options are:
-F, --config-file string Path to the cluster config YAML file. -c, --credential string The credential that you created via the `credential create`' command. The default is fetched from `context_credential`. -h, --help Help for edit. -P, --project string The project that groups your clusters and other resources. The default is taken from `context_project`. -y, --yes Auto-confirm all confirmations.
This example shows how to edit a cluster using a YAML configuration file:
edbctl cluster edit -F <any sample YAML configuration file>
edit-single.yaml:
clusterType: single # checks that cluster type is a single cluster, this can only be changed to ha clusterId: p-abcdefg # cluster id of the cluster to be edited tags: # Optional tags for the cluster with name and color(valid name or hex color code). Remove 'tags' to preserve existing tags. 'tags' values will overwrite existing tags. set 'tags: []' to remove all tags. - color: blue tagName: production - color: green tagName: staging - color: red tagName: development clusterName: edit-single-name primaryPgName: edited-primary-replica-name imageId: 6535c8bc9e358f0afaf5a706ea1bc722 # Image ID can be fetched with command `edbctl image list-image-tags`, only one of `imageId` or `image` should be set password: password@1234 #Password must be 12 characters or more networking: private # Network access type for the cluster. Valid values: private, public #allowedIpRanges: # Must contain at least one IP range with subnet mask when specified # - cidrBlock: "192.168.1.0/24" # description: "Office network" # - cidrBlock: "10.0.0.0/16" # description: "VPN network" backupRetentionPeriod: 40d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) #image: # only one of `imageId` or `image` should be set # url: docker.example.com/platform/example/postgres:latest # digest: sha256:dummyhash1234567890abcdef1234567890abcdef1234567890abcdef1234567890 postgresqlConfiguration: # Optional max_connections: 500 shared_buffers: 256 application_name: beaconator backupSchedule: 0 6 * * * # Scheduled Backup Time in Cron format (UTC) instanceSize: cpuCores: 4 # CPU must be between 0.1 and 15 Cores memoryGi: 16 # Memory must be between 0.1 and 10 Gi storage: databaseStorage: # Primary Storage size in Gi sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). Size needs to be the same or greater than the existing databaseStorage size. storageClass: ssd-csi # Supported storage classes can be fetched with command `edbctl image list-image-tags` and checking `Supported Storage Classes` field walStorage: # Optional field. WAL Storage size in Gi, a separate storage volume for Write-Ahead Logs (Recommended for high write workloads) (Optional) sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). Size needs to be the same or greater than the existing walStorage size. storageClass: ssd-csi # Supported storage classes can be fetched with command `edbctl image list-image-tags` and checking `Supported Storage Classes` field # to edit: if you provide a replica with a replicaPgId then that existing replica will be preserved/edited # to add a replica: if you do provide a replica without a replicaPgId then a new replica will be created # to remove a replica: if you do not provide a replica with a replicaPgId that exists then that existing replica will be removed replicaClusters: # this is editing a replica cluster because it provides a replicaPgId - replicaPgId: p-abcdefg-b replicaPgName: test replica d imageId: 6535c8bc9e358f0afaf5a706ea1bc722 # Image ID can be fetched with command `edbctl image list-image-tags --location-id <location-id>`, only one of `imageId` or `image` should be set networking: private # Network access type for the cluster. Valid values: private, public #allowedIpRanges: # Must contain at least one IP range with subnet mask when specified # - cidrBlock: "192.168.1.0/24" # description: "Office network" # - cidrBlock: "10.0.0.0/16" # description: "VPN network" backupRetentionPeriod: 40d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) #image: # only one of `imageId` or `image` should be set # url: docker.example.com/platform/example/postgres:latest # digest: sha256:dummyhash1234567890abcdef1234567890abcdef1234567890abcdef1234567890 postgresqlConfiguration: # Optional max_connections: 500 shared_buffers: 256 application_name: beaconator backupSchedule: 0 6 * * * # Scheduled Backup Time in Cron format (UTC) instanceSize: cpuCores: 4 # CPU must be between 0.1 and 15 Cores memoryGi: 16 # Memory must be between 0.1 and 10 Gi storage: databaseStorage: # Primary Storage size in Gi sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). Size needs to be the same or greater than the existing databaseStorage size. storageClass: ssd-csi # Supported storage classes can be fetched with command `edbctl image list-image-tags` and checking `Supported Storage Classes` field walStorage: # Optional field. WAL Storage size in Gi, a separate storage volume for Write-Ahead Logs (Recommended for high write workloads) (Optional) sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). Size needs to be the same or greater than the existing walStorage size. storageClass: ssd-csi # Supported storage classes can be fetched with command `edbctl image list-image-tags` and checking `Supported Storage Classes` field # this is adding a new replica because it does not provide a replicaPgId - replicaPgName: test replica e deploymentLocation: managed-devspatcher imageId: 6535c8bc9e358f0afaf5a706ea1bc722 # Image ID can be fetched with command `edbctl image list-image-tags --location-id <location-id>`, only one of `imageId` or `image` should be set networking: private # Network access type for the cluster. Valid values: private, public #allowedIpRanges: # Must contain at least one IP range with subnet mask when specified # - cidrBlock: "192.168.1.0/24" # description: "Office network" # - cidrBlock: "10.0.0.0/16" # description: "VPN network" backupRetentionPeriod: 40d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) #image: # only one of `imageId` or `image` should be set # url: docker.example.com/platform/example/postgres:latest # digest: sha256:dummyhash1234567890abcdef1234567890abcdef1234567890abcdef1234567890 postgresqlConfiguration: # Optional max_connections: 500 shared_buffers: 256 application_name: beaconator backupSchedule: 0 6 * * * # Scheduled Backup Time in Cron format (UTC) instanceSize: cpuCores: 4 # CPU must be between 0.1 and 15 Cores memoryGi: 16 # Memory must be between 0.1 and 10 Gi storage: databaseStorage: # Primary Storage size in Gi sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). Size needs to be the same or greater than the existing databaseStorage size. storageClass: ssd-csi # Supported storage classes can be fetched with command `edbctl image list-image-tags` and checking `Supported Storage Classes` field walStorage: # Optional field. WAL Storage size in Gi, a separate storage volume for Write-Ahead Logs (Recommended for high write workloads) (Optional) sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). Size needs to be the same or greater than the existing walStorage size. storageClass: ssd-csi # Supported storage classes can be fetched with command `edbctl image list-image-tags` and checking `Supported Storage Classes` field # any replicas that are not provided with a replicaPgId will be removed
edit-ha.yaml:
clusterType: ha # checks that cluster type is a ha cluster, this can only be changed to single clusterId: p-abcdefg # cluster id of the cluster to be edited tags: # Optional tags for the cluster with name and color(valid name or hex color code). Remove 'tags' to preserve existing tags. 'tags' values will overwrite existing tags. set 'tags: []' to remove all tags. - color: blue tagName: production - color: green tagName: staging - color: red tagName: development clusterName: edit-ha-name imageId: 6535c8bc9e358f0afaf5a706ea1bc722 # Image ID can be fetched with command `edbctl image list-image-tags`, only one of `imageId` or `image` should be set password: password@1234 #Password must be 12 characters or more networking: private # Network access type for the cluster. Valid values: private, public #allowedIpRanges: # Must contain at least one IP range with subnet mask when specified # - cidrBlock: "192.168.1.0/24" # description: "Office network" # - cidrBlock: "10.0.0.0/16" # description: "VPN network" backupRetentionPeriod: 40d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) #image: # only one of `imageId` or `image` should be set # url: docker.example.com/platform/example/postgres:latest # digest: sha256:dummyhash1234567890abcdef1234567890abcdef1234567890abcdef1234567890 postgresqlConfiguration: # Optional max_connections: 500 shared_buffers: 256 application_name: beaconator backupSchedule: 0 6 * * * # Scheduled Backup Time in Cron format (UTC) instanceSize: cpuCores: 4 # CPU must be between 0.1 and 15 Cores memoryGi: 16 # Memory must be between 0.1 and 10 Gi storage: databaseStorage: # Primary Storage size in Gi sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). Size needs to be the same or greater than the existing databaseStorage size. storageClass: ssd-csi # Supported storage classes can be fetched with command `edbctl image list-image-tags` and checking `Supported Storage Classes` field walStorage: # Optional field. WAL Storage size in Gi, a separate storage volume for Write-Ahead Logs (Recommended for high write workloads) (Optional) sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). Size needs to be the same or greater than the existing walStorage size. storageClass: ssd-csi # Supported storage classes can be fetched with command `edbctl image list-image-tags` and checking `Supported Storage Classes` field # to edit: if you provide a replica with a replicaPgId then that existing replica will be preserved/edited # to add a replica: if you do provide a replica without a replicaPgId then a new replica will be created # to remove a replica: if you do not provide a replica with a replicaPgId that exists then that existing replica will be removed standbyReplicas: 3 # for HA cluster replicaClusters: # this is editing a replica cluster because it provides a replicaPgId - replicaPgId: p-abcdefg-b replicaPgName: test replica d imageId: 6535c8bc9e358f0afaf5a706ea1bc722 # Image ID can be fetched with command `edbctl image list-image-tags --location-id <location-id>`, only one of `imageId` or `image` should be set networking: private # Network access type for the cluster. Valid values: private, public #allowedIpRanges: # Must contain at least one IP range with subnet mask when specified # - cidrBlock: "192.168.1.0/24" # description: "Office network" # - cidrBlock: "10.0.0.0/16" # description: "VPN network" backupRetentionPeriod: 40d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) #image: # only one of `imageId` or `image` should be set # url: docker.example.com/platform/example/postgres:latest # digest: sha256:dummyhash1234567890abcdef1234567890abcdef1234567890abcdef1234567890 postgresqlConfiguration: # Optional max_connections: 500 shared_buffers: 256 application_name: beaconator backupSchedule: 0 6 * * * # Scheduled Backup Time in Cron format (UTC) instanceSize: cpuCores: 4 # CPU must be between 0.1 and 15 Cores memoryGi: 16 # Memory must be between 0.1 and 10 Gi storage: databaseStorage: # Primary Storage size in Gi sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). Size needs to be the same or greater than the existing databaseStorage size. storageClass: ssd-csi # Supported storage classes can be fetched with command `edbctl image list-image-tags` and checking `Supported Storage Classes` field walStorage: # Optional field. WAL Storage size in Gi, a separate storage volume for Write-Ahead Logs (Recommended for high write workloads) (Optional) sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). Size needs to be the same or greater than the existing walStorage size. storageClass: ssd-csi # Supported storage classes can be fetched with command `edbctl image list-image-tags` and checking `Supported Storage Classes` field standbyReplicas: 3 # for HA cluster # this is adding a new replica because it does not provide a replicaPgId - replicaPgName: test replica e deploymentLocation: managed-devspatcher imageId: 6535c8bc9e358f0afaf5a706ea1bc722 # Image ID can be fetched with command `edbctl image list-image-tags --location-id <location-id>`, only one of `imageId` or `image` should be set networking: private # Network access type for the cluster. Valid values: private, public #allowedIpRanges: # Must contain at least one IP range with subnet mask when specified # - cidrBlock: "192.168.1.0/24" # description: "Office network" # - cidrBlock: "10.0.0.0/16" # description: "VPN network" backupRetentionPeriod: 40d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) #image: # only one of `imageId` or `image` should be set # url: docker.example.com/platform/example/postgres:latest # digest: sha256:dummyhash1234567890abcdef1234567890abcdef1234567890abcdef1234567890 postgresqlConfiguration: # Optional max_connections: 500 shared_buffers: 256 application_name: beaconator backupSchedule: 0 6 * * * # Scheduled Backup Time in Cron format (UTC) instanceSize: cpuCores: 4 # CPU must be between 0.1 and 15 Cores memoryGi: 16 # Memory must be between 0.1 and 10 Gi storage: databaseStorage: # Primary Storage size in Gi sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). Size needs to be the same or greater than the existing databaseStorage size. storageClass: ssd-csi # Supported storage classes can be fetched with command `edbctl image list-image-tags` and checking `Supported Storage Classes` field walStorage: # Optional field. WAL Storage size in Gi, a separate storage volume for Write-Ahead Logs (Recommended for high write workloads) (Optional) sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). Size needs to be the same or greater than the existing walStorage size. storageClass: ssd-csi # Supported storage classes can be fetched with command `edbctl image list-image-tags` and checking `Supported Storage Classes` field standbyReplicas: 3 # for HA cluster # any replicas that are not provided with a replicaPgId will be removed
edit-analytics.yaml:
clusterType: analytics # checks that cluster type is an analytics cluster, cannot change this field clusterId: p-pd6kf9unmi # required, cluster ID of the cluster to be edited tags: # Optional tags for the cluster with name and color(valid name or hex color code). Remove 'tags' to preserve existing tags. 'tags' values will overwrite existing tags. set 'tags: []' to remove all tags. - color: blue tagName: production - color: green tagName: staging - color: red tagName: development imageId: 6138b8f8e2293a87ebf7ba8dfd1f74da # Image ID can be fetched with command `edbctl image list-image-tags`, only one of `imageId` or `image` should be set clusterName: edit-analytics-name password: password@1234 #Password must be 12 characters or more networking: private # Network access type for the cluster. Valid values: private, public #allowedIpRanges: # Must contain at least one IP range with subnet mask when specified # - cidrBlock: 192.168.1.0/24 # description: Office network # - cidrBlock: 10.0.0.0/16 # description: VPN network backupRetentionPeriod: 30d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) backupSchedule: 0 6 * * * # Scheduled Backup Time in Cron format (UTC) #image: # only one of `imageId` or `image` should be set # url: docker.example.com/platform/example/postgres:latest # digest: sha256:dummyhash1234567890abcdef1234567890abcdef1234567890abcdef1234567890 postgresqlConfiguration: # Optional max_connections: 100 max_locks_per_transaction: 64 instanceSize: cpuCores: 4 # CPU must be between 0.1 and 15 Cores memoryGi: 16 # Memory must be between 0.1 and 10 Gi
edit-pgd.yaml:
clusterType: pgd # checks that cluster type is a pgd cluster, cannot change this field clusterId: p-12345abcde tags: # Optional tags for the cluster with name and color(valid name or hex color code). Remove 'tags' to preserve existing tags. 'tags' values will overwrite existing tags. set 'tags: []' to remove all tags. - color: blue tagName: tag-1 clusterName: edit-pgd-name password: Password@1234 dataGroups: # add new data group A - groupName: Data Group A # required imageId: 6138b8f8e2293a87ebf7ba8dfd1f74da # Image ID can be fetched with command `edbctl image list-image-tags`, only one of `imageId` or `image` should be set networking: private # Network access type for the cluster. Valid values: private, public # allowedIpRanges: # Must contain at least one IP range with subnet mask when specified # - cidrBlock: 9.9.9.9/28 # description: Allow traffic from App A # - cidrBlock: 10.10.10.10/27 # description: Allow traffic from App B backupRetentionPeriod: 30d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) nodes: 2 # only can be set to 2 or 3 # image: # only one of `imageId` or `image` should be set # url: docker.example.com/platform/example/postgres:latest # digest: sha256:dummyhash1234567890abcdef1234567890abcdef1234567890abcdef1234567890 postgresqlConfiguration: # Optional max_connections: 100 max_locks_per_transaction: 64 backupSchedule: 0 4 8 * * * # Scheduled Backup Cron instanceSize: cpuCores: 2 # CPU must be between 0.1 and 15 Cores memoryGi: 2 # Memory must be between 0.1 and 10 Gi. For PGD clusters, the recommended memory is 2 Gi or more. storage: databaseStorage: # Size must be between 0 and Unlimited (0-Unlimited Gi) sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). For PGD clusters, the recommended size is 10 Gi or more. Size needs to be the same or greater than the existing databaseStorage size. walStorage: # Optional, WAL Storage size in Gi, a separate storage volume for Write-Ahead Logs. sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). Size needs to be the same or greater than the existing walStorage size. storageClass: ssd-csi # Supported storage classes can be fetched with command `edbctl image list-image-tags` and checking `Supported Storage Classes` field - groupId: p-12345abcde-x networking: private # Network access type for the cluster. Valid values: private, public groupName: Data Group B # required imageId: 6138b8f8e2293a87ebf7ba8dfd1f74da # Image ID can be fetched with command `edbctl image list-image-tags`, only one of `imageId` or `image` should be set # allowedIpRanges: # Must contain at least one IP range with subnet mask when specified # - cidrBlock: 9.9.9.9/28 # description: Allow traffic from App A # - cidrBlock: 10.10.10.10/27 # description: Allow traffic from App B backupRetentionPeriod: 30d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) nodes: 2 # only can be set to 2 or 3 # image: # only one of `imageId` or `image` should be set # url: docker.example.com/platform/example/postgres:latest # digest: sha256:dummyhash1234567890abcdef1234567890abcdef1234567890abcdef1234567890 postgresqlConfiguration: # Optional max_connections: 100 max_locks_per_transaction: 64 backupSchedule: 0 4 8 * * * # Scheduled Backup Cron instanceSize: cpuCores: 2 # CPU must be between 0.1 and 15 Cores memoryGi: 2 # Memory must be between 0.1 and 10 Gi. For PGD clusters, the recommended memory is 2 Gi or more. storage: databaseStorage: sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). Size needs to be the same or greater than the existing databaseStorage size. walStorage: # Optional, WAL Storage size in Gi, a separate storage volume for Write-Ahead Logs. sizeGi: 10 # Size must be between 0 and Unlimited (0-Unlimited Gi). Size needs to be the same or greater than the existing walStorage size. storageClass: ssd-csi # Supported storage classes can be fetched with command `edbctl image list-image-tags` and checking `Supported Storage Classes` field witnessGroups: # add new witness group - groupName: Witness Group A # required when adding a new witness group imageId: 6138b8f8e2293a87ebf7ba8dfd1f74da # Image ID can be fetched with command `edbctl image list-image-tags`, only one of `imageId` or `image` should be set # image: # only one of `imageId` or `image` should be set # url: docker.example.com/platform/example/postgres:latest # digest: sha256:dummyhash1234567890abcdef1234567890abcdef1234567890abcdef1234567890 instanceSize: cpuCores: 2 # CPU must be between 0.1 and 15 Cores memoryGi: 2 # Memory must be between 0.1 and 10 Gi. For PGD clusters, the recommended memory is 2 Gi or more.
Note
The following fields are mandatory while editing a cluster:
clusterIDclusterType
All the other fields are optional. If omitted, the original values from the cluster are used.
YAML group logic for editing a PGD cluster:
Retain: Providing only a
groupIdkeeps that existing group as-is.Update: Providing a
groupIdalong with specific fields (e.g.,image,groupName) retains the group and applies the new values to those fields.Create: Providing group details (e.g.,
groupName,image) without agroupIdwill trigger the creation of a new group.Delete: Omitting a
groupIdentirely from the list (for an existing group) will result in that group being removed.
edbctl cluster delete
Deletes a specified cluster using its cluster ID. This action permanently removes the cluster from your project and can't be undone, so ensure you have the correct cluster ID before proceeding.
edbctl cluster delete [options]
Where options are:
-i, --id string Cluster ID (required). The unique identifier for the cluster to delete. -c, --credential string The credential that you created via the `credential create` command. The default is fetched from `context_credential`. -y, --yes Auto-confirm all confirmations. -P, --project string The project that groups your clusters and other resources, the default is taken from `context_project`. -h, --help Help for delete
These examples show how to delete the cluster:
edbctl cluster delete edbctl cluster delete --id p-8nllnskncq edbctl cluster delete -i p-8nllnskncq
edbctl cluster restore
You can restore a cluster by providing a YAML configuration file with the required specifications. Use the cluster restore command and pass the file using the --file or -f option. While restoring, you must specify one of the following restore modes:
fullpointInTime
Make sure you uncomment only one mode at a time.
Note
The restoreRequest and password fields are mandatory for all clusters except PGD and AHA. All other fields are optional and default to the values from the source cluster if not specified.
edbctl cluster restore [options]
Where options are:
-F, --config-file string Path to the cluster config YAML file (required). -c, --credential string The credential that you created via the `credential create` command. The default is fetched from `context_credential`. -y, --yes Auto-confirm all confirmations. -P, --project string The project that groups your clusters and other resources. The default is taken from `context_project`. -h, --help Help for restore.
This example shows how to restore a cluster using a YAML configuration file:
edbctl cluster restore -F <any sample YAML configuration file>
restore-single.yaml
# Cluster type must be "single" or "ha" (default: same as source cluster) clusterType: single # Optional: Tags to apply to the restored cluster # To remove all tags, use: tags: [] # To inherit tags from the source cluster, omit this field tags: - color: blue tagName: tag-1 # Name of the restored cluster clusterName: restore-single-name # Location where the cluster will be deployed deploymentLocation: managed-devspatcher # Cluster admin password (minimum 12 characters) password: password@1234 # Restore configuration - either full or point-in-time restore must be specified restoreRequest: full: postgresBackupId: 20241112T211900 sourceClusterId: p-12345abcde # pointInTime: # pointInTime: '2025-01-01T13:40:04.000Z' # sourceClusterId: p-12345abcde # Optional: Networking configuration networking: public # Valid values: public, private # Optional: IP ranges allowed to access the cluster # allowedIpRanges: # - cidrBlock: 127.0.0.1/24 # description: test # Optional: Backup retention policy backupRetentionPeriod: 30d # Valid units: d (days), w (weeks), m (months) # Optional: Backup schedule in cron format backupSchedule: 39 13 23 * * * # Optional: Base image for the cluster image: digest: sha256:c37c5d0ff1a9318919b9581c61286fcfce87f0c5b13000ff036da8bcf253173c url: upmdev.azurecr.io/enterprisedb/starlight:15.8-3-debian # Optional: PostgreSQL configuration parameters postgresqlConfiguration: max_connections: 100 # Required: Instance size (CPU and memory) instanceSize: cpuCores: 1 # Must be between 0.1 and 15 cores memoryGi: 1 # Must be between 0.1 and 10 Gi # Required: Storage configuration storage: databaseStorage: sizeGi: 1 # Any value >= 0 storageClass: standard-csi walStorage: # Optional but recommended for high-write workloads sizeGi: 1 storageClass: standard-csi # Optional: Transparent data encryption # transparentDataEncryption: # passphrase: mypassphrase
restore-ha.yaml
# Cluster type must be "ha" or "single" (default: same as source cluster) clusterType: ha # Optional: Tags to apply to the restored cluster # To remove all tags, use: tags: [] # To inherit tags from the source cluster, omit this field tags: - color: blue tagName: tag-1 # Name of the restored cluster clusterName: restore-ha-name # Location where the cluster will be deployed deploymentLocation: managed-devspatcher # Cluster admin password (minimum 12 characters) password: password@1234 # Restore configuration - either full or point-in-time restore must be specified restoreRequest: full: postgresBackupId: 20241112T211900 sourceClusterId: p-12345abcde # pointInTime: # pointInTime: '2025-01-01T13:40:04.000Z' # sourceClusterId: p-12345abcde # Optional: Networking configuration networking: public # Valid values: public, private # Optional: IP ranges allowed to access the cluster # allowedIpRanges: # - cidrBlock: 127.0.0.1/24 # description: test # Optional: Backup retention policy backupRetentionPeriod: 30d # Valid units: d (days), w (weeks), m (months) # Optional: Backup schedule in cron format backupSchedule: 39 13 23 * * * # Optional: Base image for the cluster image: digest: sha256:c37c5d0ff1a9318919b9581c61286fcfce87f0c5b13000ff036da8bcf253173c url: upmdev.azurecr.io/enterprisedb/starlight:15.8-3-debian # Optional: PostgreSQL configuration parameters postgresqlConfiguration: max_connections: 100 # Required: Instance size (CPU and memory) instanceSize: cpuCores: 1 # Must be between 0.1 and 15 cores memoryGi: 1 # Must be between 0.1 and 10 Gi # Required: Storage configuration storage: databaseStorage: sizeGi: 1 storageClass: standard-csi walStorage: # Optional but recommended for high-write workloads sizeGi: 1 storageClass: standard-csi # Optional: Transparent data encryption # transparentDataEncryption: # passphrase: mypassphrase # Required for HA clusters: number of standby replicas standbyReplicas: 2
restore-analytics.yaml
clusterType: analytics # checks that cluster type is a pgd cluster, cannot change this field tags: # Optional tags for the cluster with name and color(valid name or hex color code). Remove 'tags' to use source cluster tags. 'tags' values will use exactly these tags only. set 'tags: []' to use no tags. - color: blue tagName: tag-1 clusterName: restore-analytics-name deploymentLocation: managed-devspatcher password: password@1234 #Password must be 12 characters or more restoreRequest: # only one of the fields 'full' or 'pointInTime' can be set full: postgresBackupId: 20241112T211900 sourceClusterId: p-12345abcde # pointInTime: # pointInTime: '2025-01-01T13:40:04.000Z' # sourceClusterId: p-12345abcde networking: public # Network access type for the cluster. Valid values: private, public #allowedIpRanges: # Must contain at least one IP range with subnet mask when specified # - cidrBlock: 127.0.0.1/24 # description: test backupRetentionPeriod: 30d # Retention period must be between 1-180 days, 1-25 weeks, or 1-6 months. Valid units: days(d),weeks(w),months(m) backupSchedule: 39 13 23 * * * # Scheduled Backup Cron image: # user can fetch list of supported images with command `edbctl image list-image-tags` digest: sha256:c37c5d0ff1a9318919b9581c61286fcfce87f0c5b13000ff036da8bcf253173c url: upmdev.azurecr.io/enterprisedb/starlight:15.8-3-debian postgresqlConfiguration: # Optional max_connections: 100 instanceSize: cpuCores: 1 # CPU must be between 0.1 and 15 Cores memoryGi: 1 # Memory must be between 0.1 and 10 Gi
restore-pgd.yaml
# PGD restore configuration clusterType: pgd # Must remain 'pgd' for PGD clusters # ID of the source cluster to restore from sourceClusterId: p-12345abcde # Optional: Tags for the restored cluster tags: - color: blue tagName: tag-1 # Name of the restored PGD cluster name: restore-pgd-name # Password for the restored cluster (min 12 characters) password: Password@1234 # Only one data group can be restored at a time dataGroups: - groupName: Data Group A deploymentLocation: managed-devspatcher networking: public # Valid values: private, public backupRetentionPeriod: 31d # Valid units: d (days), w (weeks), m (months) nodes: 2 # Must be either 2 or 3 nodes image: url: upmdev.azurecr.io/enterprisedb/starlight:16.6.0-5.6.1-11-debian-bdr-epas-full digest: sha256:3db7c449c69f04753a3fb791623b0d6add58c0254e09b7bfe743d24f78f4ca57 # Optional PostgreSQL configuration overrides postgresqlConfiguration: max_connections: 100 max_locks_per_transaction: 64 # Optional backup schedule in cron format backupSchedule: 0 4 8 * * * # Specify one restore method only: 'full' or 'pointInTime' restorePgdGroupRequest: full: postgresBackupId: 20241228T055553 sourceGroupId: p-12345abcde-b # pointInTime: # pointInTime: '2025-01-01T13:40:04.000Z' # sourceGroupId: p-12345abcde-b # Instance size settings instanceSize: cpuCores: 1 # Between 0.1 and 15 cores memoryGi: 2 # Minimum recommended: 2 Gi # Storage settings storage: databaseStorage: sizeGi: 10 # Minimum recommended: 10 Gi storageClass: standard-csi walStorage: # Optional: separate WAL storage sizeGi: 1 storageClass: ssd-csi # Optional: Transparent data encryption # transparentDataEncryption: # passphrase: yourpassphrase
restore-aha.yaml
# Restore configuration for an AHA (Active-Active HA) cluster clusterType: aha # Must remain 'aha' for AHA clusters sourceClusterId: p-12345abcde # Required # Optional tags tags: - color: blue tagName: tag-1 # Name of the restored AHA cluster name: restore-aha-name # Admin password (minimum 12 characters) password: Password@1234 dataGroup: groupName: Data Group A deploymentLocation: managed-devspatcher networking: public # Valid values: private, public # Allow list for IP ranges allowedIpRanges: - cidrBlock: 9.9.9.9/28 description: Allow traffic from App A - cidrBlock: 10.10.10.10/27 description: Allow traffic from App B backupRetentionPeriod: 31d # Valid: 1-180d, 1-25w, 1-6m nodes: 2 # Must be 2 or 3 # Image to use for the restore image: url: 339713079902.dkr.ecr.us-east-1.amazonaws.com/uat-hcp/postgresql-testing:17.5-2505151734-pgds-full digest: sha256:b1464368351b16f2f2b990c296dad695d06f948580138512e6da3dbf5c5f475b # Optional PostgreSQL settings postgresqlConfiguration: max_connections: 100 max_locks_per_transaction: 64 # Scheduled backup in cron format backupSchedule: 0 4 8 * * * # Restore mode: choose either full or pointInTime restoreAhaGroupRequest: # full: # postgresBackupId: 20241228T055553 pointInTime: pointInTime: '2025-01-01T13:40:04.000Z' # Compute resources instanceSize: cpuCores: 2 # Between 0.1 and 47.51 cores memoryGi: 2 # Recommended: 2 Gi or more # Storage settings storage: databaseStorage: sizeGi: 20 # Recommended: 10 Gi or more storageClass: ssd-csi walStorage: sizeGi: 20 storageClass: standard-csi
Note
The following fields are mandatory while restoring a PGD cluster:
sourceClusterIDclusterTypepassworddataGroupsrestorePgdGroupRequest
All the other fields are optional. If omitted, the values from the source cluster are used.
The following fields are mandatory while restoring an AHA cluster:
sourceClusterIDclusterTypepassworddataGrouprestoreAhaGroupRequest
All the other fields are optional. If omitted, the values from the source cluster are used.