How to allocate Elastic IP to ALB in AWS? - amazon-web-services

I am new to AWS and web development in general. I have React JS and Spring Boot website and am trying to attach Elastic IPs to my application load balancers using terraform. I am unable to figure out as how to get an elastic IP and then attach it to my load balancers. As I have two services in my cluster would I need two separate elastic IPs or would one do?
How do we attach those IPs to the load balancers in terraform?

Related

Elastic Load Balancer (Elastic Beanstalk) vs NGINIX

I am pretty new to AWS deployment (please send any helpful guides). And I read that it comes with an elastic load balancer but I've also heard that a lot of people put NGINX on an EC2 to use as a load balancer.
Do people commonly use either or? Having two seems redundant.
Nginx on an EC2 instance for load balancing would be a single point of failure, if the EC2 instance went down your app would be down. An AWS Load Balancer is actually multiple load balancer nodes distributed across multiple AWS availability zones to provide high availability. The EC2 instance would also be something for you to have to manage, where an AWS Load Balancer is managed for you by Amazon.
You mention Elastic Beanstalk in your question title. Elastic Beanstalk will use both. It uses a Load Balancer for distributing traffic across multiple instances, and it uses Nginx on each instance as a reverse proxy to your application.

Where to Place AWS ELB for Splunk deployment

I have questions around AWS ELB for splunk deployment , I am building an enterprise deployment for Splunk on AWS. My question is which type of ELB should I select and in which all subnets I should place an ELB?
Use an Application Load Balancer (ALB) - its newer than the "Classic" Elastic Load Balencer (ELB) - but both should work.
When creating a ELB or ALB there's no harm in selecting all Availability Zones within the region even if you only plan to deploy instances to some of the available AZ's.

How to add GCP instances to AWS load balancer?

Majority of my servers are on AWS for which I am using classic load balancer. I have few instances running on GCP too. How to add those GCP instances to AWS load balancer?
You cannot with the Classic Load Balancer. You can with the new Network Load Balancer provided that your Google instances are reachable via public IP addresses.
[EDIT after #michael's comment]
I have not actually tested NLB with Google instances. From the Amazon documentation you can load balance Amazon resources with on premises resources using IP addresses. I am assuming that this means that Google instances would be supported if they have public IP address.
Relevant text:
Load Balancing using IP addresses as Targets
You can load balance any application hosted in AWS or on-premises using IP addresses of the application backends as targets. This allows load balancing to an application backend hosted on any IP address and any interface on an instance. Each application hosted on the same instance can have an associated security group and use the same port. You can also use IP addresses as targets to load balance applications hosted in on-premises locations (over a Direct Connect connection) and EC2-Classic (using ClassicLink). The ability to load balance across AWS and on-prem resources helps you migrate-to-cloud, burst-to-cloud or failover-to-cloud.
Load Balancing using IP addresses as Targets

Attach ELB instance to "Application Load Balancer"

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.

AWS Elastic Beanstalk - add load balancer to app retroactively

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