我正在运行此命令:
gcloud beta functions deploy myfunc \
--entry-point handler \
--project my-project \
--runtime python37 \
--trigger-resource 'gs://my-bucket' \
--trigger-event google.storage.object.finalize
如何在Jinja模板中指定xxx和xxx?看起来我必须在模板中使用EventTrigger,但不确定如何设置格式?
resources:
- name: resource-name
type: 'gcp-types/cloudfunctions-v1:projects.locations.functions'
properties:
function: test
parent: projects/my-project/locations/us-central1
location: us-central1
sourceArchiveUrl: 'gs://my-project-bucket/sdfsd.zip'
runtime: python37
entryPoint: handler
maxInstances: 10
timeout: 30s
availableMemoryMb: 64
eventTrigger: ????
是否在YAML中指定了包含FailurePolicy的EventTrigger的完整示例?
文档中的内容不清楚:https : //cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions#FailurePolicy不确定yaml模板中的外观如下:
这适用于在Jinja中设置failurePolicy
...
eventTrigger:
...
failurePolicy:
retry: {}
相当古怪,但是要禁用它,只需不指定它:
{% if properties['failurePolicy'] %}
failurePolicy:
retry: {}
{% endif %}
Deployment Manager在Github上有一些特定的示例。这是eventTrigger
使用Cloud Pub / Sub的示例:
eventTrigger:
resource: $(ref.my-topic.name)
eventType: providers/cloud.pubsub/eventTypes/topic.publish
对于FailurePolicy,我将尝试添加以下内容:
eventTrigger:
...
failurePolicy:
retry: true
参考:
Este artículo se recopila de Internet, indique la fuente cuando se vuelva a imprimir.
En caso de infracción, por favor [email protected] Eliminar
Déjame decir algunas palabras