Ref: https://learn.cantrill.io/courses/1820301/lectures/41301619
Amazon VPC - Key Concepts
- π§ Create and manage VPNs inside an AWS account
- A Virtual Private Cloud (VPC) is a virtual private NW (VPN) inside AWS
- VPC CIDR = range of addresses of the VPN (e.g. 172.31.0.0/16)
- Many other AWS services and resources (in fact, all private AWS services) run inside VPCs (e.g. EC2 instances)
- A VPC is within 1 AWS account & 1 region β VPCs are regionally resilient
- VPCs can deploy subnets (smaller NWs) in the different AZs of their region
- π‘ If an AZ fails, the VPC is still functional in other AZs of the region
- Subnet CIDR = slice of the (whole) VPC CIDR
- Can never be changed once configured
- Types of VPCs
- Default VPC (0-1 per region)
- Always has the same static configuration
- Custom VPCs (0+ per region)
- Need to be configured
- 100% private by default
- π§ (Custom) VPCs are private & isolated by default
- By default, can not communicate with anything outside the VPC (including other VPCs!)
- Custom VPCs have a default boundary, blocking all traffic IN and OUT of the VPC
- Specific configuration is needed for Custom VPCs to communicate with outside entities:
- Other VPCs
- On-premises NWs in hybrid environments
- Other cloud platforms in a multi-cloud deployment
- Public internet
- π‘ Default privacy and isolation doesn't apply to the Default VPC (exception)
Default VPC
- π§ Automatically created by AWS, always pre-configured in the same, very specific way
- π Predictable β great for quick testing
- π Inflexible β not good for PROD environments
- βΌοΈ Default VPC CIDR = 172.31.0.0/16 (ALWAYS!!) β memorize it
- 0-1 per region
- Can be deleted and recreated
- β βCreate VPCβ creates a Custom VPC β Recreate the Default VPC (different action)
- π‘ Some AWS services assume the Default VPC exists, so it's good practice to keep it around. Be careful if you decide to delete it!
- One /20 subnet is deployed in each AZ in the region
- Currently
us-east-1
(N. Virginia) region has 6 AZs β Default VPC has 1 subnet in each
- β Preconfigured with IGW, Security Group (SG) & NACL
- π‘ SGs and NACLs are security features that limit incoming/outgoing data transfer
- β By default, resources inside the Default VPC get assigned a public IPv4 address, which makes them accessible from the public internet!
- Unlike Custom VPCs, the Default VPC is not private nor isolated by default!!
- Default VPC - Summary Diagram