From 38ff3a7007f8103d17d35e4d3ba48a9c6d91840d Mon Sep 17 00:00:00 2001 From: Stacey Salamon Date: Thu, 10 Sep 2026 18:31:41 +0200 Subject: [PATCH 1/4] update: CLI and API instructions for deploying apps --- docs/products/runtime/deploy-apps.md | 132 +++++++++++++++++++++++++++ external/terraform-provider | 2 +- 2 files changed, 133 insertions(+), 1 deletion(-) diff --git a/docs/products/runtime/deploy-apps.md b/docs/products/runtime/deploy-apps.md index 3dd900760..e43c538a1 100644 --- a/docs/products/runtime/deploy-apps.md +++ b/docs/products/runtime/deploy-apps.md @@ -6,6 +6,8 @@ import {ConsoleIcon} from "@site/src/components/ConsoleIcons"; import ConsoleLabel from "@site/src/components/ConsoleIcons"; import RequirementsPanel from "@site/src/components/RequirementsPanel"; import GitHubAccountVisibilityNote from "@site/static/includes/runtime-github-account-visibility-note.md"; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; Build and deploy applications using Aiven Runtime from source code in a GitHub repository. @@ -32,8 +34,16 @@ Build and deploy applications using Aiven Runtime from source code in a GitHub r +## ## Prerequisites + +- ... + + ## Deploy an application + + + 1. In your project, click . 1. Click **Deploy application**. 1. Select or connect your **GitHub account**. @@ -46,6 +56,102 @@ Build and deploy applications using Aiven Runtime from source code in a GitHub r . 1. To deploy the application and create the services, click **Deploy**. + + + + +1. Authenticate and pick a project +avn user login + +1. avn project switch YOUR_PROJECT + +1. Choose GitHub account, repository, and branch. On the CLI you pass them as configuration, not as picker clicks. + +You need: + +VCS_INTEGRATION_ID — for example vcs51174433e50 +REMOTE_REPOSITORY_ID — GitHub numeric repo ID +REPOSITORY_URL — for example https://github.com/org/repo.git +BRANCH — for example main +CONTAINERFILE_PATH — for example Dockerfile or docker-compose.yml +BUILD_PATH — usually . +Console’s Scan step discovers these from the repo. The CLI does not scan; you set the paths yourself (from the repo, or from a scan you already ran in Console). + + +1. Optional: create any data services the app should use (PostgreSQL, Kafka, Valkey, OpenSearch). Create these before the application, same as Console deploy. + + +avn service create my-postgres \ + --project PROJECT_NAME \ + -t pg \ + --cloud aws-eu-west-1 \ + --plan startup-4 + + +1. Create the application + + ```bash + ``` + avn service create my-app \ + --project PROJECT_NAME \ + -t application \ + --cloud aws-eu-west-1 \ + --plan startup-50-1024 \ + -c application.source.vcs_integration_id=VCS_INTEGRATION_ID \ + -c application.source.remote_repository_id=REMOTE_REPOSITORY_ID \ + -c application.source.repository_url=https://github.com/org/repo.git \ + -c application.source.branch=main \ + -c application.source.build_path=. \ + -c application.source.containerfile_path=Dockerfile \ + -c 'application.ports=[{"name":"http","port":8080,"protocol":"HTTP"}]' \ + -c 'application.environment_variables=[{"key":"LOG_LEVEL","value":"INFO","kind":"variable"}]' + ``` + + Add --project-vpc-id VPC_ID if the project requires a VPC. + + For CLI you have to read VCS_INTEGRATION_ID and REMOTE_REPOSITORY_ID from the API. + + VCS_INTEGRATION_ID is Aiven’s ID for the GitHub App installation linked to your organization (vcs…). It is created when an org admin finishes Connect GitHub in Console. + + curl -sS \ + "https://api.aiven.io/v1/organization/ORGANIZATION_ID/application/vcs-integrations" \ + -H "Authorization: Bearer $AIVEN_TOKEN" + Use vcs_integrations[].vcs_integration_id. vcs_account_name is the GitHub org or user you connected (for example my-github-org). + + REMOTE_REPOSITORY_ID is GitHub’s numeric repository ID, as a string (for example "1234567890"). It is not the repo name. + + curl -sS \ + "https://api.aiven.io/v1/organization/ORGANIZATION_ID/application/vcs-integrations/VCS_INTEGRATION_ID/repositories" \ + -H "Authorization: Bearer $AIVEN_TOKEN" + Use repositories[].remote_repository_id for the row whose full_name is org/repo. You also get source_url (the clone URL to pass as repository_url). + + Same ID on GitHub: repo Settings (the numeric ID) or GET https://api.github.com/repos/ORG/REPO → id. + +1. Optional: attach service credentials (CLI equivalent of edit app integration config). + + +avn service integration-create \ + --project PROJECT_NAME \ + -t application_service_credential \ + -s my-postgres \ + -d my-app \ + -c service_type=pg \ + -c exposed_values.connection_string.environment_variable_key=DATABASE_URL + +3. Wait until it is running +avn service wait my-app --project YOUR_PROJECT +avn service get my-app --project YOUR_PROJECT + +Watch state (REBUILDING / RUNNING / error states). Connection info and published HTTP ports + come from the service. + + + + + + + + ## Redeploy an application When you redeploy an application, Aiven deploys the latest commit from @@ -54,3 +160,29 @@ the selected branch. 1. In your project, click . 1. Open your application. 1. On the **Overview** page, click > . + + + + +There is no dedicated avn subcommand for this; call the same endpoint the Console uses: + +avn rest POST /project/YOUR_PROJECT/service/my-app/application/redeploy + + + diff --git a/external/terraform-provider b/external/terraform-provider index 6031bbfca..c8d7f0f7f 160000 --- a/external/terraform-provider +++ b/external/terraform-provider @@ -1 +1 @@ -Subproject commit 6031bbfcafd3fb866a6772458c793dba302af29d +Subproject commit c8d7f0f7f1e63eec772ecef9057481f6f324ba6e From 12ecb6193a454f3757d97833c5ae26876726e23c Mon Sep 17 00:00:00 2001 From: Stacey Salamon Date: Wed, 16 Sep 2026 13:00:10 +0200 Subject: [PATCH 2/4] update: CLI and API instructions for deploying and connecting apps --- .../runtime/connect-services-to-apps.md | 328 ++++++++++++++++++ docs/products/runtime/deploy-apps.md | 279 +++++++++------ 2 files changed, 507 insertions(+), 100 deletions(-) diff --git a/docs/products/runtime/connect-services-to-apps.md b/docs/products/runtime/connect-services-to-apps.md index dcfa15234..37f456cdc 100644 --- a/docs/products/runtime/connect-services-to-apps.md +++ b/docs/products/runtime/connect-services-to-apps.md @@ -5,6 +5,8 @@ sidebar_label: Connect services import ConsoleLabel from "@site/src/components/ConsoleIcons"; import AppIntegrationLimitation from "@site/static/includes/runtime-app-integration-limitation.md"; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; Connect your deployed application to [Aiven services](/docs/products/services). You can connect an existing Aiven for Apache Kafka®, Aiven for PostgreSQL®, @@ -17,12 +19,80 @@ by using [Compose files](/docs/products/runtime/manifest-files/compose-files). ## Connect an Aiven service + + + 1. In your project, click . 1. Open your application. 1. In the **Connected services** section, click **Connect service**. 1. Select the service to connect. 1. Click **Connect**. + + + +Use the `avn service integration-create` command. For example, to integrate +a PostgreSQL service with your application, run: + +```bash +avn service integration-create \ + --project PROJECT_NAME \ + --integration-type application_service_credential \ + --source-service SERVICE_NAME \ + --dest-service APPLICATION_NAME \ + --user-config-json '{ + "service_type": "pg", + "exposed_values": { + "connection_string": { + "environment_variable_key": "DATABASE_URL" + } + } + }' +``` +Where: +- `PROJECT_NAME` is the name of your Aiven project. +- `source-service` is the name of the data service to connect. +- `dest-service` is the name of your application. +- `service_type` is the type of data service. For example, `pg` for PostgreSQL. +- `environment_variable_key` is the environment variable your application reads for the connection URI. Do not also set this variable in the application user config; Aiven injects it. + + + + + +Use the +`POST /v1/project/{project}/integration` endpoint. For example, to integrate +an existing PostgreSQL service with an application: + +```bash +curl -sS -X POST "https://api.aiven.io/v1/project/PROJECT_NAME/integration" \ + -H "Authorization: Bearer $AIVEN_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "integration_type": "application_service_credential", + "source_service": "prod-pg", + "dest_service": "web-app", + "user_config": { + "service_type": "pg", + "exposed_values": { + "connection_string": { + "environment_variable_key": "DATABASE_URL" + } + } + } + }' +``` + +Where: +- `PROJECT_NAME` is the name of your Aiven project. +- `AIVEN_TOKEN` is your Aiven token. +- `source_service` is the name of the data service to integrate with your application. +- `dest_service` is the name of your application. +- `service_type` is the type of data service, for example `pg` for PostgreSQL. + + + + ## Connect a Karapace schema registry To connect services that are integrated with your application @@ -40,6 +110,9 @@ to a Karapace schema registry: ### Connect a schema registry during application creation + + + 1. In your project, click . 1. Click **Deploy application**. 1. Select or connect your **GitHub account**. @@ -55,22 +128,277 @@ to a Karapace schema registry: and add the connection details as environment variables. 1. To deploy the application, click **Deploy**. + + + +When you create the application, [connect the Kafka service](#connect-an-aiven-service) +and include the schema registry details in `application.environment_variables`. + +For example: + +```bash +avn service create example-application \ + --project example-project \ + --service-type application \ + --plan startup-50-1024 \ + --cloud aws-eu-west-1 \ + --user-config-json '{ + "application": { + "source": { + "repository_url": "REPOSITORY_URL", + "branch": "main", + "build_path": "./", + "containerfile_path": "Dockerfile" + }, + "environment_variables": [ + { + "key": "SCHEMA_REGISTRY_URL", + "value": "SCHEMA_REGISTRY_URI", + "kind": "variable" + }, + { + "key": "SCHEMA_REGISTRY_USER", + "value": "SCHEMA_REGISTRY_USER", + "kind": "variable" + }, + { + "key": "SCHEMA_REGISTRY_PASSWORD", + "value": "SCHEMA_REGISTRY_PASSWORD", + "kind": "secret" + } + ] + } + }' +``` + +Where: `SCHEMA_REGISTRY_URI`, `SCHEMA_REGISTRY_USER`, and `SCHEMA_REGISTRY_PASSWORD` +are the service URI, user, and password from the Kafka service Schema Registry +connection information. + + + + +When you create the application, [connect the Kafka service](#connect-an-aiven-service) +and include the schema registry details in `user_config.application.environment_variables`. + +For example: + +```bash +curl -sS -X POST "https://api.aiven.io/v1/project/example-project/service" \ + -H "Authorization: Bearer $AIVEN_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "service_name": "web-app", + "service_type": "application", + "plan": "startup-50-1024", + "cloud": "aws-eu-west-1", + "user_config": { + "application": { + "source": { + "repository_url": "REPOSITORY_URL", + "branch": "main", + "build_path": "./", + "containerfile_path": "Dockerfile" + }, + "environment_variables": [ + { + "key": "SCHEMA_REGISTRY_URL", + "value": "SCHEMA_REGISTRY_URI", + "kind": "variable" + }, + { + "key": "SCHEMA_REGISTRY_USER", + "value": "SCHEMA_REGISTRY_USER", + "kind": "variable" + }, + { + "key": "SCHEMA_REGISTRY_PASSWORD", + "value": "SCHEMA_REGISTRY_PASSWORD", + "kind": "secret" + } + ] + } + }, + "service_integrations": [ + { + "integration_type": "application_service_credential", + "source_service": "KAFKA_SERVICE_NAME", + "user_config": { + "service_type": "kafka", + "exposed_values": { + "bootstrap_servers": { "environment_variable_key": "KAFKA_BOOTSTRAP_SERVER" }, + "security_protocol": { "environment_variable_key": "KAFKA_SECURITY_PROTOCOL" }, + "access_key": { "environment_variable_key": "KAFKA_ACCESS_KEY" }, + "access_cert": { "environment_variable_key": "KAFKA_ACCESS_CERT" }, + "ca_cert": { "environment_variable_key": "KAFKA_CA_CERT" } + } + } + } + ] + }' +``` + +Where: + +- `KAFKA_SERVICE_NAME` is the connected Kafka service with Karapace enabled. +- `SCHEMA_REGISTRY_URI`, `SCHEMA_REGISTRY_USER`, and `SCHEMA_REGISTRY_PASSWORD` + are the service URI, user, and password from the Kafka service + Schema Registry connection information. + + + + ### Connect a schema registry to an existing application + + + 1. In your project, click . 1. Open your application. 1. In the **Environment variables** section, click **Edit**. 1. On the **Variables** tab, add the connection details as environment variables. 1. Click **Save**. + + + +Use the `avn service update` command. + +:::warning +This replaces the application's environment variables. +To keep the existing variables, include them in the `environment_variables` list. +To view a list of the existing environment variables, run +`avn service get APPLICATION_NAME`. +::: + +For example: + +```bash +avn service update example-application \ + --project example-project \ + -c 'application.environment_variables=[ + { + "key": "SCHEMA_REGISTRY_URL", + "value": "SCHEMA_REGISTRY_URI", + "kind": "variable" + }, + { + "key": "SCHEMA_REGISTRY_USER", + "value": "SCHEMA_REGISTRY_USER", + "kind": "variable" + }, + { + "key": "SCHEMA_REGISTRY_PASSWORD", + "value": "SCHEMA_REGISTRY_PASSWORD", + "kind": "secret" + } + ]' +``` + +Where: `SCHEMA_REGISTRY_URI`, `SCHEMA_REGISTRY_USER`, and `SCHEMA_REGISTRY_PASSWORD` +are the service URI, user, and password from the Kafka service Schema Registry +connection information. + + + + +Use the `PUT /v1/project/{project}/service/{service}` endpoint. + +:::warning +This replaces the application's environment variables. +To keep the existing variables, include them in the `environment_variables` list. +To view a list of the existing environment variables, call +`GET /v1/project/{project}/service/{service}`. +::: + +For example: + +```bash +curl -sS -X PUT "https://api.aiven.io/v1/project/PROJECT_NAME/service/example-application" \ + -H "Authorization: Bearer $AIVEN_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "user_config": { + "application": { + "environment_variables": [ + { + "key": "SCHEMA_REGISTRY_URL", + "value": "SCHEMA_REGISTRY_URI", + "kind": "variable" + }, + { + "key": "SCHEMA_REGISTRY_USER", + "value": "SCHEMA_REGISTRY_USER", + "kind": "variable" + }, + { + "key": "SCHEMA_REGISTRY_PASSWORD", + "value": "SCHEMA_REGISTRY_PASSWORD", + "kind": "secret" + } + ] + } + } + }' +``` + +Where: `SCHEMA_REGISTRY_URI`, `SCHEMA_REGISTRY_USER`, and `SCHEMA_REGISTRY_PASSWORD` +are the service URI, user, and password from the Kafka service Schema Registry +connection information. + + + + ## Disconnect an Aiven service + + + 1. In your project, click . 1. Open your application. 1. In the **Connected services** section, find the service to disconnect. 1. Click > **Disconnect service**. 1. Click **Disconnect** to confirm. + + + +1. Get the integration ID for the connected service using + the `service integration-list` command: + + ```bash + avn service integration-list APPLICATION_NAME --project PROJECT_NAME + ``` + +1. To remove the integration, run: + + ```bash + avn service integration-remove APPLICATION_NAME SERVICE_INTEGRATION_ID --project PROJECT_NAME + ``` + + + + +1. List integrations for the application and copy the `service_integration_id` + for the `application_service_credential` integration to remove: + + ```bash + curl -sS -X GET \ + "https://api.aiven.io/v1/project/PROJECT_NAME/service/APPLICATION_NAME/integration" \ + -H "Authorization: Bearer $AIVEN_TOKEN" + ``` + +1. Delete the integration: + + ```bash + curl -sS -X DELETE \ + "https://api.aiven.io/v1/project/PROJECT_NAME/integration/SERVICE_INTEGRATION_ID" \ + -H "Authorization: Bearer $AIVEN_TOKEN" + ``` + + + + ## Apply database schema changes Aiven Runtime does not automatically support pre-deploy commands or one-off task execution. diff --git a/docs/products/runtime/deploy-apps.md b/docs/products/runtime/deploy-apps.md index e43c538a1..ab40ed8c8 100644 --- a/docs/products/runtime/deploy-apps.md +++ b/docs/products/runtime/deploy-apps.md @@ -34,16 +34,43 @@ Build and deploy applications using Aiven Runtime from source code in a GitHub r -## ## Prerequisites +You cannot use Compose files to deploy applications through the Aiven API or Aiven MCP. +Use +[Containerfiles or Dockerfiles](/docs/products/runtime/manifest-files/containerfiles) instead. -- ... +## Prerequisites + + + +- A GitHub account + + + + +- The [Aiven CLI installed](/docs/tools/cli) +- [An Aiven token](/docs/platform/concepts/authentication-tokens) +- A [connected GitHub account](/docs/products/runtime/connect-github-account) + + + + +- [An Aiven token](/docs/platform/concepts/authentication-tokens) +- A [connected GitHub account](/docs/products/runtime/connect-github-account) + + + ## Deploy an application +:::note +When you connect a GitHub account to your Aiven organization, all users in that +organization can select that account in Aiven Runtime. +::: + 1. In your project, click . 1. Click **Deploy application**. 1. Select or connect your **GitHub account**. @@ -57,96 +84,174 @@ Build and deploy applications using Aiven Runtime from source code in a GitHub r 1. To deploy the application and create the services, click **Deploy**. - - - -1. Authenticate and pick a project -avn user login - -1. avn project switch YOUR_PROJECT + -1. Choose GitHub account, repository, and branch. On the CLI you pass them as configuration, not as picker clicks. +1. To choose a project, run: -You need: + ```bash + avn project switch PROJECT_NAME + ``` -VCS_INTEGRATION_ID — for example vcs51174433e50 -REMOTE_REPOSITORY_ID — GitHub numeric repo ID -REPOSITORY_URL — for example https://github.com/org/repo.git -BRANCH — for example main -CONTAINERFILE_PATH — for example Dockerfile or docker-compose.yml -BUILD_PATH — usually . -Console’s Scan step discovers these from the repo. The CLI does not scan; you set the paths yourself (from the repo, or from a scan you already ran in Console). + Where `PROJECT_NAME` is the name of your Aiven project. +1. Optional: Create data services for the app to use with the `avn service create` command. + The following example creates a PostgreSQL service: -1. Optional: create any data services the app should use (PostgreSQL, Kafka, Valkey, OpenSearch). Create these before the application, same as Console deploy. + ```bash + avn service create example-postgres \ + --project PROJECT_NAME \ + -t pg \ + --cloud aws-eu-west-1 \ + --plan startup-4 + ``` +1. Get your `VCS_INTEGRATION_ID` from the Aiven API. This is Aiven's ID + for the GitHub Aiven App installation linked to your organization when + you [connected your GitHub account](/docs/products/runtime/connect-github-account). + To get your ID, run: -avn service create my-postgres \ - --project PROJECT_NAME \ - -t pg \ - --cloud aws-eu-west-1 \ - --plan startup-4 - - -1. Create the application - - ```bash - ``` - avn service create my-app \ - --project PROJECT_NAME \ - -t application \ - --cloud aws-eu-west-1 \ - --plan startup-50-1024 \ - -c application.source.vcs_integration_id=VCS_INTEGRATION_ID \ - -c application.source.remote_repository_id=REMOTE_REPOSITORY_ID \ - -c application.source.repository_url=https://github.com/org/repo.git \ - -c application.source.branch=main \ - -c application.source.build_path=. \ - -c application.source.containerfile_path=Dockerfile \ - -c 'application.ports=[{"name":"http","port":8080,"protocol":"HTTP"}]' \ - -c 'application.environment_variables=[{"key":"LOG_LEVEL","value":"INFO","kind":"variable"}]' - ``` - - Add --project-vpc-id VPC_ID if the project requires a VPC. - - For CLI you have to read VCS_INTEGRATION_ID and REMOTE_REPOSITORY_ID from the API. - - VCS_INTEGRATION_ID is Aiven’s ID for the GitHub App installation linked to your organization (vcs…). It is created when an org admin finishes Connect GitHub in Console. - + ```bash curl -sS \ "https://api.aiven.io/v1/organization/ORGANIZATION_ID/application/vcs-integrations" \ -H "Authorization: Bearer $AIVEN_TOKEN" - Use vcs_integrations[].vcs_integration_id. vcs_account_name is the GitHub org or user you connected (for example my-github-org). + ``` - REMOTE_REPOSITORY_ID is GitHub’s numeric repository ID, as a string (for example "1234567890"). It is not the repo name. + Where `ORGANIZATION_ID` is the + [Aiven organization ID](/docs/platform/reference/get-resource-IDs) the GitHub account + is connected to. +1. Get the ID of the connected repository from the Aiven API. + To get the `REMOTE_REPOSITORY_ID`, run the following command using the + `VCS_INTEGRATION_ID`: + + ```bash curl -sS \ "https://api.aiven.io/v1/organization/ORGANIZATION_ID/application/vcs-integrations/VCS_INTEGRATION_ID/repositories" \ -H "Authorization: Bearer $AIVEN_TOKEN" - Use repositories[].remote_repository_id for the row whose full_name is org/repo. You also get source_url (the clone URL to pass as repository_url). - - Same ID on GitHub: repo Settings (the numeric ID) or GET https://api.github.com/repos/ORG/REPO → id. - -1. Optional: attach service credentials (CLI equivalent of edit app integration config). - - -avn service integration-create \ - --project PROJECT_NAME \ - -t application_service_credential \ - -s my-postgres \ - -d my-app \ - -c service_type=pg \ - -c exposed_values.connection_string.environment_variable_key=DATABASE_URL - -3. Wait until it is running -avn service wait my-app --project YOUR_PROJECT -avn service get my-app --project YOUR_PROJECT - -Watch state (REBUILDING / RUNNING / error states). Connection info and published HTTP ports - come from the service. + ``` + +1. To create the application, run the following: + + ```bash + avn service create example-app \ + --project PROJECT_NAME \ + -t application \ + --cloud aws-eu-west-1 \ + --plan startup-50-1024 \ + -c application.source.vcs_integration_id=VCS_INTEGRATION_ID \ + -c application.source.remote_repository_id=REMOTE_REPOSITORY_ID \ + -c application.source.repository_url=REPOSITORY_URL \ + -c application.source.branch=BRANCH_NAME \ + -c application.source.build_path=. \ + -c application.source.containerfile_path=Dockerfile \ + -c 'application.ports=[{"name":"http","port":8080,"protocol":"HTTP"}]' \ + ``` + + Where: + - `VCS_INTEGRATION_ID` is the GitHub Aiven app ID. + - `REMOTE_REPOSITORY_ID` is the ID of the connected repository. + - `REPOSITORY_URL` is the URL of the connected repository. + - `BRANCH_NAME` is the branch to deploy. + + + To use a project VPC, add `--project-vpc-id VPC_ID`. + +1. Optional: Integrate your data services with the app. + For example, to integrate the PostgreSQL service with the app, run: + + ```bash + avn service integration-create \ + --project PROJECT_NAME \ + -t application_service_credential \ + -s example-postgres \ + -d example-app \ + --user-config-json '{"service_type":"pg","exposed_values":{"connection_string":{"environment_variable_key":"DATABASE_URL"}}}' + ``` + +:::tip +To check the status of your services or applications, run +`avn service wait SERVICE_NAME --project PROJECT_NAME`. +::: + + +1. Optional: Create data services to integrate with your application using the + `POST /v1/project/{project}/service` endpoint. For example, the following + creates Aiven for PostgreSQL® service: + ```bash + curl -sS -X POST "https://api.aiven.io/v1/project/example-project/service" \ + -H "Authorization: Bearer $AIVEN_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "service_name": "example-postgres-service", + "service_type": "pg", + "plan": "startup-4", + "cloud": "aws-eu-west-1" + }' + ``` + +1. To create the application, use the `POST/v1/project/{project}/service` endpoint. The + following example deploys an application, sets environment variables, and integrates + the app with an existing PostgreSQL service: + + ```bash + curl -sS -X POST \ + "https://api.aiven.io/v1/project/PROJECT_NAME/service" \ + -H "Authorization: Bearer $AIVEN_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "service_name": "example-app", + "service_type": "application", + "cloud": "aws-eu-west-1", + "plan": "startup-50-1024", + "user_config": { + "application": { + "source": { + "repository_url": "REPOSITORY_URL", + "branch": "BRANCH_NAME", + "build_path": "./", + "containerfile_path": "Dockerfile" + }, + "ports": [ + { "name": "http", "port": 8080, "protocol": "HTTP" } + ], + "environment_variables": [ + { "key": "LOG_LEVEL", "value": "INFO", "kind": "variable" }, + { "key": "API_KEY", "value": "secret", "kind": "secret" } + ] + } + }, + "service_integrations": [ + { + "integration_type": "application_service_credential", + "source_service": "example-postgres-service", + "user_config": { + "service_type": "pg", + "exposed_values": { + "connection_string": { + "environment_variable_key": "DATABASE_URL" + } + } + } + } + ] + }' + ``` + + Where: + - `PROJECT_NAME` is the name of your Aiven project. + - `REPOSITORY_URL` is the URL of the connected repository. + - `BRANCH_NAME` is the branch to deploy. + - `containerfile_path`: Use the repository-relative path for your + Dockerfile or Containerfile. For example, `./Dockerfile` or `./api/Dockerfile.prod`. + - `build_path` is the build context and defaults to `./.`. + If you set `build_path` and omit `containerfile_path`, Aiven searches that directory + for a Dockerfile/Containerfile. + - `source_service` is the name of the service to integrate with the application. + + To use a project VPC, add `"project_vpc_id": "VPC_ID"`. @@ -160,29 +265,3 @@ the selected branch. 1. In your project, click . 1. Open your application. 1. On the **Overview** page, click > . - - - - -There is no dedicated avn subcommand for this; call the same endpoint the Console uses: - -avn rest POST /project/YOUR_PROJECT/service/my-app/application/redeploy - - - From bf3615e36d51d6e4a413bcfc64e24bacdb1b5768 Mon Sep 17 00:00:00 2001 From: Stacey Salamon Date: Thu, 17 Sep 2026 12:34:41 +0200 Subject: [PATCH 3/4] formatting --- docs/products/runtime/deploy-apps.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/products/runtime/deploy-apps.md b/docs/products/runtime/deploy-apps.md index ab40ed8c8..55b389e18 100644 --- a/docs/products/runtime/deploy-apps.md +++ b/docs/products/runtime/deploy-apps.md @@ -66,7 +66,7 @@ Use -:::note +:::important When you connect a GitHub account to your Aiven organization, all users in that organization can select that account in Aiven Runtime. ::: @@ -256,7 +256,6 @@ To check the status of your services or applications, run - ## Redeploy an application When you redeploy an application, Aiven deploys the latest commit from From 2705165a95a4deefce57da61ae4bfbbdc0b7cce7 Mon Sep 17 00:00:00 2001 From: Stacey Salamon Date: Fri, 18 Sep 2026 12:37:01 +0200 Subject: [PATCH 4/4] link to variables table --- docs/products/runtime/connect-services-to-apps.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/products/runtime/connect-services-to-apps.md b/docs/products/runtime/connect-services-to-apps.md index 37f456cdc..08a935648 100644 --- a/docs/products/runtime/connect-services-to-apps.md +++ b/docs/products/runtime/connect-services-to-apps.md @@ -54,7 +54,9 @@ Where: - `source-service` is the name of the data service to connect. - `dest-service` is the name of your application. - `service_type` is the type of data service. For example, `pg` for PostgreSQL. -- `environment_variable_key` is the environment variable your application reads for the connection URI. Do not also set this variable in the application user config; Aiven injects it. +- `environment_variable_key` is the environment variable your application reads for the + connection URI. For other services, view the list of + [default variables](/docs/products/runtime/secrets-and-variables#default-environment-variables). @@ -85,10 +87,12 @@ curl -sS -X POST "https://api.aiven.io/v1/project/PROJECT_NAME/integration" \ Where: - `PROJECT_NAME` is the name of your Aiven project. -- `AIVEN_TOKEN` is your Aiven token. - `source_service` is the name of the data service to integrate with your application. - `dest_service` is the name of your application. - `service_type` is the type of data service, for example `pg` for PostgreSQL. +- `environment_variable_key` is the environment variable your application reads for the + connection URI. For other services, view the list of + [default variables](/docs/products/runtime/secrets-and-variables#default-environment-variables).