Skip to content

Customer-Owned Google Cloud Resources

The Modigie Integration for Cloud Pub/Sub API supports Bring-Your-Own-GCP Resources, allowing enterprise customers to seamlessly integrate customer-owned Google Cloud Platform (GCP) assets directly into their Modigie integration.

Configured on a granular, per-job-type basis through repository ownerConfig, this capability addresses two common enterprise security and infrastructure requirements:

  1. Customer-Owned Job Response Topics (responseTopic): Route job responses directly into a Google Cloud Pub/Sub topic hosted in your own GCP project, rather than consuming from Modigie-managed subscriptions.
  2. Keyless Job Request Publishing (requestPublishers): Authorize your own Google Cloud service accounts to publish job requests directly to Modigie request topics using native Application Default Credentials (ADC), completely eliminating the need to generate, distribute, and rotate private service account keys.

Architecture Overview

The diagrams below contrast the asynchronous job flow when using customer-owned GCP resources versus the default Modigie-managed resources:

Architecture diagram showing asynchronous job flow with customer-owned Cloud Pub/Sub response topics and service accounts

Asynchronous job flow with customer-owned Pub/Sub response topics and customer service accounts

Architecture diagram showing asynchronous job flow with Modigie-managed Cloud Pub/Sub topics and subscriptions

Default asynchronous job flow with Modigie-provisioned topics and subscriptions

Customer-Owned Response Topics

For any supported job type, you can designate an existing Cloud Pub/Sub topic in your own Google Cloud project to receive completed job responses, discard notifications, and lifecycle event messages.

Configuration

To configure a customer-owned response topic, supply the following parameters for each desired job type in ownerConfig:

  • projectId: The Google Cloud project ID hosting your Pub/Sub topic.
  • topicId: The ID of your existing Pub/Sub topic.

When a customer response topic is configured, the delivery mode for that job type automatically resolves to topic.

IAM Permissions Setup

Before activating the repository or submitting jobs, you must grant Modigie's repository service account permission to publish to your topic.

Modigie provisions a dedicated, tenant-specific Application Account for your repository:

inpubsub-app-{REPO_SHORT_HASH}@{TENANT_PROJECT_ID}.iam.gserviceaccount.com

You must grant the Pub/Sub Publisher role (roles/pubsub.publisher) on your topic to this Application Account.

You can grant this role using the Google Cloud CLI:

gcloud pubsub topics add-iam-policy-binding <TOPIC_ID> \
  --project=<CUSTOMER_PROJECT_ID> \
  --role="roles/pubsub.publisher" \
  --member="serviceAccount:inpubsub-app-{REPO_SHORT_HASH}@{TENANT_PROJECT_ID}.iam.gserviceaccount.com"

Or using Terraform:

resource "google_pubsub_topic_iam_member" "modigie_publisher" {
  project = var.customer_project_id
  topic   = var.customer_topic_id
  role    = "roles/pubsub.publisher"
  member  = "serviceAccount:inpubsub-app-${var.repo_short_hash}@${var.tenant_project_id}.iam.gserviceaccount.com"
}

Response Message Delivery & Consumption

Once configured, Modigie's engine publishes all response messages for that job type directly to your topic across GCP projects. Your application consumes messages from subscriptions that you create and manage in your own project:

Architecture diagram showing application pulling job responses from a subscription created on a customer-owned Cloud Pub/Sub topic

Your application authenticates with its own service account to pull messages from a subscription on your customer-owned topic

Architecture diagram showing Cloud Pub/Sub delivering push responses to a webhook endpoint from a customer-owned topic

Cloud Pub/Sub delivers push messages to your webhook endpoint authorized by your own service account

Tenant Infrastructure Lifecycle & Reversibility

  • Zero Tenant Response Footprint: For job types configured with a customer-owned response topic, Modigie tenant-infra will not provision a Modigie response topic, nor will it create pull or push subscriptions.
  • Destruction of Modigie Resources: If you transition an existing job type from Modigie-managed subscriptions to a customer-owned response topic, existing Modigie-provisioned response topics and subscriptions for that job type will be destroyed.
  • Full Reversibility: If you later choose to revert to Modigie-managed subscriptions, update your repository's ownerConfig (e.g. enabling pullConfig or pushConfig and setting responseTopic to null). Modigie tenant-infra will automatically re-provision the Modigie-managed response topic and subscriptions.

Keyless Request Publishing

For client applications hosted on Google Cloud (e.g., Google Kubernetes Engine with Workload Identity, Cloud Run, Google Compute Engine) or federated with GCP Workload Identity, you can publish job requests directly using your own service accounts without managing service account keys.

Configuration

To enable keyless publishing, provide one or more service account email addresses in requestPublishers for each job type in ownerConfig:

