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
3
votes
1 answer

Can't run AWS SAM CLI under Docker

I'm trying to create a Docker image for AWS SAM CLI, but invoking any function gives an error: "Unable to import module 'index'". I can run the same test case outside of Docker sucessfully. You can clone the test case here or see the files below. I…
J. Doe
  • 31
  • 1
  • 2
3
votes
1 answer

SAM Template: multiple microservice lambdas sharing a single AWS::ApiGateway::DomainName

My goal is allow several independent lambda resources (microservices) to share a common custom domain for test environment. Using the below template, deploying microservice #1 went off without issue. However, when deploying microservice #2,…
Kwhitejr
  • 2,206
  • 5
  • 29
  • 49
3
votes
0 answers

Error invoking nodejs6.10 runtime: Error response from daemon: Minimum memory limit allowed is 4MB

I'm running docker for mac and I'm using a docker file. I'm also using a docker-compose file to create a mysql docker instance and a sam local instance on the same bridge network. I was able to copy over my files to the sam local instance and get…
Gino J
  • 71
  • 1
  • 6
2
votes
0 answers

Getting error on npm install `npm WARN tar zlib: incorrect data check`

What is happening? When I run npm install from my project directory, I am presented with this message: npm WARN tar zlib: incorrect data check npm WARN tarball cached data for acorn@https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz…
2
votes
1 answer

Error: Failed to create/update the stack: resume-stack, Waiter StackUpdateComplete failed

I am trying to reproduce, step-by-step, the instructions on this video "Install AWS SAM CLI and create an S3 Bucket" from youtube, https://www.youtube.com/watch?v=EeLdSO6LHW0m, on how to create an S3 Bucket using SAM as Infrastructure as Code. I…
2
votes
1 answer

Property StageName: not defined for resource of type AWS::Serverless::Api

I have seen alot of post say that you can add OpenApiVersion: '2.0' to fix this problem but it does not change anything in my case. For some reason now that I am trying to add a Stage for the first time and run my function locally with sam local…
2
votes
1 answer

docker up and running on my Mac but "sam local invoke" command results in Error: Running AWS SAM projects locally requires Docker

I have Docker up and running on my Mac. But "sam local invoke" command results in Error: Running AWS SAM projects locally requires Docker. Have you got it installed and running? Anyone knows what could be the reason?
2
votes
0 answers

Nullpointer Exceptions on Spring Cloud Function when calling sam local

i am trying to get a Spring Function runnin von AWS sam local, however even though i got a handler and an exposed function Bean i am constantly getting a Nullpointer. @SpringBootApplication public class DemoApplication { public static void…
2
votes
1 answer

AWS SAM - Add Lambda Authorizer To Existing API

I have an AWS SAM application and I want to add Lambda Authorizer to some of my routes in my current API Gateway. All of the template.yaml samples have the same template for authorizers: protectedApi: Type: AWS::Serverless::HttpApi Auth: …
Riddick
  • 41
  • 4
2
votes
0 answers

AWS SAM on windows and docker in wsl -docker not recognized by SAM

I have AWS SAM installed in windows 10 ,How do i make it recognize the docker running in ubuntu20.04 in the same machine? When i run sam local invoke i get the following error Error: Running AWS SAM projects locally requires Docker. Have you got it…
swetha
  • 321
  • 5
  • 16
2
votes
1 answer

No response from invoke container when running sam local invoke

Trying to test a basic lambda locally that runs fine in AWS but I keep getting No response from invoke container for MyLambdaXXXXXXXX 'tsc' and 'synth' run fine and I get a proper cdk.out The invoke command is sam local invoke --region us-east-1…
canpan14
  • 1,181
  • 1
  • 14
  • 36
2
votes
0 answers

Why is .aws-sam taking up so much space (gb) locally?

I've been using AWS SAM without much issue for the last 6 months, with about 40 functions split across 4 projects. Just today I was cleaning up some hard disk space and notice my codebase folder for one project was 4.5 gbs, and I realized it was the…
Michael Du
  • 669
  • 7
  • 15
2
votes
1 answer

How to add stack-level tags to cloudformation stack deployed using SAM

I'm trying to add tags to a stack while using SAM deploy, but they're not showing up. The SAM cli command code can be found below. sam deploy --stack-name test-stack --resolve-image-repos --capabilities CAPABILITY_NAMED_IAM…
Dev
  • 612
  • 2
  • 13
  • 33
2
votes
0 answers

AWS SAM local api mock support

I have been working with AWS SAM and API first project - we have our API specified as an OpenAPI with AWS API GW extensions. For integration testing, we use local API Gateway (through sam local start-api, which works fine with integrated endpoints…
Martin Macak
  • 3,507
  • 2
  • 30
  • 54
2
votes
2 answers

CDK local testing, serverless

I'd ideally like a way of testing lambdas etc before deploying for quick iterative development. Have tried to use https://aws.amazon.com/blogs/compute/better-together-aws-sam-and-aws-cdk/ but it appears that this does not yet work with CDK…