Giter VIP home page Giter VIP logo

aws_vpc's Introduction

Part 1

Screen Shot 2023-12-17 at 20 45 52

Create VPC

VPC - Virtual Private Cloud is a commercial cloud computing service that provides a virtual private cloud, by provisioning a logically isolated section of Amazon Web Services Cloud.

Screen Shot 2023-12-17 at 19 44 11

Enable DNS hostnames

The DNS hostnames attribute determines whether instances launched in the VPC receive public DNS hostnames that correspond to their public IP addresses.

Enable Internet gateways & attach to vpc

An internet gateway is a virtual router that connects a VPC to the internet.

aws ec2 attach-internet-gateway --vpc-id "vpc-08c6e4ccb8b131621" --internet-gateway-id "igw-08a034af09f3ce082" --region us-east-1

Create Public Subnets

To add a new subnet to your VPC, you must specify an IPv4 CIDR block for the subnet from the range of your VPC. You can specify the Availability Zone in which you want the subnet to reside. You can have multiple subnets in the same Availability Zone. You can optionally specify an IPv6 CIDR block for your subnet if an IPv6 CIDR block is associated with your VPC.

Screen Shot 2023-12-17 at 20 08 00 Screen Shot 2023-12-17 at 20 12 13

Edit the subnet settings to enable auto-assign public IPv4 address.

The auto-assign IP settings determines if, when you launch an EC2 instance, the primary network interface is assigned a public IPv4 address or IPv6 address by default.

Create Route Table & Add routes

Once we created the vpc a main route table was created automatically for it, a private one so lets create a public one as well and add routes

Screen Shot 2023-12-17 at 20 23 53

Associate the subnets with the route table

Screen Shot 2023-12-17 at 20 26 51 we should now see 2 subnets added to the Explicit subnet associations on the public route table

Add 4 more private subnets (app + data)

keeping in mind to associate the private subnet to the same availability zone as the public one

Screen Shot 2023-12-17 at 20 51 16

what makes the 2 public subnets actually public is that they are associated in the public route table wich is 0.0.0.0/24

how the 4 remaining are private? bacause when we created the vpc the main route table was created wich is private, now when a subnet has not been associated with any route tables they auto associate with the main one.


Part 2

Screen Shot 2023-12-17 at 22 01 56

Create NAT gateway & Private route tables

The NAT gateway allows the instances in the private subnets (app + data) to access the internet

The private route table is associated with the private subnets and routes the traffic to the internet trough the NAT gateway

Screen Shot 2023-12-17 at 22 06 17

after creating the nat gateway lets create the private route table and add a route to the NAT

Screen Shot 2023-12-17 at 22 10 57

now lets associate this private route table with the private subnets of az1

Screen Shot 2023-12-17 at 22 15 18

and basically the same for az2 as well


Part 3

Screen Shot 2023-12-17 at 22 29 00

Creating security groups

A security group acts as a virtual firewall for your instance to control inbound and outbound traffic.

lets start with the app load balancer security group

Screen Shot 2023-12-17 at 22 37 09

then SSH

Screen Shot 2023-12-17 at 22 39 03

then the webserver (adding ssh & alb)

Screen Shot 2023-12-17 at 22 43 56

and for the database (port 3306 for mysql)

Screen Shot 2023-12-17 at 22 47 10

Part 4

Screen Shot 2023-12-17 at 23 36 35

Launching MySQL & RDS Instances

first we need to create the subnet groups,in order to specify on which subnets we want our RDS database in

Screen Shot 2023-12-17 at 23 43 08

now lets create the database (2long 4 screenshot)

engine - MySQL, Template - Dev/Test, Id - dev-rds-db, Instance configuration - db.t2.micro (free), VPC - dev_vpc, subnet group - db_subnets (the one we just created), security group(firewall) - db_security_group, Availability Zone - 1b, db name - app_db, pwd - rZpdQGf6QdKAYsE4iYf7 (lol)

aws_vpc's People

Contributors

nikdzub 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.