Friday, March 24, 2023

steps to AWS - Redirect traffic from domain name to ELB using Route 53.

 steps to redirect traffic from a domain name to an Elastic Load Balancer (ELB) using Route 53 in AWS:

  1. Log in to your AWS Management Console.
  2. Navigate to the Route 53 Dashboard.
  3. Select "Hosted zones" from the sidebar menu.
  4. Choose the domain name you want to redirect traffic for.
  5. Click on "Create Record Set".
  6. Choose "Alias" for the record type.
  7. Choose the appropriate ELB from the drop-down list under "Alias Target".
  8. Click on "Create".
  9. Review the changes and click on "Create Record Set".
  10. Test the configuration by visiting the domain name in a web browser.

Once you've completed these steps, traffic to the domain name will be automatically redirected to the ELB. You can use the AWS Management Console to monitor and modify your Route 53 settings as needed. Additionally, you can use features like health checks to ensure that your ELB is properly routing traffic to your instances.

steps to integrate an Elastic Load Balancer (ELB) with an Auto Scaling group in AWS:

 steps to integrate an Elastic Load Balancer (ELB) with an Auto Scaling group in AWS:

  1. Log in to your AWS Management Console.
  2. Navigate to the EC2 Dashboard.
  3. Select "Auto Scaling Groups" from the sidebar menu.
  4. Select the Auto Scaling group you want to integrate with an ELB.
  5. Click on the "Edit" button in the top menu bar.
  6. Under "Load balancing", select "Add ELB".
  7. Choose the ELB you want to associate with your Auto Scaling group.
  8. Configure the health check settings to ensure that your instances are healthy before sending traffic to them.
  9. Configure the listener settings to specify the port and protocol that the ELB should use to route traffic to your instances.
  10. Choose a target group for your instances.
  11. Review your settings and click "Save" to apply them.

Once you've integrated your ELB with your Auto Scaling group, your instances will automatically register with the ELB and receive traffic based on the load balancing settings you've configured. You can use the AWS Management Console to monitor and modify your ELB and Auto Scaling group settings as needed. Additionally, you can use features like CloudWatch alarms to monitor and alert you when your instances or ELB are experiencing issues.

Steps to AWS Creating and configuring an auto-scaling group

 Here are the steps to create and configure an Auto Scaling group in AWS:

  1. Log in to your AWS Management Console.
  2. Navigate to the EC2 Dashboard.
  3. Select "Auto Scaling Groups" from the sidebar menu.
  4. Click on the "Create Auto Scaling group" button.
  5. Choose a name for your Auto Scaling group and select the availability zones you want it to operate in.
  6. Configure the launch configuration, including the Amazon Machine Image (AMI) you want to use, instance type, and any additional settings.
  7. Specify the minimum, maximum, and desired number of instances in your Auto Scaling group.
  8. Configure scaling policies to automatically adjust the number of instances based on factors like CPU utilization, network traffic, or custom metrics.
  9. Configure notifications to receive alerts when your Auto Scaling group scales up or down.
  10. Add any necessary security groups to your instances to restrict access to them.
  11. Review your Auto Scaling group settings and click "Create Auto Scaling group" to launch it.

Once you've created your Auto Scaling group, it will automatically launch instances and adjust the number of instances based on the scaling policies you've configured.

You can use the AWS Management Console to monitor and modify your Auto Scaling group as needed.

Additionally, you can use features like lifecycle hooks to customize the instance launch and termination process.

steps to AWS - Creating an Application ELB

 Here are the steps to create an Application Load Balancer in AWS:

  1. Log in to your AWS Management Console.
  2. Navigate to the EC2 Dashboard.
  3. Select "Load Balancers" from the sidebar menu.
  4. Click on the "Create Load Balancer" button.
  5. Select "Application Load Balancer" from the options provided.
  6. Choose a name for your load balancer and select the availability zones you want it to operate in.
  7. Configure the listener settings, including the protocol and port you want your load balancer to use.
  8. Create a target group to specify the instances that your load balancer will send traffic to.
  9. Configure health checks to ensure that the load balancer only sends traffic to healthy instances.
  10. Add any necessary security groups to your load balancer to restrict access to it.
  11. Review your load balancer settings and click "Create" to launch it.

Once you've created your Application Load Balancer, you can use its DNS name to distribute traffic to your instances.

You can also use the AWS Management Console to manage and modify your load balancer as needed. Additionally, you can use features like path-based routing, host-based routing, and URL-based routing to further customize how traffic is distributed to your instances.

steps to AWS - Creating a Classic ELB

