Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
23 views
in Information Technology by (117k points)
What is AWS Lambda, and how can I deploy a function using the AWS CLI?

Please log in or register to answer this question.

1 Answer

0 votes
by (117k points)

AWS Lambda allows you to run code without provisioning or managing servers. Here's an example Python Lambda function:

import json

def lambda_handler(event, context):
    return {
        'statusCode': 200,
        'body': json.dumps('Hello from Lambda!')
    }
 

To deploy this function using the AWS CLI:

aws lambda create-function \
    --function-name my-function \
    --runtime python3.8 \
    --role arn:aws:iam::123456789012:role/service-role/MyLambdaRole \
    --handler lambda_function.lambda_handler \
    --code S3Bucket=my-bucket-name,S3Key=my-function-code.zip
 

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...