Managing PostgreSQL cluster aliases
An alias is a custom network name you can assign to each PostgreSQL cluster. An alias is mapped to a dedicated DNS record which always points to the cluster’s master host. This allows you to access the cluster using a human-readable name without the internal master host FQDN. An alias must be unique within a folder. You can assign only one alias to each cluster.
To connect your applications to a different cluster within the same folder, simply update the cluster-alias association.
Alias format:
c-<alias_name>-pg-<folder_ID>.rw.mdb.yandexcloud.net
Note
When creating an alias, you only need to specify its name.
Getting the cluster alias
To view the alias, you need the managed-postgresql.viewer role or higher for the folder.
-
Navigate
to Managed Service for PostgreSQL. -
Click the cluster name.
The cluster alias is displayed in the CNAME alias field.
Creating a cluster alias
To create an alias, you need the managed-postgresql.editor role or higher for the folder.
Warning
Due to DNS propagation, it may take some time for the alias to become available after the operation completes.
- Navigate
to Managed Service for PostgreSQL. - Click the cluster name, then click
in the CNAME alias section. - In the window that opens, specify a name for the cluster alias. Use only lowercase Latin letters, numbers, and hyphens. The alias may be up to 63 characters long.
- Click Create alias.
Reassigning an alias between clusters
You can only reassign an alias between clusters within the same folder. To reassign an alias, you need the managed-postgresql.editor role or higher for the folder.
Warning
Due to DNS propagation, it may take some time for the alias to become available after the operation completes.
-
Navigate
to Managed Service for PostgreSQL. -
You can reassign an alias using one of the two methods:
-
From the settings of the cluster the alias is assigned to.
- Click the name of the cluster whose alias you want to assign to another cluster within your folder, and click
in the CNAME alias section. - In the window that opens, select the new cluster for the alias.
- Click the name of the cluster whose alias you want to assign to another cluster within your folder, and click
-
From the target cluster settings.
- Click the name of the target cluster within your folder, and click
in the CNAME alias section. - In the window that opens, select the cluster the alias is currently assigned to.
- Click the name of the target cluster within your folder, and click
-
-
Confirm reassigning the alias and click Move alias.
Deleting an alias
To delete an alias, you need the managed-postgresql.editor role or higher for the folder.
- Navigate
to Managed Service for PostgreSQL. - Click the cluster name, then click
in the CNAME alias section. - In the window that opens, confirm the alias deletion.