This section covers Steps 16–18: configuring CloudFront as an HTTPS proxy for the Backend API, deploying the React frontend on AWS Amplify, and mapping a custom domain with Route 53.
CloudFront acts as the public HTTPS gateway for the Backend API.
Console: CloudFront → Create distribution
| Field | Value |
|---|---|
| Distribution name | smartinvoice-backend-proxy |
| Distribution type | Single website or app |
| Field | Value |
|---|---|
| Origin type | Elastic Load Balancer |
| Origin domain | DNS Name of the EB ALB (e.g. awseb-e-m-AWSEBLoa-xxxx.ap-southeast-1.elb.amazonaws.com) |
| Protocol | HTTP only, HTTP Port: 80 |

| Field | Value |
|---|---|
| Viewer protocol policy | Redirect HTTP to HTTPS |
| Allowed HTTP methods | GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE |
| Cache policy | CachingDisabled |
| Origin request policy | AllViewerExceptHostHeader |
| Response headers policy | CORS-With-Preflight |

→ Click Create distribution and wait ~5 minutes for deployment.
→ Note down the CloudFront domain (e.g. https://d3xxxx.cloudfront.net) — you will use this as the API URL for the frontend.
tuankiet18-dev/SMARTINVOICE-SHIELD, select branch main.
Amplify auto-detects Vite. Verify under App settings → Build settings:

Console: App settings → Environment variables → Add:
| Key | Value |
|---|---|
VITE_API_URL | CloudFront domain from Step 16 (e.g. https://d3xxxx.cloudfront.net/api) |

→ After deployment, copy the Amplify URL and update SSM parameter ALLOWED_ORIGINS.
After deploying the frontend on Amplify, you can optionally map a custom domain.