Topics 58
Amazon API Gateway Amazon Athena Amazon CloudFront & Content Delivery Amazon DynamoDB Amazon ECS (Elastic Container Service) Amazon EFS (Elastic File System) Amazon EKS (Elastic Kubernetes Service) Amazon ElastiCache (Redis & Memcached) Amazon EventBridge Amazon Kinesis & Data Streaming Amazon QuickSight & Business Intelligence Amazon Redshift & Data Warehousing Amazon Route 53 & DNS Management Amazon SageMaker & Machine Learning on AWS Amazon SNS (Simple Notification Service) Amazon SQS (Simple Queue Service) Auto Scaling Groups AWS AI Services (Rekognition, Polly, Lex & Comprehend) AWS Backup & Disaster Recovery AWS Batch AWS Certificate Manager (ACM) AWS Certification Paths & Career Roadmap AWS CLI & SDKs AWS CloudTrail & Auditing AWS CodePipeline, CodeBuild & CodeDeploy (CI/CD) AWS Config AWS Cost Management & Billing AWS Database Migration Service & Application Migration AWS Direct Connect & Hybrid Connectivity AWS Elastic Beanstalk AWS Fargate AWS Free Tier & Account Setup AWS Global Infrastructure (Regions, AZs & Edge Locations) AWS Glue & ETL AWS KMS & Data Encryption AWS Organizations & Multi Account Strategy AWS Outposts & Hybrid Cloud AWS Secrets Manager & Parameter Store AWS Security Hub & GuardDuty AWS Serverless Application Model (SAM) AWS Step Functions AWS Storage Gateway AWS Systems Manager AWS Trusted Advisor AWS WAF & Shield Core Services Overview EC2 & Compute Elastic Container Registry (ECR) Elastic Load Balancing (ALB, NLB & CLB) IaC (CloudFormation) IAM Lambda & Serverless Monitoring (CloudWatch) RDS & Databases S3 & Storage Tagging Strategies & Resource Management VPC & Networking Well-Architected Framework

AWS Serverless Application Model (SAM)

7 questions found

What is AWS SAM and how does it simplify building and deploying serverless applications?

Beginner
AWS SAM, or Serverless Application Model, is an open source framework that provides a simplified shorthand syntax for defining serverless resources like Lambda functions, API Gateway endpoints, and DynamoDB tables, which SAM then automatically transforms into a full CloudFormation template during deployment, letting you define a complete serverless application with significantly less code than writing raw CloudFormation directly.
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
  MyFunction:
    Type: AWS::Serverless::Function
    Properties:
      Handler: app.handler
      Runtime: python3.12
Real-world example A developer building a serverless API defines their Lambda function, API Gateway endpoint, and DynamoDB table using SAM's concise syntax, requiring far fewer lines of configuration than would be needed to define the same resources directly in raw CloudFormation.

Common follow-ups: How does SAM relate to and differ from raw CloudFormation?;What is the AWS::Serverless-2016-10-31 transform doing behind the scenes?

IaC (CloudFormation);Lambda & Serverless

What is the SAM CLI, and how does it support local testing of serverless applications before deployment?

Beginner
The SAM CLI is a command line tool that lets you build, test, and debug serverless applications locally on your own machine using Docker to emulate the actual Lambda execution environment, allowing you to invoke functions and test API Gateway endpoints locally before ever deploying anything to AWS, significantly speeding up the development feedback loop compared to deploying to the cloud after every small code change.
sam local invoke MyFunction --event event.json
sam local start-api
Real-world example A developer building a new Lambda function uses sam local invoke to test their function's logic against a sample event directly on their laptop, catching several bugs before ever deploying the function to an actual AWS environment.

Common follow-ups: How accurately does the local Docker based emulation match the real Lambda execution environment?;What are the limitations of local testing compared to testing in an actual AWS environment?

Lambda & Serverless;AWS CLI & SDKs

How does the sam build and sam deploy workflow package and deploy a serverless application to AWS?

Intermediate
The sam build command compiles your application code and its dependencies into a deployment ready format, resolving anything needed for the target Lambda runtime, and sam deploy then packages those build artifacts, uploads them to S3, and executes a CloudFormation deployment using the transformed SAM template, handling the entire process of getting your local application code running as a live set of AWS resources with just these two straightforward commands.
sam build
sam deploy --guided
Real-world example A team automates their deployment process using sam build followed by sam deploy within their CI/CD pipeline, ensuring every code change that passes tests is automatically packaged and deployed to their AWS environment consistently.

