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
Apono token
Account-specific Apono authentication value
Follow these steps to obtain your token:
On the Connectors page, click Install Connector. The Install Connector page appears.
Click GCP > Install and Connect GCP Project > CLI (Cloud Run).
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 organizationProject ID (
GCP_PROJECT_ID
): (For Organization and Project connectors) Unique identifier of your GCP project where the Cloud Run service is runningLocation (
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 connectorArtifact repository name (
GCP_ARTIFACT_REPOSITORY_NAME
): Name of your Docker-format GCP Artifact RegistryCloud 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:
Log in to Google Cloud.
gcloud auth login
Set the environment variables.
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>
Authenticate with the Apono Docker registry.
docker login registry.apono.io -u apono --password $APONO_TOKEN
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
Configure Docker for your GCP region.
gcloud auth configure-docker $GCP_LOCATION-docker.pkg.dev
Push the image to GCP Artifact Registry.
docker push $IMAGE_PATH
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
On the Connectors page in the Apono UI, verify that the connector is updated.
Last updated
Was this helpful?