Support to reference DynamoDB table latest stream ARN in Lambda EventSourceMapping #1938
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
service/lambda
Indicates issues or PRs that are related to lambda-controller.
triage/duplicate
Indicates an issue is a duplicate of other open issue.
Problem
DynamoDB Latest Stream ARN is autogenerated by AWS and cannot be constructed upfront. That makes it very difficult to create AWS Lambda EventSourceMapping with DynamoDB Stream as a source.
The
EventSourceARN
supports several AWS resources, as per documentation (https://github.com/aws-controllers-k8s/lambda-controller/blob/6a1f71e1b68480530e9a9ac1389b8a0f7bc30499/apis/v1alpha1/event_source_mapping.go#L69):Unfortunately, the
EventSourceRef
is implemented to support only managed kafka cluster ARNs:https://github.com/aws-controllers-k8s/lambda-controller/blob/6a1f71e1b68480530e9a9ac1389b8a0f7bc30499/apis/v1alpha1/generator.yaml#L137
I'm happy to contribute this feature, but would need direction towards best solution.
Possible solutions
Re-use existing
EventSourceRef
field.To ignore defined field reference kind in the
generator.yaml
and implement custom logic to resolve proper ARN.This would need to be done as custom code and would clash with code generators. Not sure if this is even possible,
Create
xxxEventSourceRef
fields for each reference kind.ARN resolving would need to be done with hooks in this case.
Extend the core
code-generator
to support multiple resource kinds as field referencesSomething like this:
ACK Custom resource names are unique within namespace, regardless of the resource kind, so the implementation should be straightforward.
The text was updated successfully, but these errors were encountered: