Questions tagged [aws-sam]

AWS Serverless Application Model (AWS-SAM) is an open source framework used to define, test and deploy serverless applications to the AWS Cloud.

From the Developer Guide:

Benefits of Using AWS SAM

Because AWS SAM integrates with other AWS services, creating serverless applications with AWS SAM provides the following benefits:

Single-deployment configuration

. AWS SAM makes it easy to organize related components and resources, and operate on a single stack. You can use AWS SAM to share configuration (such as memory and timeouts) between resources, and deploy all related resources together as a single, versioned entity.

Extension of AWS CloudFormation.

Because AWS SAM is an extension of AWS CloudFormation, you get the reliable deployment capabilities of AWS CloudFormation. You can define resources by using AWS CloudFormation in your AWS SAM template. Also, you can use the full suite of resources, intrinsic functions, and other template features that are available in AWS CloudFormation.

Built-in best practices.

You can use AWS SAM to define and deploy your infrastructure as config. This makes it possible for you to use and enforce best practices such as code reviews. Also, with a few lines of configuration, you can enable safe deployments through CodeDeploy, and can enable tracing by using AWS X-Ray.

Local debugging and testing.

The AWS SAM CLI lets you locally build, test, and debug serverless applications that are defined by AWS SAM templates. The CLI provides a Lambda-like execution environment locally. It helps you catch issues upfront by providing parity with the actual Lambda execution environment. To step through and debug your code to understand what the code is doing, you can use AWS SAM with AWS toolkits like the AWS Toolkit for JetBrains, AWS Toolkit for PyCharm, AWS Toolkit for IntelliJ, and AWS Toolkit for Visual Studio Code. This tightens the feedback loop by making it possible for you to find and troubleshoot issues that you might run into in the cloud.

Deep integration with development tools.

You can use AWS SAM with a suite of AWS tools for building serverless applications. You can discover new applications in the AWS Serverless Application Repository. For authoring, testing, and debugging AWS SAM–based serverless applications, you can use the AWS Cloud9 IDE. To build a deployment pipeline for your serverless applications, you can use CodeBuild, CodeDeploy, and CodePipeline. You can also use AWS CodeStar to get started with a project structure, code repository, and a CI/CD pipeline that's automatically configured for you. To deploy your serverless application, you can use the Jenkins plugin. You can use the Stackery.io toolkit to build production-ready applications.

1001 questions
0
votes
1 answer

Unable to debug aws-sam project using aws eclipse toolkit

I am trying to debug aws-sam application using the steps here. However, I am not able to get eclipse toolkit to enter debug mode. The first steps in running in debug mode appear to work i.e. the project builds and runs tests successfully as can be…
Syed Ali
  • 1,817
  • 2
  • 23
  • 44
0
votes
1 answer

How to dynamically construct resource names using AWS SAM?

I'm new to AWS and SAM, so this may be an obvious question, but I just can't find an answer to it. I'm trying to construct a SAM template that allows the user to inject a parameter that will affect the names of all resources within. Specifically, an…
me--
  • 1,978
  • 1
  • 22
  • 42
0
votes
1 answer

Unable to install aws-sam-cli using pip on Windows 10

I'm at my wits end. I'm trying to install aws-sam-cli so that I can test AWS Lambda functions locally. I've followed all the tutorials I can find but I'm stuck. I've installed docker and python 3.7 onto my local machine but when I try to install…
Spike
  • 33
  • 1
  • 7
-1
votes
1 answer

AWS sam build failed due to docker not running in macOS (BUT it is running)

What I'm trying to do To try out the AWS SAM (Serverless Application Model) to deploy ML model. I used their sam machine learning template with PyTorch. This template utilized Docker, which is the root of the problem. Unfortunately, Docker is…
-1
votes
1 answer

CloudFormation Error: 'CodeUri' requires Bucket and Key properties to be specified

I'm creating a Lambda through CloudFormation. The Function code path must be dynamic. Here's my template: AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Parameters: LambdaBucketName: Type: String …
-1
votes
1 answer

How to give RDS instance permission to invoke lambda from CFT or SAM template

Below is what I wrote in my SAM template to give RDS permission to invoke the lambda function. I added policies key to give permission similar to other services but that does not seem to be the case with RDS. Type: AWS::RDS::DBInstance …
-1
votes
1 answer

AWS SAM build failing NpmExecutionError code 255

After long hours searching for answers, I give up and ask for help, hopefully someone will also benefit from this. Here is the problem, I have a project which uses AWS SAM. When i run sam build it fails with NpmExecutionError and a status code 255.…
-1
votes
1 answer

aws sam LambdaLayer deploying for every new build

I have a Resource in my template.yml: MyLayer: Type: AWS::Serverless::LayerVersion Properties: ContentUri: layers/my-layer CompatibleRuntimes: - python3.8 Metadata: BuildMethod: makefile This is my Makefile: …
jonua
  • 1,915
  • 3
  • 17
  • 27
-1
votes
1 answer

AWS sam template How to add multiple rules for S3 event?

I am trying to create lambda with s3 event trigger with below stack. i want to trigger the lambda when object are placed in two directory with in same s3 MyBucket: Type: AWS::S3::Bucket Properties: BucketName: !Ref S3 LambdaS3: #…
-2
votes
1 answer

How to use dynamic resource URL in lambda function

I have created a SQS from AWS SAM template.yaml which will return me the SQS path which is required by a lambda function to send message to. Now since the SQS path will be generated during the time of CFT stack creation, how can I use it beforehand…
1 2 3
66
67