Update a GCP connector in Cloud Run with CLI

Deploy the latest Docker image of the Apono connector to your Cloud Run service

Periodically, you may need to update your Google Cloud connector to help maintain functionality, performance, and security.

This article explains how to update an existing connector deployed on Google Cloud Run using the CLI.


Prerequisites

Item
Description

Apono token

Account-specific Apono authentication value

Follow these steps to obtain your token:

  1. On the Connectors page, click Install Connector. The Install Connector page appears.

  2. Click GCP > Install and Connect GCP Project > CLI (Cloud Run).

  3. Copy the token in step listed on the page in step 1.

NOTE: This value must be the same token that was used in the existing connector. You can also find the APONO_TOKEN on the YAML tab of your Cloud Run service in the GCP console.

Google Cloud CLI

Command-line interface used to manage Google Cloud resources

Google Cloud roles

Google Cloud role that provides Owner permissions for the project or organization

Project implementation role:

  • Owner

Organization implementation roles:

  • Owner

  • Organization Administrator

Google Cloud information

Information for your Google Cloud instance

Google-defined values:

  • Organization ID (GCP_ORGANIZATION_ID): (For Organization connectors only) Unique identifier of your GCP organization

  • Project ID (GCP_PROJECT_ID): (For Organization and Project connectors) Unique identifier of your GCP project where the Cloud Run service is running

  • Location (GCP_LOCATION): Region where your Cloud Run service and artifact repository are located

Customer-defined values:

  • Service account name (SERVICE_ACCOUNT_NAME): Name of the GCP service account used by the connector

  • Artifact repository name (GCP_ARTIFACT_REPOSITORY_NAME): Name of your Docker-format GCP Artifact Registry

  • Cloud Run service name (GCP_CLOUDRUN_SERVICE_NAME): Name of the Cloud Run service where the connector is deployed

Apono-defined values:

  • Apono connector ID (APONO_CONNECTOR_ID): Unique identifier used when the connector was originally installed

NOTE: You can find all parameters above on the YAML tab of your Cloud Run service in the GCP console.


Update a connector

To update an Apono connector on Google Cloud Run, follow these steps in your shell environment:

  1. Log in to Google Cloud.

gcloud auth login
  1. Set the environment variables.

The GCP_ORGANIZATION_ID is only required for Organization connectors.

export GCP_ORGANIZATION_ID=<GOOGLE_ORGANIZATION_ID>
export GCP_PROJECT_ID=<GOOGLE_PROJECT_ID>
export SERVICE_ACCOUNT_NAME=<SERVICE_ACCOUNT_NAME>
export GCP_ARTIFACT_REPOSITORY_NAME=<ARTIFACT_REPOSITORY_NAME>
export GCP_CLOUDRUN_SERVICE_NAME=<CLOUDRUN_SERVICE_NAME>
export GCP_LOCATION=<GCP_LOCATION>
export APONO_TOKEN=<APONO_TOKEN>
export APONO_CONNECTOR_ID=<APONO_CONNECTOR_ID>
  1. Authenticate with the Apono Docker registry.

docker login registry.apono.io -u apono --password $APONO_TOKEN
  1. Pull and tag the latest connector image.

docker pull --platform linux/amd64 registry.apono.io/apono-connector:v1.7.3

export IMAGE_PATH=$GCP_LOCATION-docker.pkg.dev/$GCP_PROJECT_ID/$GCP_ARTIFACT_REPOSITORY_NAME/registry.apono.io/apono-connector:v1.7.3

echo $IMAGE_PATH

docker image tag registry.apono.io/apono-connector:v1.7.3 $IMAGE_PATH
  1. Configure Docker for your GCP region.

gcloud auth configure-docker $GCP_LOCATION-docker.pkg.dev
  1. Push the image to GCP Artifact Registry.

docker push $IMAGE_PATH
  1. Deploy the updated image to Cloud Run.

gcloud run deploy "$GCP_CLOUDRUN_SERVICE_NAME" \
  --image "$IMAGE_PATH" \
  --region="$GCP_LOCATION" \
  --allow-unauthenticated \
  --max-instances=1 \
  --min-instances=1 \
  --cpu=1 \
  --memory=2Gi \
  --no-cpu-throttling \
  --service-account "$SERVICE_ACCOUNT_NAME" \
  --update-env-vars \
  APONO_CONNECTOR_ID="$APONO_CONNECTOR_ID",APONO_TOKEN="$APONO_TOKEN",APONO_URL=api.apono.io
  1. On the Connectors page in the Apono UI, verify that the connector is updated.

Last updated

Was this helpful?