AWS SAM Questions ❓
❓What is the purpose of the Transform field in a SAM template?
A: It specifies that the template uses the AWS SAM transformation.
❓Which command is used to validate a SAM template?
A: sam validate
❓What is the default timeout for an AWS Lambda function in SAM?
A: 3 seconds (Note: This can be overridden in the template).
❓How do you define an API Gateway endpoint in a SAM template?
A: Using the Events property with type Api.
❓What is the Globals section used for in a SAM template?
A: To set default properties for resources in the template.
❓Which command packages the application for deployment in SAM?
A: sam package
❓Which command deploys the packaged SAM application?
A: sam deploy
❓How can you run a Lambda function locally with SAM CLI?
A: sam local invoke
❓What does the CodeUri property specify in a SAM template?
A: The location of the code for the Lambda function.
❓How do you specify environment variables for a Lambda function in SAM?
A: Using the Environment property.
❓What type is used to define a DynamoDB table in SAM?
A: AWS::DynamoDB::Table
❓How do you reference an S3 bucket in a SAM template?
A: Using the AWS::S3::Bucket type.
❓What command would you use to start a local API Gateway for testing?
A: sam local start-api
❓Which intrinsic function can be used to get the ARN of a Lambda function?
A: !GetAtt
❓How do you specify IAM policies for a Lambda function in SAM?
A: Using the Policies property.
❓What does sam build do?
A: Builds the dependencies of your Lambda function.
❓What are the supported runtimes for AWS Lambda in SAM?
A: Python, Node.js, Java, Go, .NET Core, Ruby, etc.
❓How do you define a DynamoDB table with on-demand billing mode in SAM?
A: Using the BillingMode property with value PAY_PER_REQUEST.
❓How do you include outputs in a SAM template?
A: Using the Outputs section.
❓What is the purpose of the Resources section in a SAM template?
A: To define the AWS resources required by the application.
❓Can you specify multiple events for a single Lambda function in SAM?
A: Yes, multiple events can be defined under the Events property.
❓What does sam delete do?
A: Deletes the deployed stack from AWS.
❓Which resource type is used to define an S3 bucket in SAM?
A: AWS::S3::Bucket
❓How do you specify a REST API using AWS SAM?
A: Using the AWS::Serverless::Api resource type.
❓What is the AWSTemplateFormatVersion in SAM templates?
A: It specifies the version of the CloudFormation template format being used.
❓How do you define a deployment stage in SAM for API Gateway?
A: Using the AWS::ApiGateway::Stage resource.
❓How do you reference environment variables in your Lambda function code?
A: Using the os.environ object in Python or process.env in Node.js.
❓Which command lists all deployed stacks in SAM?
A: sam list stack
❓How can you debug a Lambda function locally using SAM CLI?
A: Using sam local invoke with debugging flags specific to the runtime.
🥷Enjoy your Learning and Please comment if you feel — any other similar questions we can add to this page..!
Thank you much for reading📍
“ Yours Love ( @lisireddy across all the platforms )