Force a 404 With a CloudFront Function (Always)
Need everything behind a CloudFront distribution to return “Not Found” instantly—without touching your origin? Here’s a tiny CloudFront Function you can attach at Viewer Request to short-circuit all traffic and consistently respond with a 404 (plus no-cache headers).