Questions tagged [serverless-application-model]

61 questions
1
vote
1 answer

SAM build fails because Maven install fails with "The packaging for this project did not assign a file to the build artifact"

I have an issue where I am trying to get mvn install to work so that my sam build works with local invocation using Docker, but it keeps failing due to the following error: [ERROR] Failed to execute goal…
1
vote
1 answer

How to generate a proper event.json for a lambda called from API Gateway to run it locally?

I have a an aws lambda that I would like to be able to invoke locally utilizing sam local invoke "MyFunction" -e event.json, but my event.json file never seems to be correct. For example, if my lambda connects to DynamoDB, I get an error like "The…
1
vote
1 answer

How to deploy API gateway, Lambda(Node.js) and DynamoDB using SAM CLI?

I am trying to create an application in my local system and deploy it to the AWS cloud using SAM CLI. The basic outline of this application is given in the diagram. I have created a directory named myproj for this application and all the…
1
vote
1 answer

AWS invoke local Lambda Endpoint with Node.js SDK

in the SAM documentation there is the possibility shown to deploy your own lambda endpoint and call it with the Python SDK. You just have to startup the local lambda endpoint with sam local start-lambda and then continue with # USING AWS SDK …
1
vote
2 answers

Hiding CloudFormation/SAM secret in Aws Console Template tab

Suppose I have the following secret in a Cloud Formation (or SAM) template which I deploy to my AWS IAM account as part of a stack (with of course the sensitive value of the SecretString dynamically assigned by the script that runs the cloud…
Andrew Allaire
  • 1,162
  • 1
  • 11
  • 19
1
vote
2 answers

Deploy REST API with HTTP Endpoint Integration using SAM AWS?

I'm new to AWS SAM deployment. I have a use case to automate the deployment using SAM AWS. Having a Rest API GW with another HTTP endpoint invocation. I searched pretty more docs but I didn't find any solution for this. Could you mind suggest me how…
1
vote
1 answer

CloudFormation YAML State Machine: INVALID_JSON_DESCRIPTION for unrecognized token

I have the following code to deploy a Step Functions State Machine using CloudFormation: ... DefinitionString: !Sub - | { "StartAt": "Save Artifact to S3", "States": { "Save…
1
vote
2 answers

Is there any command to run Lambda function in the 'Debug' mode locally using the AWS SAM CLI?

I'm using the VS Code to write a Lambda function with AWS SAM (Serverless Application Model) CLI configured locally. I had started this project using this command sam init --runtime nodejs12.x --name After executing this command, I got a sample…
1
vote
1 answer

AWS CLI - Create s3 bucket from Linux error

I'm using AWS CLI to create the S3 bucket. I have installed the AWS CLI and running following command to create the bucket aws s3 mb s3://Test-sam-bucket --region us-west-1 Error: make_bucket failed: s3://Test-sam-bucket An error occurred…
1
vote
1 answer

How to invoke lambda in a different aws account using SAM template cloudformation

Cloudformation snippet for the role I am creating a serverless architecture model (SAM) using AWS lambda cloudformation. I have two lambdas - frontend lambda and a backend lambda. The front lambda is in account A and backend lambda is in account B.…
1
vote
1 answer

SAM template for API Gateway has errors within Visual Studio (as part of Serverless Application solution)

I am trying to create a SAM template (serverless.template) in visual studio to publish my API Gateway. I have a couple of errors being produced within the template validation (in Visual Studio) that I'm unable to resolve. When published, the stack…
1
vote
1 answer

SAM command failing with: ImportError: cannot import name AliasedEventEmitter

I am running a SAM template through AWS CodeBuild using a buildspec.yml file I believe that this issue is caused by pip installing a default python 2.7 version of the aws-sam-cli package. I'm not that familiar with how to pip install the python3…
1
vote
1 answer

How to add more details on a AWS SAM template for my api

I'm new to AWS serverless world and also to SAM. I just did a small bot that is actually totally functional but when I start doing a SAM Template to define it I have a doubt that I haven't been able to figure out. I have a api gateway, and it have…
0
votes
1 answer

Managing Files inside multipart/form-data API Gateway Request Body

I'm using AWS SAM to deploy locally my Lambda function and test it. I'm creating a function that receives a multipart/form-data body (includes a pdf file). When I do the request, lambda returns a 502 BAD GATEWAY message, but if I send only the text…
0
votes
1 answer

When using HttpApi via SAM is the OpenApi definition the single point of truth?

I've spent the day getting up to speed with SAM and in particular the HttpApi, but have hit a brick wall. Here's what I want to achieve (the dream): Create a REST API in Open API 3 (the contract) Pass the api.yaml to HttpApi and have it generate…