使用FailureFolicy将`gcloud beta functions deploy`命令转换为Deployment Manager模板

红色888

我正在运行此命令:

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

Editado en
0

Déjame decir algunas palabras

0Comentarios
Iniciar sesiónRevisión de participación posterior

Artículos relacionados

错误:(gcloud.beta.functions.deploy)... message = [呼叫者没有权限]

在GCP Deployment Manager中使用GKE beta功能

Как подключиться к gcloud beta sql подключиться через ssl

Как я могу запустить бета-компонент gcloud, такой как «сканирование изображений докеров артефактов gcloud beta» в Cloud Build?

gcloud functions deploy always says: --region: NAME must be specified

Terraform vs gcloud deployment-manager

(gcloud.beta.compute.scp) Не удалось добавить SSH-ключ к разрешениям метаданных экземпляра

ERREUR: (gcloud.beta.app.deploy) Réponse d'erreur: [13] App Engine Flex n'a pas pu configurer les ressources

将模板文字转换为字符串

gcloud Deployment Manager 템플릿의 Python 모듈

Usar 'gcloud services vpc-peerings connect' en Deployment Manager

Erreur "gcloud beta builds triggers" avec l'indicateur "--name"

Problema con .bashrc al iniciar gcloud beta interactive

ERROR: (gcloud.functions.deploy) OperationError: código = 3, mensaje = Error de compilación

¿Cómo puedo ejecutar el componente beta de gcloud como "gcloud beta artifacts docker images scan" dentro de Cloud Build?

¿Deployment Manager tiene soporte para Cloud Functions (y soporte para tener múltiples funciones en la nube)?

iOS Fastlane deployment (TestFlight) - how to include BETA demo credentials?

如何将实体框架转换为SQL命令?

如何将 OpenXML 从模板创建的 Word 文档转换为 MemoryStream?

오류 : (gcloud.functions.deploy) OperationError : code = 3, message = Build failed 오류 ID : 6191efcd

Google cloud functions cannot deploy

在VBA中使用模板创建的Outlook电子邮件在保存时会转换为纯文本

使用OS登录,如何将gcloud ssh从一个GCE转换为另一个GCE?

El comando de funciones beta de gcloud dice "Funciones de elección no válidas"

Formato de extracción de suscripciones de pubsub beta de gcloud

Cómo conectarse a gcloud beta sql connect a través de ssl

Pourquoi ma commande "gcloud beta run services replace" échoue-t-elle?

Erreur avec la commande gcloud beta pour le streaming d'actifs vers bigquery

operador de flujo de aire para usar los comandos de gcloud beta dataproc