This repo contains my solution for cloud resume api challenge using AWS Cloud and Google Cloud Platform.
- Web server: Node.js
- Serverless Service: AWS Lambda, GCP Cloud Functions
- Database: AWS Dynamo DB, GCP Cloud Firestore
- Nodejs version: v20.14.0 LTS
- CI: Github Actions
![image](https://private-user-images.githubusercontent.com/37110560/347778184-d727e75b-4a0f-4def-a909-e9d500833643.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU2MDIzODMsIm5iZiI6MTcyNTYwMjA4MywicGF0aCI6Ii8zNzExMDU2MC8zNDc3NzgxODQtZDcyN2U3NWItNGEwZi00ZGVmLWE5MDktZTlkNTAwODMzNjQzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA2VDA1NTQ0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZmM2JhYTI1NDYxOGFiZThiMzhmNzRhNDUxM2FmYjgzZDJlOTQwNDA1YWU0M2IyNjk4MjQ5NTU3ZTEzZjhlZTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.HnHnRqdOMxg2P3-nkglAgnlF7-Orv92BEfFiKeilNMU)
- The way I implemented the solution for this challenge is by setting up an HTTP API using API Gateway which will trigger the Lambda function to get the data from Dynamo DB.
- We have to create an IAM Lambda execution role and attach it to the lambda function which allows our function runtime to interact with Dynamo DB to the get the data.
- Users can access the API Gateway endpoint(https) deployment link which will trigger the lambda function to get the resume data from dynamoDB
- Use this schema for customising your resume.
- Resume api endpoint: get-my-resume
Finally after a bit of delay, I have implemented the GCP solution for this challenge.
I wanted to implement multi-cloud solution to learn another cloud provider by transferring knowledge which I have already gained with AWS and to know the pros and cons of GCP and AWS.
![image](https://private-user-images.githubusercontent.com/37110560/353826411-f0bdff57-b8ab-4915-93de-7b47756e9046.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU2MDIzODMsIm5iZiI6MTcyNTYwMjA4MywicGF0aCI6Ii8zNzExMDU2MC8zNTM4MjY0MTEtZjBiZGZmNTctYjhhYi00OTE1LTkzZGUtN2I0Nzc1NmU5MDQ2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA2VDA1NTQ0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZjNGZmN2U0ZTQwMTJiMjIxZGJmZGY5NmE5NDA4ZmMwY2E0ZjRiYTY3MTc1MDJjODZlYjFmZTQ1YjI5YjBkOWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.J14VxZxf-SCdeR5fs1C2dtmUvKQbcMIRFI9uFN0DJzs)
- The way I implemented the solution for this challenge is by setting up an HTTP public GCP Cloud function using node.js which will fetch the data from Firestore
- We have to create a service account with very minimal permissions to make Cloud Function communicate with Cloud Firestore DB; the following are the permissions to accomplish the task:
Cloud Functions Admin Cloud Run Invoker Firebase Admin
- Make sure you provide only
read-only-access
for the Firestore DB to avoid public write access
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read: if true;
allow write: if false;
}
}
}
- Users can access the Cloud Function with the functions URL: get-my-resume
- Use this schema for customising your resume.