如何配置 Google Cloud Pub/Sub 以进行测试、暂存和生产?

How to configure Google Cloud Pub/Sub for test, staging, and production?

我看到了这份文件。 (https://cloud.google.com/pubsub/architecture#environments)

The first part of maintaining a system like Cloud Pub/Sub is to have the ability to test the software before it is used by customers. In order to make that possible, there are three Cloud Pub/Sub environments: test, staging, and production.

但是我找不到在哪里配置它。

我的目的是开发者不能从生产主题中pub/sub。

我尝试创建两个服务帐户,一个用于开发人员,一个用于生产。但是如果我给开发者roles/pubsub.editor,开发者也可以pub/sub at production.

或者有没有办法让发布者可以订阅。

注意:我正在使用来自 nuget 的 Google.Cloud.PubSub.V1。

文档的该部分指的是云 Pub/Sub 服务本身的测试和推出过程;这些不是专为客户用来测试他们自己的软件而设计的单独环境。

如果您想设置自己的测试、暂存和生产环境,您至少需要单独的主题和订阅。如果你想实现完全隔离,你可以考虑为你的不同环境完全分开项目。这是将测试和开发与生产分开的非常典型的方法。