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

AWS SAM CLI local invoke account id not set when --profile is passed as parameter

I'm trying to execute aws sam local invoke command in order to test my function locally. The problem occurs when I run this command passing profile parameter. The execution container sets account id as a dummy account like 123456789012 Does anybody…
Gudari
  • 287
  • 1
  • 16
0
votes
1 answer

aws-sam-cli Python requirements.txt missing from deployed Lambda when custom template.yaml

I have several AWS SAM templates for the same project, where the lambdas use Python 3.8, partly for different environments, and partly to try out new things, and I use -t my-template.yaml to specify which template to use. I build using the regular…
mhandis
  • 41
  • 1
  • 5
0
votes
1 answer

AWS SAM pipeline

I'm trying to build a pipeline for the standard AWS SAM HelloWorld template using Python 3.8. I'm using this template as a pipeline example. The only change I'm making to the pipeline is the Environment/Image which I'm changing from 3.6.5 to…
hugo
  • 1,175
  • 1
  • 11
  • 25
0
votes
1 answer

VSCode AWS Sam (node12.x image) TypeScript debugger not reaching breakpoints

Im trying to get vscode debugger to work with an application generated with AWS Sam, but with TypeScript. So before I added TypeScript, the debugger worked fine, I could reach the breakpoints without issue. When I added TypeScript, I had to change…
0
votes
0 answers

AWS SAM throws UnicodeEncodeError when invoking NodeJS 12.x lambda function

I have a Lambda@Edge function that will fire when a user connects to my website to perform authentication, which is controlled by a CloudFront distribution I've setup for my website. I want to develop this code locally so I setup a dummy HelloWorld…
Alex
  • 1,293
  • 1
  • 13
  • 26
0
votes
1 answer

AWS SAM CLI - Python - authorization middleware

I'm developing my first AWS serverless Python app and I need a something that processes and checks some of the HTTP request headers before actually entering the lambda handlers. This can be summarized in something like this (preliminary auth…
Luke
  • 1,794
  • 10
  • 43
  • 70
0
votes
3 answers

AWS Lambda "errorMessage": "[Errno 26] Text file busy"

I wrote my code and uploaded it to AWS Lambda succesfully via AWS SAM CLI. It basically goes into the URL I gave, and prints the title of the website. A very beginner level code. Below is my code: import os, shutil, uuid, time from selenium import…
0
votes
0 answers

Use dash in the variable name in yaml

I was trying to run API Gateway locally on my Mac with sam and template.yaml. However, I got this error ValueError: malformed url rule: '/v10/' Here is my my code in template.yaml: GetListFunction: Type:…
ForZ
  • 11
  • 1
0
votes
1 answer

Error: 'Topic does not exist' using SAM template for SNS topic creation?

I have been trying to create SNS topic and publishing messages to those topics? But after deploying on dev, I get error 'Topic doesn't exist'? SNS Topic SAM code: ItemServiceTopic: Type: AWS::SNS::Topic Properties: …
Aagam Doshi
  • 155
  • 2
  • 14
0
votes
1 answer

AWS SAM rest api gateway doesn't handle '-' in custom domain properly

I am trying to map a url like 'https://domain.domain/my-api' to rest api gateway, I use the template like: ... MyAPI: Type: AWS::Serverless::Api OpenApiVersion: 3.0.0 Properties: Domain: BasePath: - !Ref URLBasePath …
0
votes
1 answer

Using the serverless framework, is it possible to have functions call each other locally? Similar to SAM's sam local start-lambda?

I'm using serverless with AWS. I want to be able to test lambda functions calling other lambda functions locally. I noticed that there is a way to do this with the aws SAM tool…
tslater
  • 4,362
  • 3
  • 23
  • 27
0
votes
1 answer

sam package and deploy without packaged parameter file

Our sam package command is - sam package --template-file template.YML --output-template-file packaged-service.yml --s3-bucket $Template_Bucket_Name --s3-prefix service-build-$packagenumber sam deploy command is - sam deploy packaged-service.yml…
0
votes
1 answer

Lambda template fails for SubnetIds and SecurityGroupIds

I have the following template in my sam function: Resources: TagChangedFunction: Type: AWS::Serverless::Function Properties: CodeUri: tag_changed_function Handler: tag_changed/app.lambda_handler Runtime:…
Ivan C Myrvold
  • 680
  • 7
  • 23
0
votes
1 answer

Problem running lambda function locally with AWS SAM command on Fedora 32. Docker problem

Did anyone have any luck trying to properly install docker on Fedora 32 and run sam local commands? When I try to execute I get the following error every time: ERROR Uncaught Exception …
0
votes
1 answer

Calling lambda recursively in sam local invoke

How can I recursively call lambda inside itself in sam local environment? const AWS = require('aws-sdk'); const lambda = new AWS.Lambda(); exports.foo = async(event, context) => { // ....... lambda.invoke({ FuncitonName: context.functionName,…
yskkin
  • 854
  • 7
  • 24