This repository contains two AWS Lambda functions as part of the Internshala assignment:
- Add Two Numbers Lambda Function
- Upload a File to S3 Lambda Function
This AWS Lambda function takes two numbers as input (num1
and num2
) and returns their sum.
- Go to AWS Console → Lambda → Create Function
- Choose Python 3.x as runtime
- Assign IAM Role with AWSLambdaBasicExecutionRole
- Paste code from
add_two_numbers_lambda.py
- Test with sample input:
{
"num1": 5,
"num2": 10
}
This AWS Lambda function uploads a file to an Amazon S3 bucket using base64 encoding.
- Create an S3 bucket
- Configure IAM permissions
- Create S3 bucket (e.g.,
my-lambda-bucket
) - Go to AWS Console → Lambda → Create Function
- Choose Python 3.x as runtime
- Assign IAM Role with AmazonS3FullAccess
- Test with sample input:
{
"file_name": "test.pdf",
"file_content": "BASE64_ENCODED_STRING"
}
For any issues, feel free to reach out.