AWS Design Question.
We have 'n' number of static React JS website to host. Since we have more than 100 website at the moment ( it will keep growing ), we planned to host the website in s3 bucket.
we cannot create s3 bucket for each new website and create an cloud front for each bucket.
so we decided to put all the websites in a single bucket with each website in a individual folder, and mount the s3 bucket in a ec2 linux instance apache folder i.e. /var/www and make necessary configuration (including SSL).
so presently, we have a domain(self-managed) e.g 'sample.net' -> pointing to the ec2 instance apache server.
To access a website called 'sample-website' -> www.sample.net/sample-website apache will server me the website from the bucket which has the folder called sample-website.
Presently we have a another domain called 'sample.com' in Route53, we would like to create sub-domain (CNAME record) in run-time and set the value to www.sample.net/sample-website.
I have written code in python using boto3 to create CNAME record in runtime.
Two Questions based on the design:
1 - Can we have SSL for 'sample.com'? as we have SSL certificate for 'sample.net'
2 - Is there a better way to do it?
P.S:
