我的应用程序需要确保通过Pub / Sub发送的消息中包含的数据不会离开欧盟的边界。这与所谓的“数据驻留”要求有关。
Pub / Sub被描述为全局服务[1],其中服务的客户端可以在不知道存储和处理消息的特定位置的情况下发布/订阅消息。
我可以将Pub / Sub用于我的应用程序吗?
今天提供的Google Cloud Pub / Sub服务版本不提供任何“数据驻留”保证。然而,可以设计具有Pub / Sub的解决方案,其最小化违反“数据驻留”目标的风险,使得Pub / Sub消息数据存储在EU多区域之外的可能性变得极不可能。特别:
Google Cloud Pub / Sub不支持数据驻留。建议的解决方案是确保您不使用Pub / Sub发送任何客户数据。相反,您可以发送指向存储在数据存储区,GCS等中的实际数据的指针。这些服务确实尊重数据驻留,并且可以配置为确保数据不会离开EU。
更正:事实证明,我们无法在任何地方实际设置数据驻留。 MessageStoragePolicy类型仅用于读取
2019年后期的答案:现在可以使用UI,CLI和API
从2019年初开始回答:Golang API有一个MessageStoragePolicy类型https://godoc.org/cloud.google.com/go/pubsub#MessageStoragePolicy
type MessageStoragePolicy struct {
// The list of GCP regions where messages that are published to the topic may
// be persisted in storage. Messages published by publishers running in
// non-allowed GCP regions (or running outside of GCP altogether) will be
// routed for storage in one of the allowed regions. An empty list indicates a
// misconfiguration at the project or organization level, which will result in
// all Publish operations failing.
AllowedPersistenceRegions []string }