aws - how to access opsWorks app with ELB? - amazon-web-services

My app was easy deployed on 3 instances using OpsWorks. I can Access it using instance IP's fine.
My question is: how can I access it using load balancer?
ELB says all 3 instances are InService, but typing public DNS on browser, it loads forever and shows nothing.
Testing ELB public DNS on http://whatsmydns.com it shows IP's that aren't from my instances.
Am I doing something wrong?
I have added Public DNS to my app as hostname.

There are a couple things to check:
Check that your load balancer listeners are configured to listen
and pass traffic to the same port that the instance is listening on
(for example http traffic 80 => http 80, https traffic 443 => https
443)
Check that the security group of the webservers allows
traffic from the loadbalancer. Though if you can access your instances directly via browser, I'm guessing they are open to 0.0.0.0/0 so shouldn't be an issue here?
Check that security group of the load balancer allows access to public on all needed ports (typically 80 and 443)
Check that elb healthcheck is not failing (under elb
instances you can see if the instances are in service or not) If it
says "Out of service" that's the problem. You need to make sure that
healthcheck URL is accessible and returns 200.
The DNS of your load balancer is different from your instances - it returns the IP addresses of the instances that the load balancer is running on, AWS usually has at least 3 servers behind the scenes for that.

Related

How to add health check request ip to load balancer security group?

I face an issue in AWS Elastic BeanStalk health checking. I deployed to my NodeJS application to AWS via elastic beanstalk. Then I give permission my elastic load balancer TCP 443 port accessible for only my domain that is routed by Cloudflare. Basically, My elastic load balancer is only accessible by Cloudflare,
Due to the fact that I use Cloudflare, AWS health checks can not be able to access to the endpoint of the load balancer. How can fix this issue? I don't want to open my load balancer TCP 443 port to all world people. I want to open TCP 443 port for the only Cloudflare and, at the same time, I want to use health check of AWS :)
If somebody reads this question in the future, I thought that the health-check is being executed, externally - accessing publicly. But I have just learned that it was not :)). It is being executed directly internally. There is no problem related to Cloudflare or the security group or any other thing!
If there is an error in your ELB regarding this, the problem is probably related to your codebase, not the security group or other configurations.

How to create a http and https load balancer that will allow SSL pass to my instances

I am trying to create a load balancer on GCP that will route HTTP and HTTPS traffic to my single instance (I'm just testing things out so I have a single instance that serves http traffic).
My instance will be serving for many domains, and these domains are not owned by me but for my clients. I will simply manage the letsecrypt SSL certificates for these domains. They will point their domains to my service like a DNS record: service.example.com
Can I still use GCP load balancers for HTTPS traffic with the above considerations? I essentially need the load balancers to pass all SSL traffic to my instances.
I can't seem to figure out how to create a load balancer that will pass SSL traffic to my instances, is this possible?
If your goal is to create a load balancer that passes thru HTTPS traffic (and HTTP) directly to a backend instance(s), use the TCP Load Balancer.
Step 1. Create a "regional" static IP address before creating the load balancer. Create the IP address in the same region as your instance.
Step 2: Create a TCP Load Balancer. I will skip the minor details that are obvious.
Backend configuration:
Select Single region only. This will allow you to bypass having instance groups.
Select existing instances -> Select your vm.
Frontend configuration:
Protocol TCP. IP: select the static IP address that you created. Port: 80. Click Done.
Add another frontend. Protocol TCP. IP: same IP address. Port: 443. Click Done.
Once you create the load balancer, wait 5 or 10 minutes for everything to configure and startup.
Now your and HTTP and HTTPS traffic will be passed directly to your backend instance(s). Note that this configuration does not use autoscaling, managed instance groups, healthchecks, etc.
You will manage your SSL certificates on your backend instance(s) (your Compute Engine VMs). The load balancer just passes traffic thru with no SSL offload.

Where can I find my AWS Application Load Balancer IP?

I have setup an AWS Network Load Balancer no problem and I have a number of different services running on their assigned ports. This all works perfectly.
Then I was asked to host a number of different node apps on their own ports and are accessed via their own domains. After I realised I couldn't get this to work correctly on NLB I looked to Application Load Balancer and use Host-Based Routing rules.
app1.example.com
app2.example.com
What I did
I setup the application load balancer listener on https :443 and a Host-Based Routing rule that forwards app1.example.com traffic to a target group to watch 443 and send the traffic to the correct instance on port 3000. The security group is also setup to with port 3000 open.
So I thought.... all I had to do was add the load balancer IP to the subdomain A Records on the external domain registrar.... but I can't find the IP anywhere! I'm missing something fundamental here and AWS docs are killing me.
The above steps aren't too different from setting up a Network Load Balancer without the Host-Based Routing rules.
Could anyone point out where I can find the ALB IP or where am I'm going off track?
The Ip might change so better use an other option such as CNAME or A-record + Alias (the latter might save you some money, if I remember correctly).
(Route 53 setup)

How to connect to particular port by aws elb

I have two ec2 instances and deployed java apps to '/var/www/html'.
They are running in port 9010 and I can access them by 'http://xxxx:9010'.
Next,I created elb and added the two instances to it.However,I can't access the java app by elb public dns 'http:elbxxxxx:9010'. It returned 404.
I put index.html to '/var/www/html/' , I can see index.html by elb public dns.
I'm looking for some configurations for ports in elb console but I can't.
How can I access them?
You have to configure a listener on the Elastic Load Balancer. Your listener can be configured to listen on any port (such as 80) and send the requests to your instances on port 9010. Here's how to configure listeners.

Elastic load balancer - EC2s InService, but can't connect

Just getting an Elastic Load Balancer up for my application servers, and I'm having trouble connecting.
I placed 2 EC2 instances behind the load balancer, and both of them are successfully connected and InService, but putting the URL of the load balancer into Chrome never receives a response - it just hangs forever.
The ELB is placed under the security group where all incoming/outgoing is allowed.
Amazon's documentation assumes that something is wrong with your application servers, but they both work great, and the health checks are passing.
Help?
EDIT: Not using CNAME, guys. This is for a backend service, so I'm using the bare public DNS provided by AWS automatically. It's like:
http://api-load-balancer-XXXXXXXXX.us-west-1.elb.amazonaws.com/
And no, EC2 instances are also available to the internet gateway with a public url - One of these instances is currently being used for serving the application publicly, and it's working just fine for that. Just want some redundancy in case of failure, so I spun up another one.
Listeners is configured to only HTTP (port 80 on ELB, port 80 on instances).
I am pretty sure you just have to wait for 15-30 minutes before you will finally be able to resolve load balancer's IP address by DNS name. It happened to me when I was doing AWS tutorials.