AWS VPC Notes
AWS VPC Notes
VPC
===========
The private IPv4 address ranges that can be specified while creating a VPC are
between:
=======
NAT
======
(NAT) device is used to control the inbound connections from the Internet
EC2 -> NAT Device with Elastic (public) IP -> Internet Gateway -> Internet
If your VPC is associated with IPv6 address and instances are assigned to IPv6
addresses, you can initiate outbound connections to the Internet through an egress-
only Internet gateway.
========
Route Table
============
Each route table can be associated with multiple subnets, but a subnet is
associated with only one route table.
default route table (which cannot be deleted) called main route table.
NACLs is the security layer at a subnet level, it acts as a firewall and controls
outbound and inbound traffic for subnets.
Elastic IP address is a static, public IPv4 address that can be associated with any
instance and can be moved from one instance to another within your AWS account.
Once you released the assigned elastic IP address, you cannot get it again.
==============
VPC Endpoints
===============
VPC endpoints are virtual devices that enable private connection from VPC to
supported AWS services and VPC endpoint services powered by PrivateLink without
requiring a VPN connection or NAT device or an Internet gateway.
Interface endpoints
It is an elastic network interface with a private IP address that acts as an entry
point for traffic destined to supported services such as Amazon EC2 API, Elastic
Load Balancing API, and many other services.
Gateway endpoints
It is a gateway that is a target for a specified route in your route table, used
for traffic destined to Amazon S3, DynamoDB services.
=================
AWS PrivateLink
===================
AWS PrivateLink is a VPC endpoint service.
connect to VPC to supported AWS services privately, and services hosted by other
AWS accounts
To enable PrivateLink, create an interface VPC endpoint for a service in your VPC,
which creates an elastic network interface in your subnet with a private IP address
that serves as an entry point for traffic destined to the service.
===============================
Egress-Only Internet Gateways
==================================
Egress-Only Internet Gateways is used only for IPV6 traffic, enables outbound
communication from instances in the VPC to Internet, and prevents the Internet from
initiating an IPv6 connection with your instances.
==================
VPC Peering
==================
VPC peering is used to enable route traffic between two VPCs privately.
======================
VPC Scenario
=====================
--> VPC with a single public subnet. (recommended to a single tier, public-facing
simple applications such as a website or a blog.)
Provisioning VPC With Public and Private Subnets is recommended for multi-tier
applications where web servers are in public subnet, and back-end servers are in
private subnet.
Instances in the public subnet can directly communicate to the Internet but the
instances in private subnet can't. So, here the NAT device is attached to the VPC
--> VPC with public and private subnets and AWS managed VPN access
({Public,Private} Subnet --> Virtual Private GW --> VPN Connection --> Customer
gateway --> On Prem)
--> VPC with a private subnet only and AWS managed VPN access
===========
Practice
===========
VPC - Create Subnets in VPC
Create Public Subnet and Private Subnet (5 ip's are reserved, 4 in the beginning of
the range and 1 in the end of the range)
Create Seperate RouteTables for Public and Private Subnet
Associate RT to subnets (otherwise Main RT will be used)
VPC Settings - Select your VPC, Edit DNS Resolution and DNS Hostname as True
In the Public Subnet select Auto assign public address
==============
VPN Connection
===============
AWS managed VPN connection enables your VPC to connect to your own corporate data
center. It comes with a virtual private gateway attached to your VPC and a customer
gateway located in your data center.
===========
TryOut
===========