Triggers
The most common use-case is HTTP which acts as a lingua franca between internet-connected systems.
Looking to trigger a function on a schedule? Have a look at the Cron page for more information on how to use Kubernetes and other options such as the cron-connector.
This is the default, and standard method for interacting with your Functions.
The function URL follows the pattern of:
Trigger a function using the faas-cli
by using the function name
- echo "triggered" | faas-cli invoke figlet
The OpenFaaS connector-pattern allows you to create a broker or separate microservice which maps functions to topics and invokes functions via the OpenFaaS Gateway meaning that the OpenFaaS code does not need to be modified per trigger/event-source.
Add your own event source
If you'd like to add an event source which is not listed below you can fork the OpenFaaS event connector SDK which is written in Go and use this to connect your pub/sub topics or message queues to functions in OpenFaaS.
Cron Connector
Apache Kafka
Connect your function(s) to topics.
More information in the Incubator repository: openfaas-incubator/kafka-connector
Support is available for OpenFaaS Gateways using Basic Authentication.
Connect your functions to queues using Form3's OpenFaaS AWS SQS connector: form3tech-oss/openfaas-sqs-connector
AWS SNS
You can use AWS SNS to trigger functions using AWS SNS Notifications and Subscriptions. This approach can be used to export almost any data-source or event from your Amazon Web Services (AWS) console such as S3 of DynamoDB to an OpenFaaS function.
Find more information in the following repository: affix/OpenFaaS-SNS
Minio / S3
You can trigger OpenFaaS functions using Minio's webhook or Kafka integration.
is a specification for describing event data in a common way.
Follow this example to learn how to trigger functions using the Azure EventGrid and CloudEvents.
More information in the repository: johnmccabe/cloudevents-slack-demo
IFTTT
An example may be triggering a function which forwards Tweets about your brand or project to a given Slack channel. For this combination use the "Twitter search" Applet and have it trigger the "Make a web request" Applet giving the public URL of your OpenFaaS gateway and the receiver function such as https://gw.my-company.com/function/slack-forwarder
See an example of a function built to forward Tweets from IFTTTT to Slack using Golang: .
Visit ifttt.com to learn more.
VMware vCenter
vcenter-connector is an OpenFaaS event connector built to consume events from vCenter from VMware
With this project your functions can subscribe to events generated by the changes in your vCenter installation - for instance a VM being created, turned on or deleted. This allows you to extend vCenter's functionality by writing functions to execute each time an event is fired. An example may be tagging a VM with the date it was last turned on or applying a tag showing which user made a change to an object.
Status: under active development, suitable for testing only
Link: vcenter-connector
Invoke functions using Redis pub/sub and the .
View the sidekiq-connector
RabbitMQ (third-party project)
More information in the repository: Templum/rabbitmq-connector