Skip to content

prashanthgithub-ai/vpc-servers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Our requirement is to create VPC and two private instances with auto scaling to show work of two web servers as shown in below figure

There are some steps to complete this project

requrment

STEP 1:

  1. Go to aws console and sign-in to aws account
  2. Choose the vpc through search bar

Note: If we choose (vpc only) option then we have to create components step by step manually

STEP 2:

  1. Create one vpc
  2. Create four subnets as two public subnets and two private subnets for private subnets choose two different availability zones
  3. Create one public route table and two private route tables
  4. Update the subnet associations as (public subnets to public routes) and (private subnets to private routes)
  5. Create one internet gateway and attach to public route tables
  6. Create one NAT gateway and attach to private route tables

Note: If we choose (vpc and more) option and select the components as our requirements then it will create the connections automatically

  1. You can see all the component connections in preview
  2. As shown in below figure

preview 1

STEP 3:

  1. Go to EC2 service from vpc

  2. Select the launch templates

  3. Create the launch templates and give the name for launch template

  4. Choose the instance type as free tire as shown in below figure

    launch instance3

  5. Select the created key pair or generate a new key pair

  6. Update the network settings by clicking on edit option

    • No need to change subnet

    • Click on create security group

    • enter the security group name

    • enter the description it’s your choice

    • select the created vpc for the project

    • update the inbound rules

    • one is ssh and another is http port 80

    • launch the templats

    • do this as shown in below figure

    launch png

STEP 4:

  1. Go to auto scalling group

  2. Create the auto scalling group

  3. Give the name for auto scalling group

  4. Select the created launch templats

  5. Choose instance type requirement

    • Choose VCPUs minimum and maximum

    • (2 is minimum) and (3 is maximum)

    • Choose memory minimum and maximum

    • (4 is minimum) and (8 is maximum)

    • Select as shown in below figure

    asg1

  6. Select created vpc

  7. Select 2 private availability zones as shown in below figure

    asg2

  8. No need to select load balancer leave as no load balancer

  9. Choose desired capacity and scalling option as shown in below figure

    asg3

  10. Auto scalling group is created

STEP 5:

  1. Go to instance

  2. Check the instance their 2 private instances are created from auto scalling group

  3. Give the name for 2 private instances as private 1 and private 2 to avoid confusions

  4. Create one public instance named as bastion host as shown in figure

    instance

  5. From that public instance we can connect the private through ssh client

  6. completing the terminal work for two private instances

STEP 6:

  1. Go to target groups

  2. Create the target group

  3. Give the name for target group

  4. Select the two private instances as shown in below figure

    target group

  5. Click on include as pending below

  6. Click on create the target group then target group is created

STEP 7:

  1. Go to load balancer

  2. Click on create load balancer

  3. Give the name for load balancer

  4. Update network mapping

    • Choose created vpc

    • Choose two availability zones as shown in figure

    load balancer1

  5. Update the created security group as shown in below figure

    load balancer2

  6. Click on create load balancer then load balancer is created

  7. Copy the load balancer DNS name to access the two web servers

    load balancer

STEP 8:

  1. Go to Google page or new web page

  2. Paste the copied DNS name on URL path

  3. You can see the two created web servers as shown in figure

    server1

  4. Just re-fresh the page then you see second server

    server2

That’s it, our requirement is done.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published