Terraform - GCloud 容器注册表示例

Terraform - GCloud Container Registry Sample

我正在使用地形改造 gcloud 资源,需要创建 gcloud 容器注册表并尝试使用 terraform.io

中的以下示例
data "google_container_registry_repository" {}

output "gcr_location" {
    value = "${data.google_container_registry_repository.repository_url}"
}

当我 运行 terraform plan

时收到以下错误

'data' must be followed by exactly two strings: a type and a name

我可以参考任何工作示例吗?

terraform.io 语法:https://www.terraform.io/docs/providers/google/d/google_container_registry_repository.html

地形版本: Terraform v0.11.2

编辑:已更新至 Terraform v0.11.3,问题仍然存在。

试试这个:

data "google_container_registry_repository" "myregistry" {}

output "gcr_location" {
    value = "${data.google_container_registry_repository.myregistry.repository_url}"
}