Is it possible to use aws libraries against the sam-local server?
Some of my lambda functions use other lambda functions that are not part of the api. For services like dynamodb or sqs I can pass --endpoint-url (aws-cli) or endpoint_url (boto3) to point at dynamodb-local or fake-sqs. I haven't been able to get that to work with sam-local and lambdas, which makes a certain amount of sense to me.
Is there a different way to have my local lambdas call other local lambdas without the lambda code reflecting it? (I realize I could do if (sam_local) { import x, x.blah() } else { lambda.invoke(...) }, but I'd rather not, if possible.
how about sending an http request to your other lambda endpoints?
under the hood it's the same thing, I think? The point is that unless you expose them via an Event: Type: Api it doesn't look like they're exposed for http traffic.
Maybe I'm just misunderstanding sam-local, but I was hoping to be able to use the same cloudformation template for local/staging/prod. There are some lambda functions that you don't want to expose in staging/prod.
Just to get a better understanding, what you want is:
aws --endpoint "https://localhost:8123/" lambda invoke --function-name "RESOURCE_NAME" /dev/null
To work in a sane way, just like dynamodb-local has it's api reflected?
yep.
Duplicate of #12.
This is something we'd like to do, but I don't have any further information on timescales. We'd welcome any pull requests in this area if you wanted to take a stab at it.