Skip to content

Local environment with RIE and funcion names #66

Open
@DiTo97

Description

@DiTo97

Hi,

I have been using your interface extensively to build a suite of Lambda apps. Our architecture encompasses several Lambda functions, that are supposed to talk to each other via the boto3 Python client. Thus far, I'm handling everything with HTTP ports on localhost, having a slightly different code base from the actual one that will be hosted on AWS.

Is it possible to have named Lambda functions within RIE, in order to use invoke calls via the boto3 Python client?

Activity

ghost added
enhancementNew feature or request
on Aug 17, 2022
djsamseng

djsamseng commented on Jan 13, 2023

@djsamseng

If you are using prebuilt images and have this in your Dockerfile FROM public.ecr.aws/lambda/python:3.8 for example

services:
  myfunctionname:

Otherwise #43 has a pull request which should help you

DiTo97

DiTo97 commented on Jan 13, 2023

@DiTo97
Author

If you are using prebuilt images and have this in your Dockerfile FROM public.ecr.aws/lambda/python:3.8 for example

services:
  myfunctionname:

Otherwise #43 has a pull request which should help you

It may sort of solve the issue, but I still think we should have full control on function naming while using RIE the same way we do while deploying on actual AWS environments. Why should any function have a fixed "function" name, or a one time name through env variables, instead of letting us choose?

One of the most cumbersome features while developing a suite of Lambda apps that depend on each other, is that you cannot exactly replicate the cloud behavior with RIE yet. Therefore, you have to resort to developing slightly different code bases, e.g. manually managing the way messages are sent/received, or skipping local development, favouring testing everything that regards Lambda functions inter-communication on a development AWS cloud environment (whose operative lifecycle is significantly slower than local development). All the above assuming being able to replicate cloud behaviour locally is one of the goals of RIE; otherwise, it is all empty talk.

On a side node, the PR you mentioned has been stale for quite some time. Is there any reason why it has not been merged in the code base yet?

djsamseng

djsamseng commented on Jan 14, 2023

@djsamseng

Sorry I’m not 100% sure I understand, but when I use FROM public.ecr.aws/lambda/python:3.8 and test locally using the built in RIE I can name the function whatever I want ex: myfunction. Is that not what you’re trying to do?

As for the PR I have no idea, the maintainers would likely know more

DiTo97

DiTo97 commented on Jan 14, 2023

@DiTo97
Author

Sorry I’m not 100% sure I understand, but when I use FROM public.ecr.aws/lambda/python:3.8 and test locally using the built in RIE I can name the function whatever I want ex: myfunction. Is that not what you’re trying to do?

As for the PR I have no idea, the maintainers would likely know more

Not entirely. I am talking about the behavior of the Boto3 package when inside RIE. Suppose you have two Lambda functions, where one of them is supposed to invoke the other using Boto3 when a certain event occurs. You would simply call the invoke method (or similar) from the appropriate Boto3 client, passing the name of the target function as well as all the necessary parameters. Let's now say that you're trying to test their interaction locally, before actually moving to the cloud. Is there a way to do it with RIE, without having to change any lines of code, i.e., is Boto3 able to invoke a named Lambda function (running locally) when the caller function is run with RIE, by simply providing the function name?

This is what I'm trying to say and, from my experience, the answer is no, but I may very well be wrong on this one, and gladly so.

I hope I've given a clearer explanation.

skwashd

skwashd commented on Mar 5, 2023

@skwashd

On a side node, the PR you mentioned has been stale for quite some time. Is there any reason why it has not been merged in the code base yet?

As the creator of the PR I'm keen to get an answer to this question too.

gayanper

gayanper commented on Mar 29, 2025

@gayanper

I also stumble upon this issue recently after discovering this great piece of emulation software. From a theoretical point of view to make the flow works as the OP asks here, We may need to have a possibility to pack multiple lambda functions into a single lambda runtime emulator isn't it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @skwashd@djsamseng@gayanper@DiTo97

        Issue actions

          Local environment with RIE and funcion names · Issue #66 · aws/aws-lambda-runtime-interface-emulator