Create two public subnets and two private subnets in two different availability zones(AZ) ( one public and one private subnet in each AZ).Create an instance of webserver (like apache ) in each AZ and an instance of db server in any AZ. Attach web servers to ELB and make sure to support cross zone availability.

 Step 1: Create a VPC (if not already created)

  1. Go to the Amazon VPC console.
  2. Click on "Create VPC."
  3. Enter the details such as CIDR block and VPC name.
  4. Click on "Create VPC."

Step 2: Create the subnets

  1. In the VPC console, select "Subnets."
  2. Click on "Create subnet."
  3. Enter the subnet details such as the VPC ID, availability zone, CIDR block, and subnet name.
  4. Repeat the above steps to create the remaining subnets.

Step 3: Create the security groups

  1. In the VPC console, select "Security Groups."
  2. Click on "Create security group."
  3. Enter the details such as the security group name, description, and VPC ID.
  4. Add inbound and outbound rules as required.

Step 4: Launch the instances

  1. In the EC2 console, click on "Launch instance."
  2. Select the AMI and instance type.
  3. In the "Configure Instance Details" section, select the appropriate VPC, subnet, and security group.
  4. Configure the rest of the instance settings as required.
  5. Repeat the above steps to launch the remaining instances.

Step 5: Create the Elastic Load Balancer

  1. In the EC2 console, select "Load Balancers."
  2. Click on "Create Load Balancer."
  3. Choose the type of load balancer and configure the settings as required.
  4. Select the availability zones to use and add the instances to the load balancer.

Step 6: Configure cross-zone load balancing

  1. In the EC2 console, select the load balancer.
  2. Click on the "Attributes" tab.
  3. In the "Cross-Zone Load Balancing" section, select "Enable" and click on "Save."

That's it! You have now created the infrastructure with two public and two private subnets, one public and one private subnet in each availability zone. You have also launched instances of web servers and a database server and attached the web servers to the Elastic Load Balancer with cross-zone availability.

Comments

Popular posts from this blog

Error Solving : -bash: /usr/local/bin/kubectl: cannot execute binary file : after Kubernetes installation: you're trying to run the kubectl command on an EC2 instance in AWS

Nodejs Application project : using Aws, Jenkins, Docker, Kubernetes