This repository contains a simple AWS Lambda function for fetching and storing web page data in an S3 bucket. Additionally, the lambda-build
tool from alexkrkn's repository is utilized for deployment from local to AWS.
- Fetches HTML content from a specified URL.
- Extracts the title of the web page.
- Stores the HTML content in an AWS S3 bucket.
- AWS Lambda
- Node.js
- The Lambda function is triggered with an event containing
url
andname
parameters. - The
handler
function processes the event and performs the fetching and storing operations.
- Tests are written using Jest.
- Mocks are used for testing network requests and AWS S3 interactions.
- To run tests:
npm test
- Uses
lambda-build
for deploying the Lambda function to AWS from the local environment. - Run
npm run deploy
to deploy usinglambda-build
.
- AWS SDK for JavaScript (v3)
- Axios for HTTP requests
- Cheerio for HTML parsing
lambda-build
for deployment
- Ensure AWS credentials are configured.
- Install dependencies:
npm install
- Deploy the function to AWS Lambda using
lambda-build
:npm run deploy
- Ensure proper configuration of AWS S3 bucket and access permissions.
- The Lambda function should have necessary permissions to access S3.