Series links:
- Part 1/5 – Introduction
- Part 2/5 – Database Planning
- Part 3/5 – AWS Setup (you are here)
- Part 4/5 – Backend APIs
- Part 5/5 – Frontend
What
A light AWS setup to hold two things: your files (bills) and your data (transactions).
Why
- S3 is reliable and affordable for documents/photos.
- RDS PostgreSQL gives you a managed database without running servers.
How
S3 bucket for web hosting (public read)
- Create a bucket for the static site (e.g.,
my-expenses-web). - Make it public-read so the HTML/CSS/JS can be fetched by browsers.
- Optionally use CloudFront in front; with OAC you can keep the bucket private and still serve publicly via the CDN.
- Alternative hosts: Netlify, Vercel, or any simple web server.
- Create a bucket for the static site (e.g.,
S3 bucket for documents (private)
- Create a separate bucket for bills/receipts (e.g.,
my-expenses-docs). - Block public access. Do not expose this bucket directly.
- Files are only opened via the backend (temporary links or redirects).
- Optional: lifecycle rule to move older files to cheaper storage.
- Create a separate bucket for bills/receipts (e.g.,
PostgreSQL on RDS (or use your own Postgres)
- A small instance is enough to start.
- Create a database and run the two tables from Part 2.
IAM users/roles
- Backend role/user (documents bucket): allow only
s3:PutObject,s3:GetObject,s3:DeleteObject, ands3:ListBucketon the docs bucket (preferably scoped to a prefix). - Deployment user (web bucket): allow
s3:PutObjectands3:ListBucketon the web bucket to upload new site files. - If using CloudFront, also allow
cloudfront:CreateInvalidationfor your distribution. - Keep permissions limited to specific ARNs.
- Backend role/user (documents bucket): allow only
Networking & HTTPS
- Expose your backend over HTTPS (any domain or IP works).
- If you use a domain, add DNS (Route 53 or any registrar) and a certificate (ACM or your TLS setup).
Thoughts / Caveats
- Keep the documents/images bucket private and access it only via API; the web hosting bucket is public-read (or private behind CloudFront with OAC).
- Watch storage costs if you upload many large images—use lifecycle rules.
- Keep database and bucket in the same region for speed.
- Backups: enable RDS automated backups; consider bucket versioning for safety.