aws lambda didn't convert json request to POJO

I have a lambda function: package org.smarter.note; import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.LambdaLogger; import...

aws-sam-local environment variables

I am following the readme here: https://github.com/awslabs/aws-sam-local I have a lambda written in python 3.6 and its similar to the helloworld example here :...

connecting AWS SAM Local with dynamodb in docker

I've set up an api gateway/aws lambda pair using AWS sam local and confirmed I can call it successfully after running sam local start-api I've then added a local dynamodb instance in a docker...

Running AWS SAM projects locally get error

I am trying to run an AWS Lambda project locally on Ubuntu. When I run the project with AWS SAM Local it shows me this error: Error: Running AWS SAM projects locally requires Docker. Have you got...

SAM CLI for CI/CD other than Cloud Formation

Is it possible to use SAM CLI (or any other tool known to mankind) to deploy a lambda function with defined triggers, memory and timeout limits set, etc. the way SAM CLI is able to do it using...

AWS SAM Template - Define SQS queue triggered by API Gateway

I'm facing a problem when trying to deploy my stack via AWS SAM CLI. I'm using the SAM simplified template which I package and deploy. All I want is to create an SQS queue and implicitly create an...

Enable CORS when running AWS SAM CLI locally

Whenever I try to access serverless lambda function via POST through the browser I get the error Response to preflight request doesn't pass access control check: No >'Access-Control-Allow-Origin'...

Is it possible/recommended to use `sam build` in AWS CodeBuild?

This question spun out of this one. Now that I have a better understanding of what was going wrong there, and a workable, if imperfect, solution, I'm submitting a more focused follow-up (I'm still...

Updating Lambda to AWS through intellij plugin

I'm uploading a Spring Application to a Lambda function on AWS through IntelliJ's AWS Toolkit but when uploading the code to the S3 bucket it runs sam build and yields the following...

Unable to upload artifact None referenced by CodeUri parameter of HelloWorldFunction resource

I'm following this tutorial to learn how to use SAM. Here's the code I have: template.yml: AWSTemplateFormatVersion : '2010-09-09' Transform: AWS::Serverless-2016-10-31 Resources: ...

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...

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...

sam package vs aws cloudformation package

The docs say they do exactly the same thing: Both the sam package and sam deploy commands described in this section are identical to their AWS CLI equivalent commands aws cloudformation package...

How to set a stage name in a SAM template

I want to set a stage name for the API Gateway in a SAM template.yaml. But whatever I try I'm not succeeding. Without trying to name my stage, everything works as expected but with the default...

sam build --use-container failed mounting directory

There was no issue in building the project a little while back, but it started throwing below error. RuntimeError: Container does not exist. Cannot get logs for this container Normally this...

Problems testing AWS Gateway API locally

I'm trying to locally test the AWS Gateway Api locally and have been following this site (among others). I've pulled down multiple example repo's and tried to get it working and have struck out so...

How to get latest version of SAM-CLI on windows

I have latest node installed: node --version v14.15.0 I installed sam-cli from ...

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...

Lambda does not have permission to access the ECR image

With the recent release of Docker Images for Lambda functions, I've decided to try out this functionality using CloudFormation. So, the lambda below considers a docker image stored in Elastic...

How to export PATH to "sam build" command?

I'm developing AWS Lambda function on PyCharm. When I do "Run" button, Following error message. /usr/local/bin/sam build MyFunction --template /Users/miyashiiii/Works/myapp/myapp/template.yaml...

Python is not configured for aws sam cli

I am following this tutorial to build a SAM App: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started-hello-world.html When i did sam build, I...

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...

How to add environment variables in template.yaml in a secured way?

When creating Lambda function through the SAM CLI using template.yaml, I have to pass few environment variables, and they shouldn't be exposed on GitHub. Is there any way I can refer the...

Sam build in intellij: Error: JavaMavenWorkflow:MavenBuild - 'utf-8' codec can't decode byte 0xbb in position 150889: invalid start byte

I am working with an aws serverless architecture with spring boot application. When I some time build the project using sam build in intellij, I am getting the following error. Building codeuri: ....

Sam build fails with: Build Failed Error: NodejsNpmBuilder:NpmPack - NPM Failed: npm ERR! code Z_DATA_ERROR

I'm learning how to create lambdas on aws. I'm following this official tutorial. The commands I run: sam init (default values for everything, I'm choosing template 8 - webapp backend) cd...

AWS SAM: Unable to unmarshal input

I'm trying to build a lambda function with SAM (python3.8). I installed the AWS toolkit on VSCode and created the hello_world function. SAM Build completed successfully. When I run the invoke...

How do I invoke a SAM Lambda function locally with X-Ray statements?

I'm receiving the following error when invoking an AWS SAM Lambda function locally: Missing AWS Lambda trace data for X-Ray. Ensure Active Tracing is enabled and no subsegments are created outside...

How to deploy to different environments with AWS SAM

I have two questions about AWS SAM and deployments. I’m reading through the docs and checking through examples like this and I’m still not quite sure how to deploy to a staging and production...

AWS "sam deploy" function times out. Stack stays in "REVIEW_IN_PROGRESS" status

I'm trying to deploy a very simple function as shown in below template.yaml file. It creates a "samcli-deploy1629444458" changeset and it stays in "CREATE_IN_PROGRESS" status. When I check details...

AWS Cloudformation: How to fix "Api Event must reference an Api in the same template" error?

I am trying to split my stack into nested stack because i hit the AWS Max stack resource limit. I am building a REST API. I want to use a one API Gateway for all the stacks. Below is my...