Function required to be defined locally to run on lambda? #142

Closed
jontonsoup opened this Issue Jan 25, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@jontonsoup

Say I create a function called uppercase and deploy it to lambda. It appears if I have lambda installed on a different codebase but provide the correct project.json information, it doesn't work.

AWS_REGION=us-east-1 apex invoke --logs uppercase < event.json

Will work.

but if I do rm -r functions/

AWS_REGION=us-east-1 apex invoke --logs uppercase < event.json

is now broken. I get -- error: project: no function found

This seems unintuitive, since my code should now be installed on lambda.

I'd love to be able to keep my deploy and my runtime on two different systems without having the code on both systems.

Is this possible?

Thanks!
Jon

@tj

This comment has been minimized.

Show comment
Hide comment
@tj

tj Jan 25, 2016

Member

We currently prefix functions with the project name by default, so you do need a "valid" project for invocations to work. Without this it would be something like apex invoke myproject_functionname. We could allow that but I'm not sure I understand the use-case of invoking without a valid project, could you elaborate on that a bit more?

thanks!

Member

tj commented Jan 25, 2016

We currently prefix functions with the project name by default, so you do need a "valid" project for invocations to work. Without this it would be something like apex invoke myproject_functionname. We could allow that but I'm not sure I understand the use-case of invoking without a valid project, could you elaborate on that a bit more?

thanks!

@jontonsoup

This comment has been minimized.

Show comment
Hide comment
@jontonsoup

jontonsoup Jan 25, 2016

@tj Thanks for the quick response.

I'm trying to call code that I have deployed to lambda through apex with just the project.json.

The use case for this integrating with existing systems. My assumption is I could write the code to a tmp directory deploy it to lambda, then delete it and call the code later.

Best,
Jon

@tj Thanks for the quick response.

I'm trying to call code that I have deployed to lambda through apex with just the project.json.

The use case for this integrating with existing systems. My assumption is I could write the code to a tmp directory deploy it to lambda, then delete it and call the code later.

Best,
Jon

@jontonsoup

This comment has been minimized.

Show comment
Hide comment
@jontonsoup

jontonsoup Jan 25, 2016

@tj as a side note, I tried deleting the /functions/ directory and running myprojectname_myfunctionname and got this error: error opening project: open functions: no such file or directory.

I then re-added the functions directory and tried again and got this: error: project: no function found.

I checked in lambda and I am calling the correct function name that is deployed.

@tj as a side note, I tried deleting the /functions/ directory and running myprojectname_myfunctionname and got this error: error opening project: open functions: no such file or directory.

I then re-added the functions directory and tried again and got this: error: project: no function found.

I checked in lambda and I am calling the correct function name that is deployed.

@tj

This comment has been minimized.

Show comment
Hide comment
@tj

tj Jan 25, 2016

Member

yep the project_function reference won't work yet, since we assume they're defined locally. I'm not sure that's a case we should handle in Apex, I'd like to design things around new deployments not legacy deployments, but I'll leave this open for a while in case anyone else has some feedback. I think your use-case is unique enough that just using the aws cli might make more sense.

Member

tj commented Jan 25, 2016

yep the project_function reference won't work yet, since we assume they're defined locally. I'm not sure that's a case we should handle in Apex, I'd like to design things around new deployments not legacy deployments, but I'll leave this open for a while in case anyone else has some feedback. I think your use-case is unique enough that just using the aws cli might make more sense.

@jontonsoup

This comment has been minimized.

Show comment
Hide comment

@tj Thanks!

@tj

This comment has been minimized.

Show comment
Hide comment
@tj

tj Jan 28, 2016

Member

Writing this one off for now, I don't think it's an invalid use-case but I'm not sure it's common enough for us to consider right now. We can re-open later if more people hit this case.

cheers

Member

tj commented Jan 28, 2016

Writing this one off for now, I don't think it's an invalid use-case but I'm not sure it's common enough for us to consider right now. We can re-open later if more people hit this case.

cheers

@tj tj closed this Jan 28, 2016

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