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 three common enterprise security and infrastructure requirements:
- 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. - 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. - Keyless Job Response Subscribing (
responseSubscribers): Authorize your own Google Cloud service accounts to pull job responses directly from Modigie-managed pull subscriptions using native Application Default Credentials (ADC), allowing complete keyless integration without bringing your own response topics.
Architecture Overview¶
The diagrams below contrast the asynchronous job flow when using customer-owned GCP resources versus the default Modigie-managed resources:
Asynchronous job flow with customer-owned Pub/Sub response topics and customer service accounts
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 to Modigie:
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:
Your application authenticates with its own service account to pull messages from a subscription on your 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. enablingpullConfigorpushConfigand settingresponseTopictonull). 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.
Customer application uses its own service account and native Application Default Credentials (ADC)
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.
Keyless Response Subscribing¶
If you choose not to bring your own response topic and instead use Modigie-managed pull subscriptions, you can still operate keylessly by authorizing your own customer service account(s) to pull directly from Modigie's pull subscription.
Configuration¶
Provide one or more service account email addresses in responseSubscribers for each desired job type in ownerConfig:
Automatic IAM Provisioning¶
When pullConfig or both is enabled, Modigie tenant-infra automatically provisions a Pub/Sub Subscriber IAM binding (roles/pubsub.subscriber) on the tenant pull subscription (inpubsub-job-response-{jobType}-pull-all-externalendpoint-{REPO_SHORT_HASH}) for every service account email specified in responseSubscribers.
Unified Identity vs. Least Privilege (Separation of Duties)¶
- Unified Service Identity: If your application uses the same service account to both publish requests and pull responses, specify that same email in both
requestPublishersandresponseSubscribers. Your application runs completely under your own service identity using native ADC, eliminating the need to download or handle Modigie Application Account keys. - Least Privilege (Separation of Duties): If your security policy requires distinct identities for producers and consumers, configure different service accounts in
requestPublishersandresponseSubscribers. Modigie tenant-infra grants publisher permissions exclusively to the publishing account and subscriber permissions exclusively to the consuming account.
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"
],
"responseSubscribers": [
"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"
],
"responseSubscribers": []
},
"verifyEmployment": {
"pullConfig": {
"enable": true
},
"pushConfig": null,
"responseTopic": null,
"requestPublishers": [],
"responseSubscribers": []
}
}
}
In the example above:
enrichMobile: Responses are delivered to a Modigie-managed pull subscription. Requests are published keylessly byenrichment-worker@customer-prod-project.iam.gserviceaccount.com, and responses are pulled keylessly by the same service account usingresponseSubscribersand ADC—requiring zero private keys.verifyMobile: Responses are published directly to the customer topicprojects/customer-prod-project/topics/modigie-verify-mobile-responses(Modigie response topic and subscriptions are destroyed). Requests are published keylessly bycrm-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 |
| Response Subscriber Identity (Pull) | Modigie Application Account (via private key JSON) | Customer service account(s) via ADC (responseSubscribers or customer subscription) |
| 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 |
Related Documentation¶
- Architecture Overview: Understand the broader infrastructure and repository model.
- Push vs Pull Subscriptions: Compare subscription delivery mechanisms.
- Authentication & Security: Service account management and Workload Identity.
- Onboarding Process: Step-by-step repository provisioning and requirements.
- Publish Job Requests: Request message publishing and attribute schemas.
- Receive Job Responses: Response processing, discards, and event handling.