0
0
AWScloud~30 mins

Why serverless matters in AWS - See It in Action

Choose your learning style9 modes available
Why Serverless Matters
📖 Scenario: You are working for a small startup that wants to build a simple web application. The team wants to focus on writing code and not worry about managing servers or infrastructure. You will help them understand how to set up a serverless function on AWS to handle user requests.
🎯 Goal: Build a simple AWS Lambda function configuration using AWS CloudFormation that shows how serverless computing works and why it matters for developers who want to avoid managing servers.
📋 What You'll Learn
Create a CloudFormation template with a Lambda function resource
Add a configuration variable for the Lambda function runtime
Use the runtime variable in the Lambda function resource
Complete the template with a handler and role properties
💡 Why This Matters
🌍 Real World
Serverless computing lets developers focus on code without managing servers. This project shows how to define a serverless function on AWS using CloudFormation.
💼 Career
Understanding serverless infrastructure setup is key for cloud engineers and developers working with AWS Lambda and infrastructure as code.
Progress0 / 4 steps
1
Create the initial CloudFormation template structure
Create a CloudFormation template starting with AWSTemplateFormatVersion set to '2010-09-09' and an empty Resources section.
AWS
Need a hint?

Start with the basic CloudFormation template keys: AWSTemplateFormatVersion and Resources.

2
Add a configuration variable for Lambda runtime
Add a Parameters section with a parameter named LambdaRuntime of type String and default value python3.12.
AWS
Need a hint?

Use Parameters to define a variable for the Lambda runtime environment.

3
Add the Lambda function resource using the runtime parameter
Add a resource named MyLambdaFunction of type AWS::Lambda::Function inside Resources. Use !Ref LambdaRuntime for the Runtime property. Also add Handler set to index.handler and Role set to arn:aws:iam::123456789012:role/lambda-execution-role.
AWS
Need a hint?

Use the !Ref intrinsic function to refer to the LambdaRuntime parameter in the Lambda function's Runtime property.

4
Complete the CloudFormation template
Ensure the CloudFormation template is valid YAML with all sections properly indented and closed. The template should define AWSTemplateFormatVersion, Parameters with LambdaRuntime, and Resources with MyLambdaFunction using the runtime parameter, handler, and role.
AWS
Need a hint?

Check indentation and that all required properties are present for the Lambda function resource.