Skip to content

Connect with cloud database

This guide will help you establish a connection to your cloud database. By default, cloud databases are isolated within their own namespace, making them inaccessible from other namespaces or external sources. This isolation is a security measure designed to protect your data as much as possible.

Setup connection

To setup a database connection from your container you need the connection information of your database cluster.

  1. Choose your database
  2. Navigate to users
  3. Click on the eye icon of the desired user
  4. In the modal you will see all relevant information to createa connection to the database

Note

If you are new to our api we recommend reading the automation article about our api first.

You can use the query below to get the connection information for your database cluster.

query MyQuery {
    cloudDatabaseCluster(
        cloudDatabase: {name: "demo-cluster", namespace: "demo"}
    ) {
        hostname
        users {
        name
        dsn
        }
    }
    cloudDatabaseClusterUserCredentials(
        cloudDatabase: {name: "demo-cluster", namespace: "demo"}
        username: "demo_app_user"
    ) {
        password
    }
}

Once you have obtained the necessary information, you can configure your container or container job. We strongly recommend using environment variables and secrets to configure your container, as this ensures that your password is stored securely and decouples your container image from specific credentials.

External connections

Our portal allows you to modify this setting on a per-cloud-database-cluster basis. You can access this option from the Database Overview page.

Link to external connection

Info

For now this feature is only available via our portal.