Which arn would I need to configure for Kinesis in that event source mapping & how would I configure it to use localstack Kinesis?
According to this AWS doc an env var AWS_ENDPOINT_URL_KINESIS
can be used to configure a custom Kinesis endpoint which could be localstack’s & it will probably be used by boto3 we’re using in Lambdas (I haven’t tried it yet, just guessing here). But not sure if it helps the event source mapping.
Also I can pass AWS_ACCESS_KEY_ID=012345678912
along with
Do I understand you correctly that you wish to run a hybrid setup as follows:
Kinesis (LocalStack) => Lambda Event Source Mapping (LocalStack) => Lambda function (AWS)
You want to run Kinesis locally, let a local Lambda Event Source Mapping poll from the Kinesis stream, and finally invoke a Lambda function that lives in a remote AWS account, correct?
Could you share your use case to help us understand why you wish to use such a hybrid setup?
It helps to improve the developer experience of LocalStack
We currently don’t have a blueprint or tests for this exact scenario. However, it could work using our experimental AWS Replicator Extension . The replicator extension can be configured to forward the relevant Lambda lambda:InvokeFunction call using an ARN filter for your specific Lambda function. The “proxy” Lambda function in LocalStack needs to have the same ARN as the one in your target AWS account.
The reverse case (local Lambda & remote source) is discussed in Local Lambda against remote SQS? and @HarshCasper from our DevRel team has created resources related to this use case:
The use case is to save costs on AWS Kinesis & use Localstack Kinesis in K8s instead. We’re using many Kinesis stream & many Lambdas have event source mapping configured for them.
Configuring an AWS event source mapping instead of Localstack would be easier but I’m not sure if it’s possible since AWS event source mapping probably isn’t aware of anything not in AWS since you can use only AWS arn in it’s config.
I will look into the proposed AWS replicator extension solution later.
@vainkop Our new Lambda event source mapping implementation might be of interest for you.
Check out our new Lambda event source mapping (ESM) implementation in LocalStack v4 offering better functional and non-functional support for ESM . The behavioral coverage documentation provides more details for your use case Lambda | Docs
Feel free to create a GitHub issue or share your feedback if you experience any challenges👂