Cloud

Write an awesome doc for cloud and how to deploy our apps using technologies like AWS, GitHub actions, CI/CD and Docker. Also a very comprehensive documentation around AWS.

View on GitHub

VPC

[!IMPORTANT]

By clicking on “Create VPC” you’re gonna create a new VPC which is not the default VPC. If you’ve deleted your default VPC you need to create a new default VPC by clicking on “Create default VPC” in “Actions”* dropdown.

Uncheck all the selected VPCs in the VPC’s table to see “Create default VPC” option.

Create default VPC

Classful VS Classless IP addresses

Classful Classless
Inflexible (Waste of IP address spaces) Flexible
Cannot combine networks of different classes Can combine networks of different classes
Less efficient since all devices are in one huge network route data packets to the respective device based on the indicated subnet

[!TIP]

AWS charges you for every single public IPv4 you’re using. BUT you can use IPv6 instead which is free. JFI: all IPv6 are public.

Subnet

Next stop after creating VPC is to create subnets.

Cross AZs VPC

NACL

How NACL works

Route tables

Next step is enabling our EC2 instance to connect to the internet.

[!NOTE]

After creating the route table you need to create an internet gateway and add it to the public route table as a route so that your EC2 instances can access internet.

Gateway

Internet gateway

So now your EC2 instances who are within the public subnet must be reachable through internet. Now we can work on our private subnet. It needs to access internet, remember we said that NACL is stateless. Thus we need to create a NAT gateway.

NAT gateway

NAT gateway

[!NOTE]

After you’ve created the NAT gateway you still need to add it as a route to your private subnet.

[!TIP]

NAT instance: we can run a self-managed version of NAT.

Security Group

[!NOTE]

Learn about it security groups here.

Security group usage besides NACL

Security group VS NACL

  Security Group NACL
Works at EC2 instance level. Subnet level.
Supports ALLOW rules. ALLOW/DENY rules.
Connection tracking Stateful: they automatically allow return traffic that corresponds to an allowed inbound connection. Stateless: they do not track the state of connections, thus explicit rules for both inbound and outbound traffic are necessary.
Configuring it You must explicitly say it. It is automatically applied (Each instance is within a subnet).

VPC flow logs feature

VPC flow logs

VPC endpoints feature

Type AWS service Infographic
Gateway S3.
DynamoDB.
VPC endpoints of type gateway
Interface Rest of AWS services VPC endpoints of type interface

PrivateLink

VPN

Client VPN

OpenVPN client

References

-ref

Footnotes

  1. Elastic IP. A fixed public IP dedicated to our EC2 instance or NAT gateway.  2