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

AWS SAM deployed Error under hello world template

I'm currently working on AWS serverless lambda function deployment and try to distribute and test with AWS SAM. However, when I followed the AWS SAM hello world template tutorial on official website, I can't really deploy my code to AWS. I've…
9
votes
1 answer

AWS SAM CLI cannot access Dynamo DB when function is invoked locally

I am building an AWS lambda with aws-sam-cli. In the function, I want to access a certain DynamoDB table. My issue is that the function comes back with this error when I invoke it locally with the sam local invoke command: ResourceNotFoundException:…
9
votes
6 answers

SAM Build only completes successfully with --use-container parameter

I'm developing a Lambda function written in python3.6 to test locally, then deploy to AWS once working. I'm using PyCharm's AWS Serverless Toolkit for this. SAM build is not building successfully when not including the --use-container…
OscarVanL
  • 701
  • 1
  • 6
  • 21
9
votes
1 answer

Multiple Lambda functions from the sam.yml file

Still waiting for actual AWS support for this: https://github.com/aws-samples/aws-serverless-samfarm/issues/5 How is this supposed to work? My use case is I have an API Gateway fronted lambda that writes events to an SNS topic. I have another lambda…
red888
  • 27,709
  • 55
  • 204
  • 392
9
votes
1 answer

Invoke AWS Lambda with AWS X-Ray locally

Is there a way to invoke lambda with X-Ray by using sam invoke local? According to the idea which PaulMaddox mentioned, I have tried the step below, and I don't know whether I misunderstood : Run a X-Ray Daemon locally (0.0.0.0:2000) by following…
willisc
  • 507
  • 4
  • 22
9
votes
0 answers

AWS Cognito and AWS Lambda - SAM Local

I am building and testing Lambda functions on my local pc. The Lambda's are exposed through SAM using the "sam local start-api" command and called through Javascript. I have now set up a user pool on AWS Cognito (in the cloud). My app is correctly…
dmi88
  • 121
  • 3
8
votes
4 answers

Using AWS SAM-CLI requires rebuild every time I update the code

I am using SAM CLI to develop an API Gateway Lambda proxy integration. According to the docs, I should be able to use sam local start-api to test my endpoint locally. The start-api command allows for "hot reloading" as described in the AWS SAM…
Jeff
  • 2,293
  • 4
  • 26
  • 43
8
votes
4 answers

AWS SAM - Config TOML File

Working through a deployment on a stack using AWS SAM and deploying via GitHub actions and was trying to use the Config TOML file and specifying a config environment in the deploy command and I am running into the issue where it seems to be just…
OMeThEre
  • 81
  • 1
  • 1
  • 2
8
votes
3 answers

“SSL: CERTIFICATE_VERIFY_FAILED” Error when publish MQTT, AWS IoT

I am getting the following error: [ERROR] SSLError: SSL validation failed for https://data.iot.ap-northeast-2.amazonaws.com/topics/app%2Ftest%2Fresponse?qos=1 [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer…
pang
  • 81
  • 1
  • 2
8
votes
0 answers

AWS SAM building Layers locally with `--use-container` flag?

I'm using the sam cli to build and deploy AWS Lambdas: The sam build command iterates through the functions in your application, looks for a manifest file (such as requirements.txt) that contains the dependencies, and automatically creates…
tgk
  • 3,857
  • 2
  • 27
  • 42
8
votes
1 answer

AWS::ApiGateway::Stage requires DeploymentId ... but where do I find this?

I am trying to programmatically set up stages as part of my AWS API Gateway deployment. I am using SAM CLI. The cloudformation docs give the definition: DeploymentId The ID of the deployment that the stage points to. Required: Yes Type:…
HolyMoly
  • 2,020
  • 3
  • 22
  • 35
8
votes
1 answer

Lambda cannot access KMS Key

When I run my lambda code, I get the following error: The ciphertext refers to a customer master key that does not exist, does not exist in this region, or you are not allowed to access. I have mostly followed this to create the stack using…
8
votes
1 answer

Using SAM application how to define body mapping templates

I am new to AWS and SAM. I am developing a dummy backend using AWS services. For that, I am using SAM application to write the code locally. I defined the structure of APIs and Lambda in that as AWSTemplateFormatVersion: '2010-09-09' Transform:…
Sai M.
  • 2,548
  • 4
  • 29
  • 46
7
votes
5 answers

AWS Serverless Application Model init error on Pycharm

I am trying to create a new AWS Serverless Application on Pycharm but i am getting this error: Could not execute `sam init`!: [Cloning from https://github.com/aws/aws-sam-cli-app-templates (process may take a moment), Error: Unstable state when…
Utku Can
  • 683
  • 3
  • 12
7
votes
2 answers

How can I invoke another lambda function also defined in AWS SAM template?

I know how to invoke lambda functions that I've named and already exist as Lambda Functions but how can I have a FunctionA invoke FunctionB that I'm defining in AWS SAM template together, and won't know the name beforehand, aka dynamically. Is there…
1 2
3
34 35