I'm a little unclear about what you're trying to do here.
If I follow correctly: Browser navigates to
firstexample.com (hosted on ALB/EC2) which then redirects to
secondexample.com (hosted on CloudFront/S3). You're looking for a way such that the browser doesn't see
secondexample.com once redirected but
By setting up (say)
static.firstexample.com on CloudFront you can then pull static content from any S3 bucket you like. Then the redirect would be to
static.firstexample.com. But you can't have the same hostname
firstexample.com used for both CloudFront and ALB - well, not without randomly sending browser to either location.
However, the subject of your question mentions Route 53. In this case, if you're hosting content on
firstexample.com you do need Route 53 in order to assign the "apex record" to a specific endpoint (ALB, CloudFront, whatever). If you were redirecting from
static.firstexample.com then an on-premises DNS will work fine. Naturally, my next question would be "why not use Route 53 given it is a fully managed and highly available service".
Virtual hosting an S3 bucket using Cloudfront + SSLasked 4 years ago
OAI or not OAI for serving a static website in S3 using CloudFrontasked 6 months ago
S3 static website domain not workingasked 2 months ago
403 Error with SSL Cloudfront Static S3 websiteAccepted Answerasked 3 years ago
Host S3 website with on-premises DNS server without Route53Accepted Answerasked 6 months ago
Static website in S3 not working with HTTPSasked 2 years ago
SSL certificate with S3 bucketasked 2 months ago
CloudFront + S3 static website hosting, issues with contact form submissionasked 3 months ago
S3 Static Website RoutingRules when using Cloudfront and a domain nameasked 3 years ago
Is it possible to map an S3 static website to a public static IP address?Accepted Answerasked 2 years ago