Kong aws-lambda plugin applied to an Ingress

Hi,

I am exploring the use of aws-lambda plugin in Kong to call a few Lambda functions based on Kuberentes Ingress rules matching certain URL paths/formats.

Although most of the document was straightforward to understand, I could not understand why would one specify a service: in an Ingress, if the point was to call a Lambda function. Is this a dummy parameter in Kubernetes Ingress and should be left blank when using this plugin on an Ingress resource?

Thanks!

Bump? Maybe @hbagdi would know?

Effectively you need a Service because the Ingress spec says you do. Any route with the aws-lambda plugin won’t actually use its Service, but Service-less Ingresses weren’t really something the Ingress spec designed for.

I recommend creating a dummy ExternalName Service to use as a placeholder. It won’t actually ever receive traffic; it’s only there to satisfy configuration requirements.

Should this be documented in the plugin page?

Sure, I’ve added doc(kic) update aws-lambda service note by rainest · Pull Request #4730 · Kong/docs.konghq.com · GitHub

Hi there,

In my case, I would like to apply a different plugin configuration per rule on my ingress, so I can create just one plugin configuration but define what lambda function I would like to call on a rule-basis. Is this possible?

Something like this:

---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: aws-lambda-plugin
plugin: aws-lambda
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: lambda-plugin-ingress
  annotations:
    konghq.com/plugins: aws-lambda-plugin
    konghq.com/strip-path: "true"
spec:
  ingressClassName: kong
  rules:
  - host: my.host.dev
    http:
      paths:
      - path: /lambda1
        pathType: Prefix
        ## configure the aws-plugin at this level to call the aws lambda 1
        backend:
          service:
            name: kong-gateway-proxy
            port:
              number: 80
      - path: /lambda2
        pathType: Prefix
        ## configure the aws-plugin at this level to call the aws lambda 2
        backend:
          service:
            name: kong-gateway-proxy
            port:
              number: 80