Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local environment with RIE and funcion names #66

Open
DiTo97 opened this issue Apr 11, 2022 · 5 comments
Open

Local environment with RIE and funcion names #66

DiTo97 opened this issue Apr 11, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@DiTo97
Copy link

DiTo97 commented Apr 11, 2022

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?

@ghost ghost added the enhancement New feature or request label Aug 17, 2022
@djsamseng
Copy link

djsamseng commented Jan 13, 2023

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
Copy link
Author

DiTo97 commented Jan 13, 2023

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
Copy link

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
Copy link
Author

DiTo97 commented Jan 14, 2023

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
Copy link

skwashd commented Mar 5, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants