Editing a connection
To change connection settings:
- In the management console
, select a folder. - Select Yandex MetaData Hub.
- In the left-hand panel, select
Connection manager. - In the list of connections, click
to the right of the connection you want to edit. - Select Edit.
- Change the required connection parameters, such as description, labels, database server settings, or user authentication information.
- Click Apply to save the changes.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
You can update settings of a connection to a cluster with a managed database or to a custom database installation.
-
To update settings of a connection to a cluster with a managed database:
-
View the description of the CLI command for updating a connection:
yc metadata-hub connection-manager connection update <database_type> --helpThe supported database types are
postgresql,mysql,clickhouse,mongodb,opensearch,valkey,greenplum, andkafka. -
Update your connection by running this command:
yc metadata-hub connection-manager connection update <database_type> <connection_ID> \ --name <connection_name> \ --user <username> \ --password <password> \ --managed-cluster-id <cluster_ID>Where:
-
--name: Connection name. -
--user: Username to connect to the cluster. -
--password: Password. -
--managed-cluster-id: Cluster ID. You can get the cluster ID with the list of clusters in the folder.
You can get the connection ID with the list of connections in the folder.
-
-
You can update the list of databases for all connections, except Managed Service for OpenSearch and Managed Service for Apache Kafka® connections, by running this command:
yc metadata-hub connection-manager connection update <database_type> <connection_ID> \ --databases <database_list>Where
--databasesis a comma-separated list of databases.Make sure the user has the required access permissions.
-
-
To update settings of a connection to a custom database installation:
-
View the description of the CLI command for updating a connection:
yc metadata-hub connection-manager connection update <database_type> --helpThe supported database types are
postgresql,mysql,clickhouse,mongodb,redis,opensearch,trino,valkey,greenplum, andkafka. -
Update your connection by running this command:
yc metadata-hub connection-manager connection update <database_type> <connection_ID> \ --name <connection_name> \ --user <username> \ --password <password> \ --ca-certificate <path_to_certificate>Where:
-
--name: Connection name. -
--description: Connection description. -
--labels: Comma-separated list of labels in"<key>":"<value>"format. -
--user: Username to connect to the cluster. -
--password: Password. -
--ca-certificate: Path to your TLS CA certificate file.TLS is enabled by default; to disable it, use the
--tls-disabledflag.
-
-
You can also update the following:
-
List of hosts for all connections, except Trino connections, by running this command:
yc metadata-hub connection-manager connection update <database_type> <connection_ID> \ --hosts <list_of_hosts>Where
--hostsis a comma-separated list of hosts.Warning
Host notation format depends on the database type. For more information, see the CLI reference.
-
Coordinator parameters for connecting to Trino, by running this command:
yc metadata-hub connection-manager connection update trino <connection_ID> \ --coordinator <coordinator_parameters>Where
--coordinatorstands for coordinator parameters in<host>:<port>format. -
List of databases for all connections, except Trino, OpenSearch, and Apache Kafka® connections, by running this command:
yc metadata-hub connection-manager connection update <database_type> <connection_ID> \ --databases <database_list>Where
--databasesis a comma-separated list of databases.Make sure the user has the required access permissions.
-
-
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the relevant documentation on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
Alert
Do not change the connection name using Terraform. This will delete the existing connection and create a new one.
You can update settings of a connection to a cluster with a managed database or to a custom database installation.
-
To update settings of a connection to a cluster with a managed database:
-
Open the current Terraform configuration file describing your infrastructure.
-
To update the description and labels for a connection, update the values of the relevant fields in the resource description:
resource "yandex_connectionmanager_connection" "<local_connection_name>" { ... description = "<connection_description>" labels = { "<key_1>" = "<value_1>" "<key_2>" = "<value_2>" ... "<key_N>" = "<value_N>" } ... }Where:
-
description: Connection description. -
--labels: Labels in"<key>" = "<value>"format.
-
-
To update the cluster ID, update the
managed_cluster_idfield value underparams.<database_type>:resource "yandex_connectionmanager_connection" "<local_connection_name>" { ... params = { <database_type> = { managed_cluster_id = "<cluster_ID>" ... } } } -
To update the list of databases for all connections, except Managed Service for OpenSearch and Managed Service for Apache Kafka® connections, update the
databasesfield value underparams.<database_type>:resource "yandex_connectionmanager_connection" "<local_connection_name>" { ... params = { <database_type> = { ... databases = [ "<database_1>", "<database_2>", ... "<database_N>" ] ... } } }Where
databasesis the list of databases. Make sure the user has the required access permissions. -
To update authentication parameters for all connections, except Managed Service for Apache Kafka® connections, update the values in the
userandpassword.rawfields underparams.<database_type>.auth.user_password:resource "yandex_connectionmanager_connection" "<local_connection_name>" { ... params = { <database_type> = { ... auth = { user_password = { user = "<username>" password = { raw = "<password>" } } } } } } -
To update authentication parameters for Managed Service for Apache Kafka® connections, update the values of the fields under
params.kafka.auth.sasl:resource "yandex_connectionmanager_connection" "<local_connection_name>" { ... params = { kafka = { ... auth = { sasl = { user = "<username>" password = { raw = "<password>" } supported_mechanisms = [ <list_of_authentication_mechanisms> ] } } } } }Where
params.kafka.authstands for authentication parameters. Select one of the sections:-
sasl: SASL authentication parameters.-
user: Username to connect to the cluster. -
password.raw: Password. -
supported_mechanisms: List of authentication mechanisms. The possible values are:PLAIN: Authentication with login and password provided as plain unencrypted text.SCRAM_SHA256: Authentication with SHA-256 hashing.SCRAM_SHA512: Authentication with SHA-512 hashing.
-
-
disabled: Disables authentication.
-
-
Make sure the settings are correct.
-
In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
-
Run this command:
terraform validateTerraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform planIf you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply -
Confirm updating the resources.
-
Wait for the operation to complete.
-
-
-
-
To update settings of a connection to a custom database installation:
-
Open the current Terraform configuration file describing your infrastructure.
-
To update the description and labels for a connection, update the values of the relevant fields in the resource description:
resource "yandex_connectionmanager_connection" "<local_connection_name>" { ... description = "<connection_description>" labels = { "<key_1>" = "<value_1>" "<key_2>" = "<value_2>" ... "<key_N>" = "<value_N>" } ... }Where:
-
description: Connection description. -
--labels: Labels in"<key>" = "<value>"format.
-
-
To update the list of hosts for all connections, except Trino connections, update the
hostsfield value underparams.<database_type>.cluster:resource "yandex_connectionmanager_connection" "<local_connection_name>" { ... params = { <database_type> = { cluster = { hosts = [ { <host_1_parameters> }, { <host_2_parameters> }, ... { <host_N_parameters> } ] ... } ... } } }Warning
Host parameters depend on the database type. For more information, see this Terraform provider guide
. -
To update coordinator parameters for Trino connections, update the values of the
hostandportfields underparams.trino.cluster.coordinator:resource "yandex_connectionmanager_connection" "<local_connection_name>" { ... params = { <database_type> = { cluster = { coordinator = { host = "<host>" port = <port> } ... } ... } } } -
To update TLS parameters, update the values of the fields under
params.<database_type>.cluster.tls_params:resource "yandex_connectionmanager_connection" "<local_connection_name>" { ... params = { <database_type> = { cluster = { ... tls_params = { tls { ca_certificate = "<path_to_certificate>" } } } ... } } }Where
params.<database_type>.cluster.tls_paramsrepresents TLS parameters. Select one of the sections:tls.ca_certificate: Path to your TLS CA certificate file.disabled: Disables TLS. TLS is enabled by default.
-
To update the list of databases for all connections, except Trino, OpenSearch, and Apache Kafka® connections, update the
databasesfield value underparams.<database_type>:resource "yandex_connectionmanager_connection" "<local_connection_name>" { ... params = { <database_type> = { ... databases = [ "<database_1>", "<database_2>", ... "<database_N>" ] ... } } }Where
databasesis the list of databases. Make sure the user has the required access permissions. -
To update authentication parameters for all connections, except Apache Kafka® connections, update the values in the
userandpassword.rawfields underparams.<database_type>.auth.user_password:resource "yandex_connectionmanager_connection" "<local_connection_name>" { ... params = { <database_type> = { ... auth = { user_password = { user = "<username>" password = { raw = "<password>" } } } } } } -
To update authentication parameters for Apache Kafka® connections, update the values of the fields under
params.kafka.auth.sasl:resource "yandex_connectionmanager_connection" "<local_connection_name>" { ... params = { kafka = { ... auth = { sasl = { user = "<username>" password = { raw = "<password>" } supported_mechanisms = [ <list_of_authentication_mechanisms> ] } } } } }Where
params.kafka.authstands for authentication parameters. Select one of the sections:-
sasl: SASL authentication parameters.-
user: Username to connect to the cluster. -
password.raw: Password. -
supported_mechanisms: List of authentication mechanisms. The possible values are:PLAIN: Authentication with login and password provided as plain unencrypted text.SCRAM_SHA256: Authentication with SHA-256 hashing.SCRAM_SHA512: Authentication with SHA-512 hashing.
-
-
disabled: Disables authentication.
-
-
Make sure the settings are correct.
-
In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
-
Run this command:
terraform validateTerraform will show any errors found in your configuration files.
-
-
Confirm updating the resources.
-
Run this command to view the planned changes:
terraform planIf you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
-
If everything looks correct, apply the changes:
-
Run this command:
terraform apply -
Confirm updating the resources.
-
Wait for the operation to complete.
-
-
-
Use the Connection.Update REST API method or the ConnectionService.Update gRPC API call and provide the connection ID in the request.
You can get the connection ID with the list of connections in the folder.