Questions tagged [serverless-application-model]
61 questions
48
votes
12 answers
Execution failed due to configuration error: Invalid permissions on Lambda function
I am building a serverless application using AWS Lambda and API Gateway via Visual Studio. I am working in C#, and using the serverless application model (SAM) in order to deploy my API. I build the code in Visual Studio, then deploy via publish to…

JamesMatson
- 2,522
- 2
- 37
- 86
17
votes
10 answers
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:
HelloWorldFunction:
Type: AWS::Serverless::Function
…

Brian
- 12,145
- 20
- 90
- 153
12
votes
3 answers
How to transform a Serverless Application Model (SAM) template to Cloudformation?
From this answer I understand that SAM is a transform of Cloudformation.
Is there a way to get the transformed Cloudformation template from a SAM template via the console, CLI, or another way?

Victor
- 23,172
- 30
- 86
- 125
12
votes
1 answer
Can I specify Node.js command line options in AWS Lambda?
I'm using AWS SAM and running against Node 10.x.
Would love to pass in the flags for experimental modules and top level await.
Thanks!

Sean Lindo
- 1,387
- 16
- 33
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…

holtc
- 1,780
- 3
- 16
- 35
7
votes
1 answer
Create an API Gateway Proxy Resource using SAM
I have an apparently-simple requirement to create a proxy resource in SAM (Amazon's Serverless Application Model). So simple in fact that Amazon's documentation appears to leave this as an exercise to the reader!
I want to create an AWS API Gateway…

Alex Harvey
- 14,494
- 5
- 61
- 97
6
votes
0 answers
How to share a single API Gateway across multiple SAM templates?
I've been trying to use a single APIGateway across multiple SAM templates. For this, I've tried importing the RestApiId from the base template on other SAM templates and use it under the event sections of a lambda. But SAM has restriction saying…

sumanth
- 751
- 2
- 15
- 34
6
votes
2 answers
How can I write nested IF in serverless.yml using yaml format file while using it for cloud formation?
I'm trying to access secrets created in secrets manager(https://aws.amazon.com/secrets-manager/) via SSM (Systems Manager- https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html ) i.e. AWS Parameter store,…

Gurpreet Singh Drish
- 159
- 2
- 14
6
votes
3 answers
Using List of IAM Policy Document Objects as AWS::Serverless::Function Policies
According to the documentation for AWS::Serverless::Function in the Serverless Application Model, it is possible to specify a list of IAM Policy Document Objects (PDO) for the Policies property of a Resource.
However, the AWS Toolkit for Visual…

Chris Paton
- 5,113
- 4
- 41
- 52
5
votes
1 answer
AWS S3 creation error: "The event is not supported for notifications (Service: Amazon S3; Status Code: 400; Error Code: InvalidArgument"
I'm developing my first lambda in Code9 that suppose to be triggered by S3 event. Unfortunetly, when I'm trying to deploy, I'm constantly getting CloudFormation Error:
"The event is not supported for notifications (Service: Amazon S3; Status Code:…

awenclaw
- 373
- 5
- 20
5
votes
2 answers
AWS API Gateway api key required not set to 'true' after deployment
I have a .NET solution that uses a SAM template to generate cloudformation to deploy the stack. I am expecting the deployment - once complete - to have API Key Required = true on at least one of the methods. However after deployment, the keys and…

JamesMatson
- 2,522
- 2
- 37
- 86
4
votes
0 answers
How to setup VSCode to debug aws lambda locally?
I am getting started with AWS Lambda. The editor of my choice is VSCode. I watched the official introduction on how to setup VSCode for this task as a start. In there, the "instructors" use the GUI to debug a function locally or to run it locally by…

User12547645
- 6,955
- 3
- 38
- 69
4
votes
0 answers
SAM Lambda Layer module not found for shared nodejs code
I'm defining multiple lambda functions in a single template.yaml. These functions have some common code, but not published modules. I assumed I could turn this common stuff into a versioned layer. With a directory to the effect as…

S. Irwin
- 41
- 3
4
votes
0 answers
SAM give access to Cognito
I want to be able to call cognito functions through boto3 from my Lambda function in Python environment. What's the best way to give this type of access? I've done the following yaml but not sure if that's the best practice or I'm making the…

EralpB
- 1,621
- 4
- 23
- 36
4
votes
1 answer
SAM API Gateway caching with a method with query parameters
With the following SAM template:
Resources:
MyApi:
Type: AWS::Serverless::Api
Properties:
StageName: Prod
CacheClusterEnabled: true
CacheClusterSize: '0.5'
MethodSettings:
- HttpMethod: GET
…

Igor L.
- 3,159
- 7
- 40
- 61