aws-controllers-k8s / community

AWS Controllers for Kubernetes (ACK) is a project enabling you to manage AWS services from Kubernetes
https://aws-controllers-k8s.github.io/community/
Apache License 2.0
2.42k stars 255 forks source link

[apigatewayv2] Missing trigger when creating integration targeting lambda function #1703

Open mbolek opened 1 year ago

mbolek commented 1 year ago

Describe the bug When creating a route and an integration with apigatewayv2 controller everything is set up properly on the Gateway side but the lambda function doesn't have any triggers that would allow it to be called by the API Gateway.

Steps to reproduce

apiVersion: apigatewayv2.services.k8s.aws/v1alpha1
kind: API
metadata:
  name: "ack-api"
spec:
  name: "ack-api"
  protocolType: HTTP
---
apiVersion: apigatewayv2.services.k8s.aws/v1alpha1
kind: Integration
metadata:
  name: "ack-integration"
spec:
  apiRef:
    from:
      name: "ack-api"
  integrationType: AWS_PROXY
  integrationURI: "arn:aws:lambda:${AWS_REGION}:${ACCOUNT_ID}:function:bla"
  integrationMethod: GET
  connectionType: INTERNET
  timeoutInMillis: 30000
  payloadFormatVersion: "2.0"
---
apiVersion: apigatewayv2.services.k8s.aws/v1alpha1
kind: Route
metadata:
  name: "ack-route"
spec:
  apiRef:
    from:
      name: "ack-api"
  routeKey: "GET /ack-route-key"
  targetRef:
    from:
      name: "ack-integration"
---
apiVersion: apigatewayv2.services.k8s.aws/v1alpha1
kind: Stage
metadata:
  name: "ack-stage"
spec:
  apiRef:
    from:
      name: "ack-api"
  stageName: "ack-stage"
  autoDeploy: true
  description: "auto deployed stage for ack-api"

Applying the above properly creates the ack-api API in the API GW service, route and integration are also in place: image The integration looks ok: image but the lambda itself gets no triggers: image

Expected outcome The lambda function can be called by the lambda

Environment

ack-bot commented 1 year ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close. Provide feedback via https://github.com/aws-controllers-k8s/community. /lifecycle stale

jljaco commented 1 year ago

/lifecycle frozen