I got a new domain and want to change my Elastic Beanstalk app name from domain-name.elasticbeanstalk.com to www.domain-name.com. When I created the EB app, I chose Single Instance.
I followed these instructions to set up the domain. I selected my load balancer, but my domain seems to map to another app I have. This seems to be because I only created one load balancer with another EB app, and not the current app I am trying to map the domain to.
My questions are:
1) How can I use the single load balancer (associated with a different app) to point the domain correctly? This is probably not possible.
2) How can I retroactively add a load balancer to an existing EB app? Or do I have to recreate the EB app and add the Load Balancer at that point?
From the two options you provided, I will suggest to use the second option.
EB = Elastic Beanstalk
ELB = Elastic Load Balancer
Follow the below steps.
Launch a ELB in AWS Console. If your EB instance is in a VPC then launch the ELB in the same VPC.
When you are launching the ELB attach the EB instance to that load balancer.
Then you can point your domain www.domain-name.com to that ELB using Route 53.
Or you can change your environment type from single instance to Load Balancing Environment. In this case, check below user Guide:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-types.html?icmpid=docs_elasticbeanstalk_console
Related
I am trying to add a simple HTTP to HTTPS redirect using AWS Application Load Balancer but it seems that all tutorials are out to date:
https://aws.amazon.com/premiumsupport/knowledge-center/elb-redirect-http-to-https-using-alb/
https://docs.amazonaws.cn/en_us/elasticbeanstalk/latest/dg/configuring-https-elb.html
I didn't see any option to add Rules under the load balance console, I also checked for this option on AWS CDK and haven't find anything.
The Load Balancer was created by an Elastic Beanstalk app, so I assume that it's an Application Load Balance.
I've seen a lot of tutorials and remind myself of doing same thing last year but now I don't see any option to set rules/redirects using the new AWS Console.
Redirecting EC2 Elastic Load Balancer from HTTP to HTTPS
This is the only option I am seeing available at the console under listener sections:
The Load Balancer was created by an Elastic Beanstalk app, so I assume that it's an Application Load Balance
Actually, it's a Classic load balancer. You can tell because the listener config specifies the load balancer point and the instance port. For an Application load balancer, the instance configuration is part of the target group.
So, turns out that ELB allows setting Load balance type only at the creation time. In my case, I created my stack as a single instance and add a load balance latter, so AWS automatically sets the default load balancer as the CLASSIC one instead of the application load balance (where we can use targets, rules, etc).
So I had to recreate my environment setting the correct load balancer type.
Questions
How to attach Elastic Beanstalk instance to Application Load Balancer (ALB)?
Why is ALB ignored and AWS creates a new Classic LB?
The AWS Elastic Beanstalk Configuring an Application Load Balancer documentation says:
You can set the load balancer type only during environment creation using the EB CLI, the Elastic Beanstalk APIs, or using .ebextensions like the one in the example .ebextensions/application-load-balancer.config; the console does not support this functionality.
Im trying to enable https on my Elastic Beanstalk application and it looks like I need to have a Load Balancer.
In my EB settings, I do have a autos calling balancer
In the docs show a different page on how to create a load balancer
This configuration setting doesn't show up anymore in the elastic beanstalk settings.
I've also looked into creating a load balancer from the EC2 instance page, and attached this load balancer to my EB, created a security group that supports http and https and haven't been able to get it to work
SO my question is, what is the correct way to enable https
Attached is our beanstalk configuration console, you should be able to turn on secure listener port as well.
Check with Section "To turn on the secure listener port" in AWS doc reference
I want to use websockets and SSL. Therefore I cannot use the default Elastic Beanstalk load balancer. I understand that Amazon has recently released an "Application Load Balancer" that supports websockets.
How do I configure my Elastic Beanstalk application to use this new type of load balancer?
Application Load Balancer can be used with Elastic Beanstalk now:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-applicationloadbalancer.html
In order to used it your environment must meet the following requirements:
"must be in a default or custom VPC, and must have a service role with the standard set of permissions"
However when creating an environment via AWS console I haven't managed to find how to choose Application Load Balancer instead of a classic one. It has still the same option - "Load Balancer" to choose and when checked, it creates a classic Load Balancer. The only way I did managed to create an environment with Application Load Balancer is via aws eb cli as specified in the doc above:
$ eb create test-env --elb-type application
This will create Application Load Balancer. Then you will only need to configure it according your needs.
I have the following situation:
I have 1 Rails App that has 2 domains, each of these domains has multiple/dynamical subdomains.
This app is in AWS using a load-balanced Elastic Beanstalk.
What i need is that those 2 domains that points to my single Rails App to work under SSL in port 443.
But since Elastic Beanstalk has only one load balancer, I can only use one single SSL certificate on port 433 :(
Using a UCC SSL certificate won't be the solution because i need each domain certificate to be wildcard, so the dynamic subdomains will also work.
Any thoughts about how to get multiple Load Balancers playing nicely with an Elastic Beanstalk Environment?
Best.
To add multiple Elastic Load Balancers (ELB) to an Elastic Beanstalk (EB) application, you need to add the additional ELB to the auto scaling group of the EB app.
On the command line
The easiest way to achieve this is through the AWS CLI (https://aws.amazon.com/cli/):
aws autoscaling attach-load-balancers --auto-scaling-group-name <SG_NAME> --load-balancer-names <ELB_NAME>
In the AWS Console
Of course this can be done in the AWS Console, too:
Go to EC2 > Auto Scaling > Auto Scaling Groups
select the group you want to add the elb to
Select the Details Tab
Edit-Button on the top right
Use the Autocompletion in the Load Balancers field to add your load balancer
Save
For your convenience, you can see where you need to click for all of the 5 steps (don't forget to save!)
For me this works also on eb-generated auto scaling groups (Region: eu-central-1).
This might not have been available at the time of the question, but it is now.
It's a tough one with Elastic Beanstalk as they have a cookie cutter way of deploying your app and if it's not in their options then you have either "hack it" or just go with a completely different solution using EC2 or plain cloud servers.
One thing you can try is creating another ELB with the certificate of the second domain (and subdomains) and point it to your Elastic Beanstalk Instance. If you go to the ELB console you should be able to see the ELB for the first domain. Then, you can create your second domain based on the first domain.
Hope it helps.
I think that the best solution for your problem is to have multiple domains on the same SSL certificate and then assign that certificate to your ELB environment.
(you can have wildcards, maybe that wasn't available at the time the question was asked)
You don't need extra load balancers.
This worked for me,
First, create the load balancer
aws elb create-load-balancer --load-balancer-name my-load-balancer --listeners "Protocol=HTTP,LoadBalancerPort=80,InstanceProtocol=HTTP,InstancePort=80" "Protocol=HTTPS,LoadBalancerPort=443,InstanceProtocol=HTTP,InstancePort=80,SSLCertificateId=arn-of-certificate" --subnets eb-subnet-of-primary-elb --security-groups sg-of-primary-elb
Then, attach load balancer to primary auto scaling group of EB env
aws autoscaling attach-load-balancers --auto-scaling-group-name asg-name-of-primary-asg-in-eb --load-balancer-names my-load-balancer
One more thing to be aware of is that EBS created instances need to allow your custom ELB to talk to them.
You need to create INBOUND rule in your EBS auto-created security group (with description SecurityGroup for ElasticBeanstalk environment) to allow TCP:80 access. I had my custom ELBs in a different security group so I specified that sg-**** ID as the source.