Hosting Multiple Domains with SSL on AWS Lightsail - amazon-web-services

Trying to host multiple applications on AWS Lightsail with https being allowable on all of them, but running into a problem. It appears as though the Lightsail load balancers only allow a single certificate to be active at one time. These sites are low-traffic so I would like to only have a single load balancer or ec2 instance for multiple domains that can support https on all of them. Does AWS provide a way to do this that integrates with Lighsail or what is the recommended approach?

You are correct that LightSail balancers only support 1 certificate, but that single certificate can support up to 10 domain names.
One of the domains is the "main" one and the other (up to) 9 are "alternate" domains and subdomains, but operationally it doesn't make any difference which one is the "main" one and which ones are alternates.
https://lightsail.aws.amazon.com/ls/docs/en/articles/add-alternate-domain-names-to-tls-ssl-certificate-https
Certificates are not editable, so if you already created one, you'll need to create a new one with all the domains, and attach it to the balancer.

Related

Do I need to upgrade our hosting plan if I just use it for domain but hosting the files on AWS?

The current setup was the application is load-balanced at AWS. The domain(www.Example.com) we are using is registered at GoDaddy.com.
My concern is that, do we need to upgrade our GoDaddy hosting even if the files are load-balance at AWS?
Let's say that we have had a 50K concurrent users.
Thanks for the insight in-advanced.
When you say "the application is load-balanced at AWS", it suggests that there is the following setup on AWS:
One or more Amazon EC2 instances running a web application, and
An Elastic Load Balancer that is directing incoming traffic to those instances
Your GoDaddy account probably has a Domain Name with a CNAME record that points to the DNS Name of the Load Balancer on AWS.
If this is true, then you do not need a "hosting plan" on GoDaddy, since it would just be managing your Domain Name. Scaling is not necessary for Domain Names.
Increasing the load would possibly require creating additional EC2 instances on AWS, but you might have an Auto Scaling group doing this for you automatically.
You should investigate what you actually have on GoDaddy and on AWS.

Subdomain DNS for different endpoints

I have a subdomain, api.example.com, that has 2 REST endpoints, endpoint1 and endpoint2, that ideally would be hosted on different servers (Think EC2 instances for example). Is there a way to configure the DNS record (I am using Amazon Route 53) such that api.example.com/endpoint1 and api.example.com/endpoint2 can each point to their own server? I don't think that is possible, but I just wanted to double check. If it is indeed not possible, is there another way to point the 2 endpoints to the different servers (ideally using AWS)?
You can't do this with DNS, but you can accomplish it with the Application Load Balancer.
Create an ALB, and point DNS at it.
Next, create two target groups, one for each endpoint, and deploy your instances (or autoscaling groups) to the appropriate target group.
The ALB will take care of the routing for you, and you can size and scale each endpoint fleet as needed.

Amazon Lightsail Subdomain Setup

I'm currently moving all of my hosting from a cheap shared hosting provider over to Amazon LightSail. Normally, when sending work over to clients for approval, I create a subdomain through my hosting provider's c-panel and upload the required files through FTP.
I am at a loss when it comes to setting up a subdomain through AWS Lightsail though. I've created a static IP and I've created the A record for the subdomain, but where do I put the directory that the files I want my client review for that subdomain sit and what IP address do I need to point the subdomain at?
AWS LightSail is different from shared hosting providers, where AWS provides Virtual Private Servers(VPS) with its own IP.
Generally VPS is for a single deployment of an application(e.g Single Wordpress Deployment per VPS). So it is recommended to get multiple VPS for your deployments unless your applications are really light weight and gets less traffic.
There is also a limit where you gets 2 VPS servers per AWS account by default. If you need more VPS, either you can send a support request to Amazon and increase the limit or use multiple AWS accounts (If you own the AWS accounts, you can setup consolidated billing)
In DNS setup, since its single application per VPS, you need to create a A record for each subdomain.
I had faced the same problem. I had used up 2 Lightsail instances per account as the other answer mentioned. I had no way to setup subdomain for another application I hosted on Elastic Beanstalk.
Solution is - Use Route53 & Create Hosted Zone there. Instead of creating DNS Zone in Lightsail. Then point A record to the Static IP of Lightsail.
Hope this solves your problem.

Can I use a single wildcard cert across many AWS elastic load balancers (ELB)?

Can I use a single wildcard cert across many AWS elastic load balancers (ELB)?
Each ELB is in a different AWS account. Or do I need a different cert for each ELB?
There's nothing stopping you from using a single wildcard cert in multiple ELBs, across multiple AWS accounts, and even across other types of servers outside AWS entirely. There is no technical limitation that would prevent this from working.
Note that AWS now provides SSL certificates for free, for use with ELBs and/or CloudFront.
No, you don’t need to purchase an individual certificate for each ELB. You will get multiple server licenses with wildcard certificate that you can apply the same certificate in different ELBs over different AWS accounts.

AWS: How to route to autoscaling group based on URL pattern?

Our app has independent clusters of boxes running on Amazon Web Services. I need to send http requests to different clusters based on the URL. For example, http://api.mydomain.com/foo should go to the "foo" cluster, and http://api.mydomain.com/bar should go to the "bar" cluster.
I don't see anything in the elastic load balancer or Route 53 that will do it.
(The obvious thing is to have separate subdomains, but that's difficult for this app. We want to stick with just the "api" subdomain because the cluster configuration may change in the future.)
What's the best approach?
That is not supported by the load balancer. Using subdomains does work if you want to use the existing load balancer.
If you need more features, you could configure your own using a software load balancer running on top of an ec2 instance. Not likely to be as cost effective however.
It is not possible using ELB. Use Netscaler EC2 or HAProxy EC2 in your AWS environment to achieve this. NetScaler is available in AWS marketplace.