This project demonstrates how to deploy, secure, and automate a static website using AWS services — all within the AWS Free Tier. It showcases a complete DevOps-style workflow, from hosting and caching to CI/CD automation and security hardening.
.
├── index.html
├── style.css
├── 404.html
├── 403.html
├── Screen.png
├── Screenshot.png
├── Metrics.png
└── README.md
- Amazon S3 — Website hosting + versioning
- AWS CloudFront — Global CDN caching + HTTPS
- AWS Certificate Manager — SSL/TLS certificate for HTTPS
- AWS IAM — GitHub Actions deployment user with restricted permissions
- GitHub Actions — Automated CI/CD pipeline to S3 + CloudFront
- Amazon CloudWatch — Monitoring & alarms for distribution health
- AWS Cost Explorer (Free Tier) — Budget tracking
- AWS Response Headers Policy — Security hardening via HTTP headers
- Created an S3 bucket (
my-first-aws-site-aryan) - Uploaded website files (
index.html,style.css) - Configured static website hosting and tested public access
- Verified via:
http://my-first-aws-site-aryan.s3-website-us-east-1.amazonaws.com
- Connected S3 bucket to CloudFront for faster, secure global delivery
- Configured caching behavior and automatic invalidation
- Deployed the distribution successfully
- Final CloudFront URL:
https://d78vjzv8z61e6.cloudfront.net
- Enabled S3 access logs → separate logging bucket
- Configured CloudFront access logs for request tracking
- Set up CloudWatch metrics and alarms for status checks
- Email alerts enabled via SNS subscription
- Pinned CloudFront & CloudWatch to AWS Console favorites
- Created a dedicated IAM user (
github-deploy-user) with minimal permissions - Added AWS credentials as GitHub Secrets
- Automated website deployment via GitHub Actions on every push to
main - Automatic CloudFront invalidation for new updates
GitHub Actions workflow (.github/workflows/deploy.yml):
name: Deploy to S3 + CloudFront
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: us-east-1
- name: Sync files to S3
run: |
aws s3 sync . s3://my-first-aws-site-aryan --delete --exclude ".git/*" --exclude ".github/*"
- name: Create CloudFront cache invalidation
run: |
aws cloudfront create-invalidation \
--distribution-id E1IV4CZ586FDEG \
--paths "/*"-
Created custom 403.html and 404.html error pages
-
Configured CloudFront to use these pages for friendly responses
-
Added a custom Response Headers Policy for enhanced security:
Strict-Transport-Security: max-age=63072000; includeSubDomains; preloadX-Frame-Options: DENYX-Content-Type-Options: nosniffReferrer-Policy: same-originPermissions-Policy: geolocation=(), microphone=(), camera=()Content-Security-Policy: default-src 'self';
-
Verified via browser network tab → headers applied correctly
Current Website URL:
https://d78vjzv8z61e6.cloudfront.net
- Hosting static websites with S3 + CloudFront is simple yet powerful.
- Automating deployment pipelines with GitHub Actions improves workflow efficiency.
- CloudWatch monitoring ensures visibility, and proper IAM policies enhance security.
- Response header policies and error customization make a project feel production-ready.
- Add a custom domain via Route 53
- Implement Lambda@Edge or CloudFront Functions for lightweight logic
- Integrate AWS WAF for web attack filtering
- Add cost alerts via AWS Budgets for production scaling
Aryan Kapoor, AWS Cloud Foundations Project (Free Tier Version)

