Create VPC

Create VPC

The VPC hosts the EC2 origin. The instance must be in a public subnet with a route to an Internet Gateway so CloudFront can reach it.

  1. Open the VPC console at https://console.aws.amazon.com/vpc/
    • Select Your VPCs
    • Select Create VPC Create VPC
  2. In VPC settings, configure:
    • Resources to create: VPC and more
    • Name tag auto-generation: keep Auto-generate checked and enter cloudfront-lab
    • IPv4 CIDR block: 10.0.0.0/16
    • IPv6 CIDR block: No IPv6 CIDR block
    • Tenancy: Default Create VPC
  3. Configure subnets:
    • Number of Availability Zones (AZs): 2
    • Number of public subnets: 2
    • Number of private subnets: 0 Create VPC
  4. Configure the remaining options:
    • NAT gateways: None
    • VPC endpoints: None
    • DNS options: check Enable DNS hostnames and Enable DNS resolution Create VPC

      Enable DNS hostnames gives the EC2 instance a Public IPv4 DNS name, which you use as the CloudFront origin later.

  5. Check that Preview shows the VPC, 2 public subnets, 1 route table and 1 Internet Gateway, then select Create VPC. Create VPC
  6. When all resources are created, select View VPC. Create VPC
  7. The VPC is created. Create VPC