我尝试使用 gcloud cli 创建 eventarc 触发器,以便指定路径模式。遵循文档。 https://cloud.google.com/sdk/gcloud/reference/eventarc/triggers/create#--destination-run-service https://cloud.google.com/eventarc/docs/path-patterns#valid_patterns
以及一些在线步骤https://atamel.dev/posts/2022/03-02_path_patterns_eventarc/
但是我收到如下错误:
ERROR: (gcloud.eventarc.triggers.create) Error parsing [trigger].
The [trigger] resource is not properly specified.
Failed to find attribute [location]. The attribute can be set in the following ways:
- provide the argument `trigger` on the command line with a fully specified name
- provide the argument `--location` on the command line
- set the property `eventarc/location`
我的命令如下:
gcloud eventarc triggers create bq-trigger-test --destination-run-service=bigquery-upload \
--destination-run-region=asia-southeast1 --event-filters="type=google.cloud.storage.object.v1.finalized" \
--event-filters="bucket=tracking-service-bucket" \
--event-filters-path-pattern="bucket=/projects/_/buckets/bucket-name/objects/**/filename.json"
我看到了这个问题,但应该已经解决了: https://github.com/GoogleCloudPlatform/python-docs-samples/issues/5057 https://github.com/GoogleCloudPlatform/python-docs-samples/pull/5348
有人面临同样的情况吗?或者能够从我上面的命令中识别出任何问题?
谢谢
该错误很神秘但准确。
您正在向 gcloud eventarc triggers create
提供一个短名称(根据文档不是完全限定)
因此,命令需要知道项目和位置。该项目可能设置在
gcloud config get project
但位置不是,并且命令失败。
按照推荐,
name
或者:提供--location