Code Monkey home page Code Monkey logo

vpc-task's Introduction

VPC-Task

The purpose of this task is to:

  1. Set up two instances in a private network in AWS and deploy an Ngix webserver on both.

  2. Create an ALB to route requests to these instances and ensure they display their hostname or IP adress.

The first step in this task is to ensure that an AWS account has been created. log in to account and choose a preferred region.

search for VPC in the services section.

Create VPC

choose the VPC and others option , so that it automatically creates the subnets, route tables for you.

screenshot of vpc Click on nat gateway, so that it creates one nat gateway to give internet access to your private instances.

screenshot of nat gatewayTwo subnets each are created for private and public. Preview the subnets and route-tables and click on create VPC.

1screenshot of created VPC

Create EC2 Instances

You would need to create two private instances and one bastion host.

click on launch instance.

screenshot of laucnch instance option

Create a name for you instance.

sc of instance name

Choose your preferred linux distro. For the purpose of this course, we would use Ubuntu.

Choose a key pair

sc of ubuntu linux

Click on edit network configurations.

  1. Choose the newly created VPC as the option for your instance to be placed in.

  2. Place it in one of the private subnets.

  3. Disable the automatic creation of a public IP adress

  4. Create a security group and click launch instance. Repeat same for the second instance.

sc of edited network settings

Create Bastion Host

A bastion host is a server with which you can access your private instances.

  1. Create a name for your bastion host.

  2. select a key pair

  3. place the instance in the newly created VPC and in the public subnet this time around. Enable public IP and choose existing security group.

  4. click on launch instance.

  5. Now ssh into your bastion host with your key pair.

  6. chmod 400 the selected key pair and ssh with the ip into your bastion host

  7. The bastion host would now be used to log-in to your private instances.

  8. copy key pair into your bastion host chmod 400 the copied key and use it to ssh into instance.

  9. sudo apt update

  10. sudo apt update; sudo apt install nginx -y; sudo su to log into the root user and install ngix server.

  11. Use the command echo "

    This is my server $(hostname -f)

    " > /var/www/html/index.nginx-debian.htmlecho to displa our servername

  12. Use the cat to confirm that it was successful

  • cat /var/www/html/index.nginx-debian.html do the same for second instance.

Create target group

choose your target group name.

sc of target group creation sc of target group creation sc sc

Create Load Balancer

sc sc sc lb group creation Create security group for load balancer.

Check to see if target group is healthy.

sc of healthy target groups

Use Load balancer DNS to see if IP Adress displayed successfully.

server1 image server 2 image

vpc-task's People

Contributors

mogbojuloluwa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.