From 6af5bfea314650bd663a5823d70281f993910bef Mon Sep 17 00:00:00 2001 From: Zablon <143833326+zablon-oigo@users.noreply.github.com> Date: Sat, 27 Jul 2024 16:18:16 +0300 Subject: [PATCH 1/5] README.md --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..2320dcd --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# Cloud Resume API with AWS +This project demonstrates a serverless architecture for a Resume API using AWS Lambda and DynamoDB. The Lambda function retrieves resume data from DynamoDB and returns it in JSON format. The setup incorporates GitHub Actions for automated deployment and Terraform Cloud for infrastructure management and resource provisioning. Additionally, a React frontend has been added to provide appealing visuals and an interactive user interface for displaying the resume data. + +### How It Works +- **API Gateway**: Routes requests to the AWS Lambda function. +- **AWS Lambda**: Executes the code to fetch resume data from DynamoDB. +- **DynamoDB**: Stores resume data in a structured format. +- **S3**: Hosts static assets (e.g., HTML, CSS, JavaScript) for the frontend. +- **CloudFront**: Caches and serves the frontend assets with low latency. + +### Features +- **Serverless API**: Utilizes AWS Lambda to handle API requests, eliminating the need for server management and scaling automatically with demand. +- **Resume Data Storage**: Stores and retrieves resume data from DynamoDB, ensuring high availability and performance. +- **Scalable Frontend**: Deploys the frontend static assets to S3 and leverages CloudFront to ensure fast and reliable delivery to users worldwide. +- **Infrastructure as Code**: Managed using Terraform for easy provisioning and management of the AWS resources + +### Tech Stack +- **AWS Lambda**: Provides a serverless compute service to run the API logic without managing servers. +- **DynamoDB**: A NoSQL database that stores the resume data in a scalable and highly available manner. +- **Terraform**: Infrastructure as Code (IaC) tool used to provision and manage AWS resources. +- **S3** (Amazon Simple Storage Service): Hosts the frontend static assets for the resume. +- **CloudFront**: Content Delivery Network (CDN) that caches and delivers the frontend assets globally with low latency. + +### Setup and Deployment +1. Define Infrastructure Using Terraform: + - Begin by configuring your AWS infrastructure with Terraform. Your Terraform configuration files, including main.tf, will define the necessary resources such as Lambda functions, DynamoDB tables, S3 buckets, and API Gateway. + - Review and edit **main.tf** to fit your infrastructure requirements. +2. Deploy with Terraform Cloud: + - Use Terraform Cloud for deploying your resources. Terraform Cloud provides a collaborative environment for running and managing your Terraform configurations. + - Connect your GitHub repository with Terraform Cloud to automatically manage your Terraform state file and trigger deployments. + - Configure Terraform Cloud to watch for changes in your GitHub repository. Terraform Cloud will automatically trigger runs and apply updates whenever there are changes to your Terraform configurations. + - Ensure your Terraform Cloud workspace is configured with the necessary AWS credentials and variables. +3. Sync Frontend Assets to S3: + - Configure your GitHub Actions workflow to automate the deployment of your static assets to an S3 bucket. This can be achieved by creating a GitHub Actions workflow that uses the AWS CLI to sync the contents of your React dist folder with your S3 bucket. + +4. Upload DynamoDB Items: + - Add another step in your GitHub Actions workflow to upload JSON data to DynamoDB. This ensures that the database is updated with the latest resume information as part of the continuous deployment process. +5. Deploy API: + - Make sure your API Gateway and Lambda function are correctly deployed and linked. This should be managed within your Terraform configuration, and any updates should be applied via Terraform Cloud. +6. Deploy React Application on S3 and Create CloudFront Distribution: + - Upload your React application's dist directory files to the S3 bucket. + - Create a CloudFront distribution to serve your static assets from the S3 bucket. Configure CloudFront to use the S3 bucket as the origin and set up the distribution settings according to your needs +### API Endpoints +To interact with the API use the following endpoint: +``` +https://tuipma3603.execute-api.eu-north-1.amazonaws.com/prod +``` +To fetch the resume data from the API, using **curl** command: +``` +curl -X GET https://tuipma3603.execute-api.eu-north-1.amazonaws.com/prod +``` From 06278949013f4acaa77944b98c68ff7b42a89837 Mon Sep 17 00:00:00 2001 From: Zablon <143833326+zablon-oigo@users.noreply.github.com> Date: Sat, 27 Jul 2024 16:26:22 +0300 Subject: [PATCH 2/5] README.md --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 2320dcd..21e7022 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # Cloud Resume API with AWS This project demonstrates a serverless architecture for a Resume API using AWS Lambda and DynamoDB. The Lambda function retrieves resume data from DynamoDB and returns it in JSON format. The setup incorporates GitHub Actions for automated deployment and Terraform Cloud for infrastructure management and resource provisioning. Additionally, a React frontend has been added to provide appealing visuals and an interactive user interface for displaying the resume data. +### Architecture Diagram +![resume](https://github.com/user-attachments/assets/cb8f162f-7af3-49fa-bf17-9be054d50e3c) + + ### How It Works - **API Gateway**: Routes requests to the AWS Lambda function. - **AWS Lambda**: Executes the code to fetch resume data from DynamoDB. @@ -49,3 +53,9 @@ To fetch the resume data from the API, using **curl** command: ``` curl -X GET https://tuipma3603.execute-api.eu-north-1.amazonaws.com/prod ``` +### Frontend Access +The frontend is served from S3 and cached by CloudFront, ensuring global availability and fast access +#### Demo +[ResumeTemplate](https://d1mnfk26f2dvgk.cloudfront.net/) +### Feedback +If you have any feedback, please [DM](https://www.linkedin.com/in/zablon-oigo-ba4268234/) me directly via **Linkedin** From b439b1de21af9f20bc937a39d7d5d0835834a558 Mon Sep 17 00:00:00 2001 From: Zablon <143833326+zablon-oigo@users.noreply.github.com> Date: Sat, 27 Jul 2024 16:36:39 +0300 Subject: [PATCH 3/5] README.md --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 21e7022..bca7ede 100644 --- a/README.md +++ b/README.md @@ -26,22 +26,23 @@ This project demonstrates a serverless architecture for a Resume API using AWS L - **CloudFront**: Content Delivery Network (CDN) that caches and delivers the frontend assets globally with low latency. ### Setup and Deployment -1. Define Infrastructure Using Terraform: - - Begin by configuring your AWS infrastructure with Terraform. Your Terraform configuration files, including main.tf, will define the necessary resources such as Lambda functions, DynamoDB tables, S3 buckets, and API Gateway. +1. **Define Infrastructure Using Terraform:** + - Begin by configuring your AWS infrastructure with Terraform. Your Terraform configuration files, including main.tf, will define the necessary resources such as Lambda functions, DynamoDB + tables, S3 buckets, and API Gateway. - Review and edit **main.tf** to fit your infrastructure requirements. -2. Deploy with Terraform Cloud: +2. **Deploy with Terraform Cloud:** - Use Terraform Cloud for deploying your resources. Terraform Cloud provides a collaborative environment for running and managing your Terraform configurations. - Connect your GitHub repository with Terraform Cloud to automatically manage your Terraform state file and trigger deployments. - Configure Terraform Cloud to watch for changes in your GitHub repository. Terraform Cloud will automatically trigger runs and apply updates whenever there are changes to your Terraform configurations. - Ensure your Terraform Cloud workspace is configured with the necessary AWS credentials and variables. -3. Sync Frontend Assets to S3: +3. **Sync Frontend Assets to S3:** - Configure your GitHub Actions workflow to automate the deployment of your static assets to an S3 bucket. This can be achieved by creating a GitHub Actions workflow that uses the AWS CLI to sync the contents of your React dist folder with your S3 bucket. -4. Upload DynamoDB Items: +4. **Upload DynamoDB Items:** - Add another step in your GitHub Actions workflow to upload JSON data to DynamoDB. This ensures that the database is updated with the latest resume information as part of the continuous deployment process. -5. Deploy API: +5. **Deploy API:** - Make sure your API Gateway and Lambda function are correctly deployed and linked. This should be managed within your Terraform configuration, and any updates should be applied via Terraform Cloud. -6. Deploy React Application on S3 and Create CloudFront Distribution: +6. **Deploy React Application on S3 and Create CloudFront Distribution:** - Upload your React application's dist directory files to the S3 bucket. - Create a CloudFront distribution to serve your static assets from the S3 bucket. Configure CloudFront to use the S3 bucket as the origin and set up the distribution settings according to your needs ### API Endpoints From d7966aa6703139256f2758232743743ced46ae80 Mon Sep 17 00:00:00 2001 From: Zablon <143833326+zablon-oigo@users.noreply.github.com> Date: Sat, 27 Jul 2024 16:58:50 +0300 Subject: [PATCH 4/5] README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bca7ede..0d7d6c1 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,10 @@ This project demonstrates a serverless architecture for a Resume API using AWS L ### How It Works - **API Gateway**: Routes requests to the AWS Lambda function. -- **AWS Lambda**: Executes the code to fetch resume data from DynamoDB. -- **DynamoDB**: Stores resume data in a structured format. -- **S3**: Hosts static assets (e.g., HTML, CSS, JavaScript) for the frontend. -- **CloudFront**: Caches and serves the frontend assets with low latency. +- **AWS Lambda**: Executes serverless code to fetch resume data from DynamoDB based on the provided ID, and returns it in JSON format. +- **DynamoDB**: A NoSQL database that stores and organizes resume data in a structured format for efficient retrieval by the Lambda function. +- **S3**: Hosts static assets created with React for the frontend. These assets interact with the API Gateway to fetch and display resume data. +- **CloudFront**: Distributes and caches the static frontend assets from the S3 bucket, providing low-latency access and improving the overall performance of the website. ### Features - **Serverless API**: Utilizes AWS Lambda to handle API requests, eliminating the need for server management and scaling automatically with demand. From d77cb010b8ed10dedcae2663857929f6fa9f0a43 Mon Sep 17 00:00:00 2001 From: Zablon <143833326+zablon-oigo@users.noreply.github.com> Date: Sun, 28 Jul 2024 08:42:37 +0300 Subject: [PATCH 5/5] README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0d7d6c1..a7f2223 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Cloud Resume API with AWS -This project demonstrates a serverless architecture for a Resume API using AWS Lambda and DynamoDB. The Lambda function retrieves resume data from DynamoDB and returns it in JSON format. The setup incorporates GitHub Actions for automated deployment and Terraform Cloud for infrastructure management and resource provisioning. Additionally, a React frontend has been added to provide appealing visuals and an interactive user interface for displaying the resume data. +This project demonstrates a serverless architecture for a Resume API using AWS Lambda and DynamoDB. The Lambda function retrieves resume data from DynamoDB and returns it in JSON format. The setup incorporates GitHub Actions for automated deployment and Terraform Cloud for infrastructure management and resource provisioning. Additionally, I have added a React frontend to provide appealing visuals and an interactive user interface for displaying the resume data. ### Architecture Diagram ![resume](https://github.com/user-attachments/assets/cb8f162f-7af3-49fa-bf17-9be054d50e3c) @@ -59,4 +59,8 @@ The frontend is served from S3 and cached by CloudFront, ensuring global availab #### Demo [ResumeTemplate](https://d1mnfk26f2dvgk.cloudfront.net/) ### Feedback -If you have any feedback, please [DM](https://www.linkedin.com/in/zablon-oigo-ba4268234/) me directly via **Linkedin** +If you have any feedback, please [DM](https://www.linkedin.com/in/zablon-oigo-ba4268234/) me directly on **Linkedin** +### Blog Post +read more here : [Blog](https://dev.to/zablonoigo/transform-your-cloud-skills-a-hands-on-guide-to-building-a-serverless-resume-application-4i7d) +### Cloud Resume API Challenge +This repository contains a complete solution for the [AWS Resume API Challenge](https://cloudresumeapi.dev/aws/), created by [Rishab Kumar](https://github.com/rishabkumar7). It features an API hosted on AWS that serves resume data in JSON format.