You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: SAM local lambda server should support function ARNs on invoke API. #8289
I wish that when running the sam local start-lambda server, I could hit my lambda functions by calling the invoke API with a function ARN instead of explicitly requiring a function name.
Proposal
Rather than explicitly requiring the lambda runner to take in the function name, it should take in either a function name or ARN, and normalize it somewhere around here
Things to consider:
Will this require any updates to the SAM Spec - No
I'm a bit confused about what you're trying to achieve here. Let me explain why:
SAM already has sam remote invoke that does exactly what you'd need for calling deployed Lambdas with ARNs:
sam remote invoke arn:aws:lambda:us-east-1:123456789012:function:MyFunction
Now, if you add ARN support to sam local start-lambda, you realize it would still be calling your LOCAL function, right? It would just parse the ARN, extract "MyFunction", and run your local code. The region, account, everything else in that ARN - completely ignored.
So I'm not sure what problem this solves.
If you need to call deployed Lambdas → use sam remote invoke
If you need to test locally → use function names
What's the actual use case here that these don't cover?
Because adding ARN parsing just for the sake of it seems like unnecessary complexity. And it might actually confuse people into thinking they're testing against AWS when they're just running local code.
Can you explain what you're trying to do that doesn't work today?
I'm a bit confused about what you're trying to achieve here. Let me explain why:
SAM already has sam remote invoke that does exactly what you'd need for calling deployed Lambdas with ARNs:
sam remote invoke arn:aws:lambda:us-east-1:123456789012:function:MyFunction
Now, if you add ARN support to sam local start-lambda, you realize it would still be calling your LOCAL function, right? It would just parse the ARN, extract "MyFunction", and run your local code. The region, account, everything else in that ARN - completely ignored.
So I'm not sure what problem this solves.
If you need to call deployed Lambdas → use sam remote invoke If you need to test locally → use function names
What's the actual use case here that these don't cover?
Because adding ARN parsing just for the sake of it seems like unnecessary complexity. And it might actually confuse people into thinking they're testing against AWS when they're just running local code.
Can you explain what you're trying to do that doesn't work today?
Yes -- the goal is to add the same flexibility for parsing function names in sam local as the actual lambda service has (which is covered through sam remote invoke).
Let's say I have an external system that invokes lambda functions using the full ARN. If I want to test against a sam local start-lambda server, my system will need to normalize the function ARNs. I think this should be handled by SAM local so it has parity with the actual lambda service.
I understand your perspective, but using a Lambda ARN in SAM LOCAL (which is designed for local development) seems counterintuitive. While it's technically feasible, we'd essentially be working around the aws sam local's intended purpose by referencing non-local resources.
Could you share a specific use case where you envision this approach being beneficial?
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
I understand your perspective, but using a Lambda ARN in SAM LOCAL (which is designed for local development) seems counterintuitive. While it's technically feasible, we'd essentially be working around the aws sam local's intended purpose by referencing non-local resources.
Could you share a specific use case where you envision this approach being beneficial?
I think the intention for SAM local is to closely replicate the actual service. So, in the case of supporting the different ways that we can pass function name in the Invoke API against the service, we'd want SAM local to support the same.
The use-case I have in mind is customers who want to use SAM as their local lambda server, and they want to call Invoke using the full function ARN, or partial ARN. Without this change, these customers would need to build a workaround in their system to normalize the function ARN to just be the name since it isn't supported in SAM. This PR solves that issue by allowing SAM local to support all the different conventions that Invoke can be called with.
Activity
dcabib commentedon Oct 3, 2025
Hey @bchampp,
I'm a bit confused about what you're trying to achieve here. Let me explain why:
SAM already has
sam remote invokethat does exactly what you'd need for calling deployed Lambdas with ARNs:Now, if you add ARN support to
sam local start-lambda, you realize it would still be calling your LOCAL function, right? It would just parse the ARN, extract "MyFunction", and run your local code. The region, account, everything else in that ARN - completely ignored.So I'm not sure what problem this solves.
If you need to call deployed Lambdas → use
sam remote invokeIf you need to test locally → use function names
What's the actual use case here that these don't cover?
Because adding ARN parsing just for the sake of it seems like unnecessary complexity. And it might actually confuse people into thinking they're testing against AWS when they're just running local code.
Can you explain what you're trying to do that doesn't work today?
feat: Support all formats of function name in invoke
feat: Support all formats of function name in invoke
bchampp commentedon Oct 3, 2025
Yes -- the goal is to add the same flexibility for parsing function names in
sam localas the actual lambda service has (which is covered throughsam remote invoke).Let's say I have an external system that invokes lambda functions using the full ARN. If I want to test against a
sam local start-lambdaserver, my system will need to normalize the function ARNs. I think this should be handled by SAM local so it has parity with the actual lambda service.Does that make sense?
dcabib commentedon Oct 3, 2025
@bchampp
I understand your perspective, but using a Lambda ARN in SAM LOCAL (which is designed for local development) seems counterintuitive. While it's technically feasible, we'd essentially be working around the aws sam local's intended purpose by referencing non-local resources.
Could you share a specific use case where you envision this approach being beneficial?
feat: Support all formats of function name in invoke (#8295)
github-actions commentedon Oct 14, 2025
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
bchampp commentedon Oct 14, 2025
I think the intention for SAM local is to closely replicate the actual service. So, in the case of supporting the different ways that we can pass function name in the
InvokeAPI against the service, we'd want SAM local to support the same.The use-case I have in mind is customers who want to use SAM as their local lambda server, and they want to call Invoke using the full function ARN, or partial ARN. Without this change, these customers would need to build a workaround in their system to normalize the function ARN to just be the name since it isn't supported in SAM. This PR solves that issue by allowing SAM local to support all the different conventions that Invoke can be called with.