Lesson 1 of 4 ยท Build a Cloud Foundation

Networks and address spaces

A virtual network gives your cloud resources a private address space. Choose a CIDR range that leaves room for future subnets and does not overlap with networks you may need to connect later.

Example

resource "aws_vpc" "main" {
  cidr_block = "10.0.0.0/16"

  tags = { Name = "training-network" }
}

Step by step

  1. Choose a private CIDR range.
  2. Leave room for separate public and private areas.
  3. Document the network purpose.
  4. Avoid overlapping connected networks.

Common mistakes to avoid

  • Choosing a CIDR range without considering future subnets.
  • Reusing an address range that overlaps with an office or VPN network.