How can I create a PubSub subscription for a topic in a different Google Cloud Platform project using the Python API?
问题 The API seems to allow me to create a subscription for a topic in a different project, but when I inspect the newly created subscription, the it is associated with the project where the topic is located. from google.cloud import pubsub pubsub_client_publisher = pubsub.Client("publisher-project") topic = pubsub_client_publisher.topic("topic1") pubsub_client_receiver = pubsub.Client("receiver-project") subscription = pubsub.subscription.Subscription("subscription1", topic) subscription.create