resources:
- name: svc-{{ properties["name"] }}
  type: cloudfunctions.v1beta2.function
  properties:
    availableMemoryMb: {{ properties["availableMemoryMb"] }}
    entryPoint: process
    function: {{ properties["name"] }}
    location: us-central1
    sourceRepositoryUrl: https://source.developers.google.com/projects/chatbot-architecture-example/repos/default/moveable-aliases/master/paths/services/{{ properties["name"] }}
    {% if properties["trigger"] == "http" %}
    httpsTrigger: {}
    {% elif properties["trigger"] == "pubsub" %}
    eventTrigger:
      eventType: providers/cloud.pubsub/eventTypes/topic.publish
      resource: projects/chatbot-architecture-example/topics/{{ properties["topic"] }}
    {% endif %}