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
4
votes
0 answers

sam local invoke cannot find lambda layers image

I have defined a lambda layer in my Sam template, however Im having this issue. I havent found any related article that has this kind of error. 2019-09-01 16:10:14 Invoking app.lambda_handler (python3.7) 2019-09-01 16:10:14 Found credentials in…
XDProgrammer
  • 853
  • 2
  • 14
  • 31
4
votes
2 answers

Dockerfile - Could not find a version that satisfies the requirement serverlessrepo==0.1.5

Below is the Dockerfile for aws sam: FROM buildpack-deps:stable ARG PYTHON_VERSION=3.7.4 # Update and allow for apt over HTTPS RUN apt-get update && \ apt-get install -y apt-utils RUN apt-get install -y apt-transport-https # download and build…
overexchange
  • 15,768
  • 30
  • 152
  • 347
4
votes
1 answer

How to create an SQS queue with cloudformation/SAM that works with lambdas created with SAM?

I am creating lambdas from the AWS SAM, mostly they are working well but I am not sure how to grant permission for these lambda's to be triggered by SQS. Whenever I build/package/deploy I am trying to manually add an SQS trigger from the console and…
user3062260
  • 1,584
  • 4
  • 25
  • 53
4
votes
3 answers

Requirements file not found while deploying SAM tutorial app

I want to start using aws-sam to test locally my lambdas. I tried to the tutorial from https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-quick-start.html I created example app using sam init --runtime…
Clyde Barrow
  • 1,924
  • 8
  • 30
  • 60
4
votes
2 answers

How to configure AWS SAM on Eclipse and Window 10

I am using STS 4 (https://spring.io/tools) and added Eclipse AWS toolkit (https://marketplace.eclipse.org/content/aws-toolkit-eclipse) . After restart STS we can see everything is good. Now i have installed AWS SAM CLI local And configured path…
vaquar khan
  • 10,864
  • 5
  • 72
  • 96
4
votes
1 answer

How to enable "ApiKeyRequired" property in SAM without explicit swagger definition?

In cloudformation, AWS::ApiGateway::Method has a boolean property ApiKeyRequired . How can i achieve the same in SAM ? I know that we can enable using explicit swagger Configuration. which is like this { "swagger": "2.0", "info": { …
Private
  • 1,661
  • 1
  • 20
  • 51
4
votes
1 answer

SAM template environment variables use map, list, associative array?

I've only seen examples with single values in SAM templates: Environment: Variables: TABLE_NAME: my-table I want to do something like this but doesn't seem to work: Environment: Variables: myVar: - prop1: aaa prop2:…
red888
  • 27,709
  • 55
  • 204
  • 392
4
votes
2 answers

Dynamic AWS Sam Schedule Event Input param

We are automating a lambda via SAM to run on a Schedule Event. We use YAML but we are unable to work out how to use !Sub to make the Input be dynamic. If you read the sam documentation it says that Input needs to be a JSON formatted string The…
4
votes
2 answers

Deploy AWS SAM functions using already created roles

When trying to deploy to AWS using AWS SAM CLI my Lambda functions using the following script: aws cloudformation deploy --template-file /Users/ndelvalle/Projects/foo/functions/packaged-template.yaml --stack-name foo --region sa-east-1…
Nicolas Del Valle
  • 1,384
  • 15
  • 20
4
votes
1 answer

How to access private AWS resources in AWS SAM LOCAL when start-api testing

I've been working with AWS SAM Local to create and test a lambda / api gateway stack before shipping it to production. I have recently ran into a brick wall when trying to access private resources (RDS) when testing locally (sam local start-api…
4
votes
1 answer

sam local start-lambda - how to send send s3 event to sam local endpoint

I can invoke a local lambda http endpoint (sam local start-lambda), but how do I trigger that lambda endpoint with a (mock) AWS event (s3, etc.) like I can when using the Dockerized lambda environment (sam local invoke -e event.json…
tedro
  • 51
  • 1
  • 5
4
votes
1 answer

AWS SAM CLI in Docker container results in ClassNotFoundException

I'm trying to make AWS SAM CLI part of my docker-compose file, based on this project. Everything seems to come up appropriately, except when I invoke my Lambda function I get a ClassNotFoundException. I've seen several people have problems with…
Azuaron
  • 391
  • 3
  • 17
4
votes
1 answer

Can sam local also create an SNS topic?

I am confused about sam locals SNS support. Can only point a Lambda to an existing SNS topic with sam templates or, can sam also create the topic for me too? I very much want to do the latter if possible.
red888
  • 27,709
  • 55
  • 204
  • 392
4
votes
2 answers

How do I disable AWS SAM local in eclipse?

I installed the AWS Toolkit for Eclipse because I was working on a project that was linked with AWS Lambda. When they introduced SAM local it kept going to the top of my run configurations list, therefore running when I click the run button. I only…
TheOnlyMrCat
  • 205
  • 2
  • 13
3
votes
1 answer

Error while executing command: sam build --use-container --template ${SAM_TEMPLATE}. Reason: exit status 1

I was trying to run sam build --use-container --template ${SAM_TEMPLATE} but it failed and showed Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: sam build --use-container --template ${SAM_TEMPLATE}.…