Common follow-ups: What does the --guided flag do during the first sam deploy?;How do build dependencies get resolved differently for different Lambda runtimes?

AWS CodePipeline CodeBuild & CodeDeploy (CI/CD);Lambda & Serverless

How does SAM support defining event sources, such as API Gateway or S3 triggers, directly within a function's configuration?

Intermediate
SAM lets you define event sources as a property directly on a serverless function resource, such as specifying an Api event type to automatically create an API Gateway endpoint that triggers the function, or an S3 event type to trigger the function whenever a new object is uploaded to a specific bucket, automatically wiring up all of the necessary underlying permissions and event source configuration without you needing to configure each connected service separately.
Resources:
  MyFunction:
    Type: AWS::Serverless::Function
    Properties:
      Events:
        ApiEvent:
          Type: Api
          Properties:
            Path: /orders
            Method: post
Real-world example A developer defines a Lambda function in their SAM template with an Api event source pointing to a specific path and HTTP method, and SAM automatically creates and wires up the corresponding API Gateway resource along with all necessary permissions.

Common follow-ups: What other event source types does SAM support besides Api and S3?;How do you configure a function to be triggered by an SQS queue in SAM?

Amazon API Gateway;Amazon SQS (Simple Queue Service)

How does SAM support safe, gradual Lambda deployments using traffic shifting and automatic rollback?

Intermediate
SAM integrates with CodeDeploy to support gradual traffic shifting deployment strategies for Lambda functions, such as shifting ten percent of traffic to a new function version at a time over several minutes, combined with CloudWatch alarms that automatically trigger a rollback to the previous version if errors increase during the rollout, providing a much safer deployment process than immediately shifting one hundred percent of traffic to an unproven new version.
Resources:
  MyFunction:
    Type: AWS::Serverless::Function
    Properties:
      AutoPublishAlias: live
      DeploymentPreference:
        Type: Canary10Percent5Minutes
        Alarms:
          - !Ref ErrorAlarm
Real-world example A payment processing team configures their SAM template to use a canary deployment strategy, automatically rolling back a Lambda function update if error rates spike during the initial ten percent traffic shift, preventing a bad deployment from ever reaching all customers.

Common follow-ups: What deployment preference types does SAM support besides Canary?;How quickly does an automatic rollback trigger once an alarm threshold is breached?

Lambda & Serverless;AWS CodePipeline CodeBuild & CodeDeploy (CI/CD)

How does SAM support nested applications and reusable components through the AWS Serverless Application Repository?

Advanced
SAM applications can be published to the AWS Serverless Application Repository, allowing other teams or even the broader public to easily discover and deploy pre built serverless applications or components as nested applications within their own SAM templates, promoting reuse of common serverless patterns, such as a standard image resizing function, without needing to rebuild the same commonly needed functionality from scratch every time.
Resources:
  ImageResizer:
    Type: AWS::Serverless::Application
    Properties:
      Location:
        ApplicationId: arn:aws:serverlessrepo:us-east-1:123456789012:applications/image-resizer
        SemanticVersion: 1.0.0
Real-world example A company building a new application reuses a well tested image resizing function published to the Serverless Application Repository by referencing it as a nested application within their own SAM template, avoiding the need to write and maintain that functionality themselves.

Common follow-ups: How do you publish your own SAM application to the Serverless Application Repository?;What are the security considerations when using a third party published application from the repository?

Lambda & Serverless;IaC (CloudFormation)

How can SAM templates be organized and parameterized to support deploying the same serverless application consistently across multiple environments like development, staging, and production?

Advanced
SAM templates support parameters and conditions that let you customize resource configuration based on the target environment, such as using a smaller Lambda memory allocation and a shared development DynamoDB table for a dev environment while using higher memory and dedicated resources for production, combined with separate configuration files for each environment referenced during sam deploy, allowing a single template definition to be reliably deployed consistently with appropriate settings across every environment.
sam deploy --config-env production --parameter-overrides Environment=production MemorySize=512
Real-world example A development team maintains a single SAM template with environment specific parameter overrides, allowing the exact same application definition to be deployed with smaller resource allocations to their development environment and production grade settings to their production environment.

Common follow-ups: How do you manage separate parameter values for many different environments cleanly?;What is the difference between using SAM parameters versus separate template files per environment?

IaC (CloudFormation);AWS Organizations & Multi Account Strategy