steps to create a Classic Load Balancer in AWS:

  1. Log in to your AWS Management Console.
  2. Navigate to the EC2 Dashboard.
  3. Select "Load Balancers" from the sidebar menu.
  4. Click on the "Create Load Balancer" button.
  5. Select "Classic Load Balancer" from the options provided.
  6. Choose a name for your load balancer and select the availability zones you want it to operate in.
  7. Configure the listener settings, including the protocol and port you want your load balancer to use.
  8. Select the instances that you want your load balancer to distribute traffic to.
  9. Configure health checks to ensure that the load balancer only sends traffic to healthy instances.
  10. Add any necessary security groups to your load balancer to restrict access to it.
  11. Review your load balancer settings and click "Create" to launch it.

Once you've created your Classic Load Balancer, you can use its DNS name to distribute traffic to your instances.

You can also use the AWS Management Console to manage and modify your load balancer as needed.

AWS Routing policy, Route 53 terminologies, Pricing.

 AWS Routing Policy:

Routing policy in AWS Route 53 determines how traffic is distributed to your resources based on the client's request. There are several routing policies available in Route 53, including:

  1. Simple Routing: It is used when there is only one resource to route traffic to. It responds with a single IP address.

  2. Weighted Routing: It allows you to distribute traffic across multiple resources based on the percentage of traffic you specify.

  3. Latency Routing: It routes traffic based on the lowest network latency for the client.

  4. Failover Routing: It allows you to set up a primary resource and a secondary resource, which is used in case the primary resource fails.

  5. Geolocation Routing: It routes traffic based on the location of the client.

  6. Multi-Value Routing: It returns multiple IP addresses for a resource and can help you achieve high availability.

Route 53 Terminologies:

  1. Hosted Zone: A container for all the DNS records for a particular domain name.

  2. Record Set: A collection of records that define how traffic is routed for a specific resource.

  3. Alias Record: A type of record that allows you to map a domain name to an AWS resource (such as an EC2 instance or an S3 bucket).

  4. TTL (Time to Live): The amount of time that a DNS resolver should cache a DNS record before it expires.

  5. Health Check: A test that Route 53 performs to determine the health of a resource.

Pricing:

AWS Route 53 pricing is based on the number of hosted zones and the number of queries that are processed. Hosted zones are charged based on a monthly fee, while queries are charged based on the number of queries processed per month.

The first 1 million queries per month are free, and beyond that, you are charged a per-query fee.

In addition to the standard pricing, Route 53 also offers a traffic flow service, which allows you to create complex routing policies based on different criteria. Traffic flow is charged based on the number of policy records and the number of DNS queries processed.

AWS Pre-Route 53 – how DNS works

 Before diving into AWS Route 53, it's important to understand how DNS works in general.

DNS (Domain Name System) is a system that translates human-readable domain names (such as www.example.com) into IP addresses that computers can understand.

When you enter a domain name in your web browser, your computer contacts a DNS resolver to get the IP address associated with that domain name.

The DNS resolver then returns the IP address to your computer, which can then connect to the web server associated with that IP address.

Here are the general steps that occur when a DNS lookup is performed:

  1. Recursive DNS resolver: Your computer sends a request to a recursive DNS resolver (often provided by your Internet Service Provider). The request includes the domain name that you want to look up.

  2. Root name servers: If the recursive DNS resolver doesn't have the IP address associated with the domain name in its cache, it contacts one of the 13 root name servers. These root name servers contain information about the top-level domain names (such as .com, .org, etc.) and can direct the request to the appropriate authoritative name server.

  3. Authoritative name server: The authoritative name server is responsible for storing the IP address associated with the domain name. If the authoritative name server has the IP address in its cache, it returns the IP address to the recursive DNS resolver. Otherwise, it contacts other authoritative name servers until it finds the IP address.

  4. Recursive DNS resolver: Once the recursive DNS resolver has the IP address, it returns the IP address to your computer, which can then connect to the web server associated with that IP address.

AWS Route 53 is a DNS service provided by Amazon Web Services that allows you to manage DNS records for your domain names.

With Route 53, you can create and manage DNS records, such as A records (which map a domain name to an IP address) and CNAME records (which map a domain name to another domain name).

In addition to managing DNS records, Route 53 also provides other features, such as traffic routing and health checks.

With traffic routing, you can configure Route 53 to route traffic to different endpoints based on geographic location, latency, or other criteria. With health checks, you can monitor the health of your resources (such as EC2 instances) and automatically route traffic away from unhealthy resources.

Overall, AWS Route 53 is a powerful tool for managing DNS for your domain names and routing traffic to your resources.