{
  "requestPublishers": [
    "ingestion-worker@customer-prod-project.iam.gserviceaccount.com",
    "batch-pipeline@customer-prod-project.iam.gserviceaccount.com"
  ]
}

Automatic IAM Provisioning

Modigie tenant-infra automatically provisions a Pub/Sub Publisher IAM binding (roles/pubsub.publisher) on the Modigie-provided job request topic (inpubsub-job-request-{jobType}-{REPO_SHORT_HASH}) for every service account email specified in requestPublishers.

Sequence diagram showing keyless job request publishing using customer service account and Application Default Credentials

Customer application uses its own service account and native Application Default Credentials (ADC)

Sequence diagram showing job request publishing authenticating via downloaded keys of the Modigie Application Account

Default workflow authenticating via downloaded private keys of the Modigie Application Account

Keyless Publishing with Application Default Credentials (ADC)

Your application code does not need to load downloaded JSON key files. The official Google Cloud Pub/Sub client libraries automatically locate credentials in the execution environment:

from google.cloud import pubsub_v1

# Uses Google Application Default Credentials (ADC) automatically:
publisher = pubsub_v1.PublisherClient()
topic_path = publisher.topic_path(TENANT_PROJECT_ID, f"inpubsub-job-request-verifymobile-{REPO_SHORT_HASH}")

future = publisher.publish(
    topic_path,
    data=payload_bytes,
    modigieJobRequestId="req-12345",
)
message_id = future.result()
const { PubSub } = require('@google-cloud/pubsub');

// Automatically picks up ADC from Google Cloud environment:
const pubsub = new PubSub({ projectId: TENANT_PROJECT_ID });
const topic = pubsub.topic(`inpubsub-job-request-verifymobile-${REPO_SHORT_HASH}`);

await topic.publishMessage({
  data: Buffer.from(JSON.stringify(payload)),
  attributes: { modigieJobRequestId: 'req-12345' },
});

The Exclusivity Boundary

Important Exclusivity Rule

When you configure requestPublishers for a job type, publishing job requests becomes the exclusive responsibility of your designated customer service account(s).

Modigie still provisions the repository's Application Account to deliver job responses to your response topic. However, the Application Account's publisher permissions on that job type's request topic are revoked, and it cannot be used to publish job requests.

Per-Job-Type Configuration Example

Customer-owned GCP resources can be configured independently for each job type. For instance, you can use customer-owned topics for high-volume jobs while relying on Modigie-managed pull subscriptions for other jobs:

{
  "ownerConfig": {
    "enrichMobile": {
      "pullConfig": {
        "enable": true
      },
      "pushConfig": null,
      "responseTopic": null,
      "requestPublishers": [
        "enrichment-worker@customer-prod-project.iam.gserviceaccount.com"
      ]
    },
    "verifyMobile": {
      "pullConfig": null,
      "pushConfig": null,
      "responseTopic": {
        "projectId": "customer-prod-project",
        "topicId": "modigie-verify-mobile-responses"
      },
      "requestPublishers": [
        "crm-sync@customer-prod-project.iam.gserviceaccount.com"
      ]
    },
    "verifyEmployment": {
      "pullConfig": {
        "enable": true
      },
      "pushConfig": null,
      "responseTopic": null,
      "requestPublishers": []
    }
  }
}

In the example above:

  • enrichMobile: Responses are delivered to a Modigie-managed pull subscription. Requests are published keylessly by enrichment-worker@customer-prod-project.iam.gserviceaccount.com.
  • verifyMobile: Responses are published directly to the customer topic projects/customer-prod-project/topics/modigie-verify-mobile-responses (Modigie response topic and subscriptions are destroyed). Requests are published keylessly by crm-sync@customer-prod-project.iam.gserviceaccount.com.
  • verifyEmployment: Fully default Modigie-managed infrastructure. Requests and response pulling both use the Modigie-provisioned Application Account.

Comparison Summary

Capability Modigie-Managed Resources Customer-Owned Resources
Response Destination Modigie tenant project pull/push subscriptions Customer project Cloud Pub/Sub topic (mode: topic)
Modigie Tenant Subs Created automatically per job type Destroyed / Not created
Response Publisher Identity Modigie Application Account (inpubsub-app-...) Modigie Application Account (inpubsub-app-...)
Required Customer IAM None (Modigie provisions all permissions) Grant roles/pubsub.publisher on customer topic to Modigie Application Account
Request Publisher Identity Modigie Application Account (via private key JSON) Customer Google Cloud service account(s) via ADC
Request Key Management Download, distribute, and rotate private keys Zero keys (Keyless Application Default Credentials)
Exclusivity Boundary Application Account handles requests and responses Customer SA publishes requests; Application Account publishes responses
Reversibility Default setup Revertible at any time via repository configuration