Questions tagged [aws-sam-cli]

AWS SAM Local allows developers to run & debug AWS Lambda code on local machine using Docker. AWS Lamda is a part of Amazon Web Services (AWS).

AWS SAM Local allows developers to run & debug AWS Lambda code on local machine using Docker. AWS Lamda is a part of Amazon Web Services (AWS).

Resources

512 questions
5
votes
1 answer

Timeout while waiting for command: "sam local invoke"

I'm building server less applications using AWS SAM SAM + VSCode + Docker desktop Everything was working fine, but suddenly I started getting timeout error when I run debug. Note: sam local invoke (without debug) works fine. Problem occurs when i…
5
votes
1 answer

No response from invoke container for FunctionName

Trying to port forward dockerized Lambda to my localhost using command: $ sam local start-api --docker-network host Error every time trying to access Lambda: No response from invoke container for FunctionName Tried also using host.docker.internal &…
MCMatan
  • 8,623
  • 6
  • 46
  • 85
5
votes
1 answer

AWS SAM local start-api: Set lambda nodejs 12.x flags (e.g. --experimental-modules)?

I use ES6 module syntax on my nodejs server: package.json "type": "module" I (successfully) run my server as local nodejs process. E.g.: "scripts": { "dev": "npm outdated ; nodemon --experimental-modules --inspect=4001 main.local.js" } Problem:…
5
votes
3 answers

AWS Lambda's: SAM deployment ...identifying and removing old S3 package versions?

I'm relatively new to AWS lambda's and SAM, and now I've got things working I've got a seemingly simple question I can't find an answer to. I've spent the last week getting a lambda app up and running using SAM (build, package, deploy numerous times…
Richard
  • 3,024
  • 2
  • 17
  • 40
5
votes
4 answers

aws sam build not able to build packages which require paramiko due to "Error: PythonPipBuilder:ResolveDependencies"

I've been learning the ropes with AWS SAM and have successfully deployed a number of lambdas together with dependencies and other AWS services. However, I seem to have run into a problem when trying to deploy a lambda which relies on some specific…
user3062260
  • 1,584
  • 4
  • 25
  • 53
5
votes
1 answer

How can I use api gateway stages via cloudformation or sam?

I am using AWS SAM to deploy my lambda and api gateway. Below is my template yaml file: AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > sam-app Sample SAM Template for sam-app # More info about…
5
votes
2 answers

How to exclude modules using AWS "sam build" for nodejs?

Using the sam build command I was expecting not to include the aws-sdk package as the Node.js Lambda runtime already includes it. As I understood the sam build for nodejs is a port of claudia pack command from claudiajs, but I do not see any…
MauricioRobayo
  • 2,207
  • 23
  • 26
5
votes
2 answers

How to connect RDS instance when running SAM locally?

I am using SAM (Serverless application model) to test Lambda functions locally that connect to an Aurora RDS instance in the cloud. Using the following command: sam local invoke "lambda function name" --event event.json The Lambda function is being…
Jignesh Patel
  • 61
  • 1
  • 4
5
votes
2 answers

AWS-SAM-LOCAL unit test strategy

I've been looking around for aws-sam-local unit testing strategies and haven't found much. Just looking for suggestions?
user1686620
  • 2,801
  • 4
  • 18
  • 21
5
votes
1 answer

deploy lambda to s3 bucket folder?

Here is the command to deploy the lambda: $ sam package --template-file sam.yaml --s3-bucket mybucket --output-template-file packaged.yaml But can I specify a bucket prefix? so it gets deployed to subfolder instead of root of bucket?
red888
  • 27,709
  • 55
  • 204
  • 392
5
votes
0 answers

Customizing API when integrating Lambda with API through AWS SAM

Problem I'm trying to run simple integration between Lambda and API Gateway with AWS SAM. I want to customize the input for lambda - apply some requestTemplates. But those seem to be ignored. Steps to reproduce Running with: sam local start-api curl…
Jan Zyka
  • 17,460
  • 16
  • 70
  • 118
5
votes
2 answers

Visual Studio Code Debugger Not Connecting to SAM Local

Per the AWS documentation, I am starting SAM local like this: $ sam local start-api -d 5858 I have the following in my launch.json { "version": "0.2.0", "configurations": [ { "name": "Attach to SAM Local", …
Neil Girardi
  • 4,533
  • 1
  • 28
  • 45
5
votes
1 answer

AWS lambda nodejs runtime: io: read/write on closed pipe

I am trying to execute a couple of async requests from a lambda function. The first call resolveEndpoints() succeeds and the second fails with 2017/11/03 17:13:27 Function oauth.callbackHandler timed out after 3 seconds 2017/11/03 17:13:27 Error…
nilobarp
  • 3,806
  • 2
  • 29
  • 37
5
votes
0 answers

Trying to get aws-sam-local to serve up my API

I've got a simple project. The basic setup is like this... project |- etc | |- sam.yaml | \- swagger.yaml |- src | |- client | | \- Client files (VUE frontend) | \- backend | |- index.js | \- package.json \-…
Justin808
  • 20,859
  • 46
  • 160
  • 265
4
votes
0 answers

Is there any way to use cache when sam building from launch.json?

The Problem I am currently working in some AWS Lambda Functions and testing it locally. Usually, the command sam build takes a lot to finish, so I searched a way to optimize it and found the sam build --cached --user-container. When running it in…
Cizika
  • 41
  • 2