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
2 answers

AWS SAM local debugging is chargeable?

I am using Visual Studio code for debugging a lamda function written in python. Is the local execution of the lamda function is chargeable ? since at the end of each execution we are getting an entry in the log showing execution time…
nightfly
  • 425
  • 2
  • 8
  • 18
0
votes
1 answer

AWS enable caching with queryStringParameter PathParameter for SAM API Gateway

I would like to enable caching for API Gateway for my serverless functions, but having hard time to understand where to do it and what way. I have tried to set up queryStringParameters in my serverless functions but that results in error, also tried…
0
votes
0 answers

How to create predefined restApi resource? with explicit name

Below is the SAM template that tries giving explicit name(some_name) to restApi resource on AWS: SampleApi: Type: AWS::Serverless::Api Properties: Name: some_name But I see the events in stack creation as: User:…
overexchange
  • 15,768
  • 30
  • 152
  • 347
0
votes
1 answer

How to assign a policy to adhoc user?

Background: With cross account role someaccountrole, I have access to aws account xyz. Case 1 To create a stack in account xyz, we upload the Cloudformation file through console. Amidst stack creation in Events tab, we see the very first event, as…
overexchange
  • 15,768
  • 30
  • 152
  • 347
0
votes
1 answer

Problem creating CodePipeline, Deploy stage for AWS SAM application

I have created a working CodePipeline for my AWS SAM application. It is using only Source and Build phases with the following buildspec.yaml file version: 0.2 phases: install: runtime-versions: python: 3.7 commands: - pip…
0
votes
1 answer

How to redirect a user after link verification to own customize UI in aws cognito?

After the signup a link will send to user registered email from cognito to verify the account, When user clicking the link it will redirect to cognito verify UI, but I want to redirect user to my own UI. How to achieve this I did some research…
0
votes
1 answer

aws:sts user for Stack creation - aws cli

Using sam deploy, where sam deploy is a wrapper of aws cloudformation deploy, we run below command from EC2, for stack creation: aws cloudformation deploy --template-file cfntemplate.yml --stack-name somestack-test --region us-east-1 Amidst stack…
overexchange
  • 15,768
  • 30
  • 152
  • 347
0
votes
1 answer

How to design SAM deployer policy? to enforce SAM generated AWS resources to be in PermissionBoundary

we have someAWSAccount assuming someaccountrole with instance profile name p in AWS. Managed policy by name some-permission-boundary is created in this account(someAWSAccount). Purpose of creating this boundary policy in this account is mentioned…
overexchange
  • 15,768
  • 30
  • 152
  • 347
0
votes
1 answer

How to "sam package" using AES256 encryption?

From here I see the syntax: sam package \ --template-file /path_to_template/template.yaml \ --s3-bucket bucket-name \ --s3-prefix appname/branchname/version --output-template-file packaged-template.yaml or aws cloudformation…
overexchange
  • 15,768
  • 30
  • 152
  • 347
0
votes
0 answers

Workaround for AWS SAM with a provided lambda runtime

I would like to stage a larger project with AWS SAM. Sadly a part of this project consists of a lambda function with a custom runtime and SAM does not include a way to set this up. Does anyone know a workaround for this? If there is no other way I…
Junge
  • 437
  • 6
  • 14
0
votes
2 answers

When/How to use permission boundary in serverless function?

Below SAM template: HelloWorldFunction: Type: AWS::Serverless::Function Properties: CodeUri: hello-world/ Handler: app.LambdaHandler Runtime: nodejs8.10 Events: MySQSEvent: Type: SQS …
overexchange
  • 15,768
  • 30
  • 152
  • 347
0
votes
1 answer

How to get endpoint of AWS API gateway created through SAM using javascript

I am creating an api gateway from a SAM template. I need a separate web page to make get requests to the api using javascript. However, I am unsure how to make requests if I don't know the endpoint since the endpoint is created dynamically on…
0
votes
0 answers

AWS Lambda Function to Container

I have a deployed AWS Lambda function that I would like to run in a container. There are no restrictions on where this container is run (AWS Fargate, EC2, My Local Machine, etc. are perfect) There are no restrictions on which containerization…
0
votes
1 answer

Specify resources allowed to call a function in its AWS SAM Function template

TL; DR: How should I edit the template below so that it can be triggered by a user pool trigger? I try to crate a CloudFormation template for a Lambda function defining both the services the function can call and be called from. It should be run…
vahdet
  • 6,357
  • 9
  • 51
  • 106
0
votes
1 answer

API Gateway directly connected to SNS with SAM

I would like to define a cloud formation template by sam. I would like to create an API Gateway method directly connected to SNS authorized by a custom authorizer. Is it possible to accomplish it with SAM? Thank you
aGO
  • 1,263
  • 14
  • 30