| Component | AWS Service |
|---|---|
| DNS & CDN | Route 53, CloudFront |
| Frontend | HTML, CSS, JavaScript |
| Backend API | API Gateway, AWS Lambda (Python) |
| Data Storage | DynamoDB |
| Static Hosting | S3 |
| IaC | Terraform |
This guide assumes you have the AWS CLI configured and Terraform installed locally.
- An AWS account with appropriate permissions.
- Terraform installed locally.
- AWS CLI configured with your access keys (or IAM role for assumed access).
Create the necessary variables file for your deployment.
- Navigate to the
./terraform/directory. - Create the file
terraform.tfvars. - Populate this file using the structure provided in
./terraform/exampletfvars.txt.
Navigate to the Terraform directory and execute the following commands:
cd terraform
terraform init
terraform plan
terraform applyTerraform Output
api_endpoint # use this to set up your config.js file in step 3
cloudfront_domain_name
website_url
- Navigate to the
./webpagedirectory. - Create a file named
config.jsand add the following line
const API_ENDPOINT = "YOUR_API_ENDPOINT_FROM_TERRAFORM";Note: You may need to invalidate the Cloudfront Cache if you want to see your webpage update immediately
lambda/: Contains the Python code and necessary dependencies for the AWS Lambda function(s).terraform/: Contains all Infrastructure as Code (IaC) files:backend.tf: Defines the API Gateway and Lambda setup.database.tf: Defines the DynamoDB table structure.DNS.tf: Defines the Route 53 domain and CloudFront distribution.main.tf: Provider specifications, variable declarations.output.tf: Defines the variables printed after deployment.storage.tf: Defines the S3 bucket configuration for static website hosting.terraform.tfvars: (Not included) Your private variable values.
webpage/: Contains the static files (HTML, CSS, JavaScript) that constitute the frontend portfolio website.