Skip to content

Fix default function name #49

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

Closed
wants to merge 1 commit into from
Closed

Conversation

skwashd
Copy link

@skwashd skwashd commented Sep 4, 2021

Issue #, if available:

Description of changes:

As noted in #46, the function name is derived from
the URL used to invoke it. The emulator uses function
in the API endpoint, but the AWS_LAMBDA_FUNCTION_NAME
environment variable is set to test_function. This
is an inconsistency between the emulator and the AWS
environment.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@valerena
Copy link
Contributor

valerena commented Oct 4, 2021

@skwashd thanks for this PR. Even though this change makes sense, it's actually changing the current "default" behavior, so I'll have to confirm with the team to see if we need to handle this in a special way. We'll get back to you after that.

@skwashd
Copy link
Author

skwashd commented Oct 4, 2021

@valerena thanks for the feedback. While rerolling #46, I realised those changes depend on this fix. I'm happy for us to close this and deal with both issues together over on on the other PR if that's easier.

If we were to follow semantic versioning, this fix would be a backwards compatibility break and so require a major release. I get that's not fun. The current behaviour is a bug as it doesn't follow the documented behaviour of the AWS Lambda environment.

I double checked the API docs and the Lambda environment variable docs and they align with this fix. The function name in the API call path should match the value of the AWS_LAMBDA_FUNCTION_NAME environment variable.

@valerena
Copy link
Contributor

valerena commented Oct 4, 2021

@skwashd I agree that it's better to handle both together. The other change is still "breaking", considering that for example SAM cli currently handles the fact that RIE always uses /function/invocations, so it's something that will have to be handled on that side before consuming the new version of RIE.

I think we could merge the changes into develop relatively soon, but we'll wait before actually making the new release.

Thanks for the contribution.

As noted in aws#46, the function name is derived from
the URL used to invoke it. The emulator uses `function`
in the API endpoint, but the `AWS_LAMBDA_FUNCTION_NAME`
environment variable is set to `test_function`. This
is an inconsistency between the emulator and the AWS
environment.
@skwashd
Copy link
Author

skwashd commented Oct 5, 2021

I've cherry-picked this commit onto the #46 PR. I'll let you decide if we close this one or merge this then the other one.

@skwashd
Copy link
Author

skwashd commented Oct 19, 2021

@valerena I was wondering if you'd made any progress with the team on this one

@valerena
Copy link
Contributor

Sorry, I thought I added a comment here. I'll close this one and let's keep everything in the other PR.

We haven't been able to fully get to this, but we should be able to close all our discussions soon. Feel free to ping us again in the other PR if by the end of next week there hasn't been any movement.

@valerena valerena closed this Oct 19, 2021
@skwashd skwashd deleted the fix-function branch July 9, 2024 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants