With the SNS connector AWS SNS subscriptions can be used to trigger OpenFaaS functions from many different kinds of AWS services such as S3, DynamoDB, Redshift and so on.
Set up AWS
Create the credentials in the AWS Dashboard. You can configure permissions using a dedicated IAM user, or if your cluster is configured for AWS IAM, ambient credentials mapped into the Pod at runtime.
Deploy the connector with Helm
The SNS connector can be installed using its helm chart
Configure the connector for you needs by defining a values.yaml file
# Public callback URL for subscriptionscallbackURL:"http://sns.example.com/callback"# SNS topic ARNtopicARN:"arn:aws:sns:us-east-1:123456789012:of-event"# AWS shared credentials file:awsCredentialsSecret:aws-sns-credentialsawsRegion:us-east-1
Note that the callback URL has to be publicly accessible to receive SNS messages. An ingress configuration example is available in the chart README
Once you configured the connector to receive callbacks for an SNS topic you can annotate you functions so they get triggered by any incoming message on that topic.