Hosted a web application using Amazon S3 buckets with static website hosting and configured API Gateway to trigger Lambda functions for handling GET and POST requests, which interact with a DynamoDB database for data operations. Additionally, I set up CloudFront as a content delivery network (CDN) to serve the S3 content securely over HTTPS, ensuring both enhanced performance and security for the application.
![](https://private-user-images.githubusercontent.com/64123398/356433879-baa81f37-43ca-4855-8426-3929b1f5ba88.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5NzI4MzEsIm5iZiI6MTcyNTk3MjUzMSwicGF0aCI6Ii82NDEyMzM5OC8zNTY0MzM4NzktYmFhODFmMzctNDNjYS00ODU1LTg0MjYtMzkyOWIxZjViYTg4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDEyNDg1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ5MWQ2N2U1N2YwMTY5Mzg0NWRlZmJhYjUyMzQxODFhOTg2YjYzMzBlMTMxMjhjNzlhMTJiYzM3YmI1ZmI5NDUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.555EIV8haljD0XmnqhsFJ1qS4WI1fRrEno5nKQixghc)
We'll start by creating an Amazon S3 bucket to store and host the static files for our web application. This includes HTML, CSS, and JavaScript files that make up the frontend of our application. S3 will provide a scalable and reliable storage solution for serving these static assets.
![](https://private-user-images.githubusercontent.com/64123398/356049271-d4fe8598-76c3-4491-a8ee-c48b3e03ac54.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5NzI4MzEsIm5iZiI6MTcyNTk3MjUzMSwicGF0aCI6Ii82NDEyMzM5OC8zNTYwNDkyNzEtZDRmZTg1OTgtNzZjMy00NDkxLWE4ZWUtYzQ4YjNlMDNhYzU0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDEyNDg1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM5NWY2MDY4ZGZkNTdmZDU4OGI3MDUzMGU1YjM1OTRlMDIxMDc0ZmZmOGM4ODkxMTVhN2I2M2Y5NzM4MGQ3MWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.MsR4I2CIP1llfK2buU_FDUJYylpm5P1BqazPtF_D2Eg)
Next, we'll set up Amazon API Gateway to create and manage API endpoints that will interface with our Lambda functions. We'll configure both GET and POST methods to interact with a DynamoDB database, enabling the frontend to perform operations such as retrieving and submitting data.
![](https://private-user-images.githubusercontent.com/64123398/356049586-8f0a2ce1-2300-4ce0-9893-59a5146f3503.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5NzI4MzEsIm5iZiI6MTcyNTk3MjUzMSwicGF0aCI6Ii82NDEyMzM5OC8zNTYwNDk1ODYtOGYwYTJjZTEtMjMwMC00Y2UwLTk4OTMtNTlhNTE0NmYzNTAzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDEyNDg1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdjOGIwYTRiOGM5YzcxYjkzYTdiNGQ3NDM0MGM3ZTk1YjljMTU4ZWJjZWFlY2FjNThmY2VjNWU2ZjU1ZWU5ZTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.aympnhUEEPAyWCXBl0e_fyfL9UQdENoLeO-NA3V-hrg)
We'll develop AWS Lambda functions in Python to handle the API requests initiated by API Gateway. These functions will be responsible for interacting with the DynamoDB database, performing operations like retrieving data and inserting new entries based on the requests received.
![](https://private-user-images.githubusercontent.com/64123398/356049709-1fb0f5fd-40e8-4a01-a3ad-6b857fd14846.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5NzI4MzEsIm5iZiI6MTcyNTk3MjUzMSwicGF0aCI6Ii82NDEyMzM5OC8zNTYwNDk3MDktMWZiMGY1ZmQtNDBlOC00YTAxLWEzYWQtNmI4NTdmZDE0ODQ2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDEyNDg1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJjMTJiNDdhYjlmYzhkMTlmNmJjYzA1MTNhOTUwZjI1MTMwM2YxN2I0YWFkY2FlZDQ0M2QzNmNlMmMyOWRlNzQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.vg67d6v7YNF1qDQFLTFhlBKokR5giJPzc_sZ1p_swBU)
We’ll establish a DynamoDB table to store our application data. This involves defining the table schema (such as partition keys and attributes) and learning how to execute CRUD (Create, Read, Update, Delete) operations using the Lambda functions we’ve created. DynamoDB will serve as the backend database for storing and managing our data.
![](https://private-user-images.githubusercontent.com/64123398/356049814-4733e336-abe2-47fd-9c0e-1b69e7f14a19.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5NzI4MzEsIm5iZiI6MTcyNTk3MjUzMSwicGF0aCI6Ii82NDEyMzM5OC8zNTYwNDk4MTQtNDczM2UzMzYtYWJlMi00N2ZkLTljMGUtMWI2OWU3ZjE0YTE5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDEyNDg1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEwZDcwZDIxYjY3YWEzMzgyNWUzZGE2ZmY1NDU3M2JlZGYwZTkzMDUyOGUwOGRiYTExNmM3YjJjM2I1ZDk1NzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.WbV-guKAFxoIzFSdJva0DHQsYz8_aXWq5f6M0omLeuw)
To secure our web application and enhance its performance, we'll use Amazon CloudFront as a content delivery network (CDN). CloudFront will be configured to serve the content from our S3 bucket over HTTPS, ensuring encrypted connections and improving the loading speed of our website through distributed caching.
![](https://private-user-images.githubusercontent.com/64123398/356050097-2ffaaa6d-8306-4327-8280-f737abf67113.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5NzI4MzEsIm5iZiI6MTcyNTk3MjUzMSwicGF0aCI6Ii82NDEyMzM5OC8zNTYwNTAwOTctMmZmYWFhNmQtODMwNi00MzI3LTgyODAtZjczN2FiZjY3MTEzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDEyNDg1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA0OTk1NTg0MzQwODBhN2M3N2I1NzE4MWZlYjNmYTA4ZTQzZGMxMjFhNzZkYjViNzYyNGQ4ZWE5MjlhNGZhOGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.atbZvwzKOp7yhxxyhfSQu4OKh0qJzzRNPJyPK9oFfl0)
![](https://private-user-images.githubusercontent.com/64123398/356049863-7e7efd64-790b-45e9-afa5-4cd8504a3022.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9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