Setup Multiple Custom Domains for Clients using AWS - amazon-web-services

I want to give my customers an option to put their website (HTML, CSS, PHP (optional) ) in a custom domain.
By default, customers will get a basic subdomain like: their-site.mydomain.com
If they upgraded to Pro, I wanted to give an option to use custom domain by adding A record or CNAME.
After some google research, I found that lot of companies are using Amazon AWS for this task. However after checking different article, I did not get any idea how this would work with amazon or any other server.
All stuff needs to be done from the my Application UI by customers. There should be atleast 100s or 1000s of domains. I wanted to redirect each of them to their own website.
Any Idea how this will work? Please add all details if possible.

Related

Implement e-commerce platform with Shopify/Hydrogen + ExpressJS + DynamoDB hosted on AWS

I would like to start a new e-commerce platform build with Shopify/Hydrogen (React) an I'm still not sure about the back-end side (maybe ExpressJS + DynamoDB).
The issue is that I want to host everything on AWS, I am new there and I don't really know in which direction should I go.
Basically the platform is created for selling fishing stuff but it should also support the drop-shipping context, where other companies can sell their own products there.
Can anyone help me with a path for achieving this? What are the right steps?
Regarding headless storefronts you have multiple options with hosting, starting from Gatsby Cloud, through Netlify, Vercel or Amazon Amplify in case you want to host it on AWS.
I will assume that "drop-shipping context" would mean you want to become a some sort of a marketplace? Where other merchants would list their products and upon purchase handle the shipping themselves? You can organize that through using free open-source CMS - Strapi in a manner where it acts as a PIM (product information management system), basically you will create users in admin panel and allow them to put products into CMS and then pull and publish them to Shopify storefront (through Admin API you can even create products and add them to an order on the fly), also through webhooks that Shopify trigger on the purchase event you will be able to send a notification to a dropshipper.
Regarding Hydrogen it's pretty early in the making so I would suggest to take a look on React-powered boilerplates out on Github and it will boost implementation speed significantly.

Can we have revisions URL use the custom domain in Google Cloud Run instead of the "assigned by GCP" URLs

We are web developers building a deployment preview service with Google Cloud Run. Not a lot of experience with this... ;-)
We have mapped a custom domain to the service and the problem is that when the developers are pushing revisions, GCP returns the revision URLs assigned by GCP, not revision URLs using the custom domain.
This is problematic for us because of the cross-origin, and the way we whitelist apps that can call our APIs, etc.
So my questions is: Is there a to have revisions URLs be subdomains of our custom domain or something like that?
Would like...
https://branch-name---service-name-123456.a.run.app
if possible to become something like...
https://branch-name---service-name-preview.customdomain.com

Google Cloud Run service url (discovery)

I am running several gcloud services which have assigned urls automatically in following format:
https://SERVICE_NAME-XXXXXXX-ew.a.run.app/
This is not particularly easy to work with and to pass these URLs to clients. Alternative is to use the custom domain, but this needs hardcoding subdomains within DNS records (as far as I understand) and I would like to avoid that and use the default URLs.
What is the best practice to work with these URLs? I can imagine keeping some mapping of service->URL and passing it to clients, but I would like to avoid reinventing the wheels.
Edit: I've released an external tool called runsd that lets you do this. Check it out: https://github.com/ahmetb/runsd
Thanks for this question! The "Service discovery by name" for Cloud Run is very much an active area of work. Though, there are no active timelines we can share yet.
You can see a prototype of me running this on Cloud Run here: https://twitter.com/ahmetb/status/1233147619834118144
APIs like Google Cloud Service Directory linked are geared more towards custom/DIY service discovery you might want to build to your RPC stack such as gRPC. It's more of a managed domain name directory, that you can integrate with your RPC.
If you are interested in participating an alpha for this feature in the future, drop me an email at ahmetb at google.
You can use a beta service Service Directory.
At service deployment
Create your service with a name and the URL as metadata
In your code
Request the service metadata with its name, and get the URL
Use the url
You can't use the endpoint feature of the service because your don't have IP/Port.
However, for now, there is client library and you have to use API directly.

Serve SPA from multiple Domains

I'm developing a SPA with html5 routes.
Ex: https://app.example.com/restaurants/<restaurantId>/menu etc
Basically the app creates dynamic websites for multiple restaurants, hosted at https://app.example.com/restaurants/<restaurantId>
The requirement is to allow the restaurant owners to host the site in their own domain name.
Ex: if the restaurantId of Example Pizza Shop is xxx
then www.examplepizza.com should serve the contents of https://app.example.com/restaurants/xxx along with all the sub-routes.
The project is hosted on firebase, I'm looking for ideas on how to achieve this (even if I have to use services outside firebase it's okay)
Thanks in advance.
Firebase Hosting is not well-suited to these kinds of multi-tenant use cases, and you'll find the same is true for most "platform-as-a-service" style hosting providers.
To host arbitrary custom domains, you'll need:
Dedicated IP addresses that customers can point their DNS providers to (A records).
A web server capable of dynamically changing what it serves based on the Host header of the incoming request.
An automated SSL certificate provisioning system to create certificates for each customer's custom domain.
This is generally a major undertaking and requires quite a bit of both general and specialized knowledge. I don't think Stack Overflow is going to be the right place to find a specific solution, but I hope this guides you on your journey.

Sitecore how to separating Authoring from Delivery

I am planning a Sitecore deployment, I was reading a "Separating Authoring from Delivery" http://www.awareweb.com/AwareBlog/ArchConsideration.aspx.
Do I need to install and configure Sitecore in both envioronments. In that case users can access Delivery/Sitecore and Authoring/Sitecore.
How can I actually seperate two websites? I am bit confused. Please help!
Dhanuka777, as mentioned by techphoria, you'll really have to start reading up on a lot of things before you'll be able to get more direct help.
That being said, this is the basics of what you're trying to achieve:
Delivery: This is a website running the sitecore web application, but it does not allow users to login to the Sitecore editing interface. It can only serve up the content to your extranet users.
Authoring: This is a website running the sitecore web application, but it allows users to login to the Sitecore editing interface. Extranet users cannot access it. This usually means it's running on a VM or server behind a firewall.
You will also need to look at how you want deploy your databases to support these two sites.