Bird
Raised Fist0
AWScloud~5 mins

Default VPC overview in AWS - Commands & Configuration

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Introduction
A default VPC is a ready-to-use network in AWS that lets you launch resources without setting up a network. It solves the problem of needing to create and configure a network before using AWS services.
When you want to quickly launch an EC2 instance without creating a custom network.
When you are learning AWS and want to experiment with resources in a simple network.
When you need a basic network setup with public internet access for your resources.
When you want to avoid the complexity of configuring subnets, route tables, and gateways.
When you want to use AWS services that require a network but do not want to manage it yourself.
Commands
This command lists the default VPCs in your AWS account. It helps you find the default network ready for use.
Terminal
aws ec2 describe-vpcs --filters Name=isDefault,Values=true
Expected OutputExpected
{ "Vpcs": [ { "VpcId": "vpc-0abcd1234efgh5678", "InstanceTenancy": "default", "IsDefault": true, "State": "available", "CidrBlock": "172.31.0.0/16", "DhcpOptionsId": "dopt-0a1b2c3d4e5f6g7h8" } ] }
--filters - Filters the VPCs to show only the default one.
This command shows the subnets inside the default VPC. Subnets divide the network into smaller parts.
Terminal
aws ec2 describe-subnets --filters Name=vpc-id,Values=vpc-0abcd1234efgh5678
Expected OutputExpected
{ "Subnets": [ { "SubnetId": "subnet-0123abcd", "VpcId": "vpc-0abcd1234efgh5678", "CidrBlock": "172.31.0.0/20", "AvailabilityZone": "us-east-1a", "State": "available" }, { "SubnetId": "subnet-0456efgh", "VpcId": "vpc-0abcd1234efgh5678", "CidrBlock": "172.31.16.0/20", "AvailabilityZone": "us-east-1b", "State": "available" } ] }
--filters - Filters subnets by the default VPC ID.
This command shows the internet gateway attached to the default VPC. It allows resources to access the internet.
Terminal
aws ec2 describe-internet-gateways --filters Name=attachment.vpc-id,Values=vpc-0abcd1234efgh5678
Expected OutputExpected
{ "InternetGateways": [ { "InternetGatewayId": "igw-0a1b2c3d4e5f6g7h8", "Attachments": [ { "VpcId": "vpc-0abcd1234efgh5678", "State": "attached" } ] } ] }
--filters - Filters internet gateways attached to the default VPC.
Key Concept

If you remember nothing else from this pattern, remember: the default VPC is a ready-made network that lets you start using AWS resources immediately without extra setup.

Common Mistakes
Trying to launch resources without checking if the default VPC exists.
Some AWS accounts or regions may not have a default VPC, causing resource launch failures.
Always run 'aws ec2 describe-vpcs --filters Name=isDefault,Values=true' to confirm the default VPC exists before launching resources.
Assuming the default VPC has public internet access without verifying the internet gateway.
If the internet gateway is missing or detached, resources cannot access the internet.
Check the internet gateway attachment with 'aws ec2 describe-internet-gateways --filters Name=attachment.vpc-id,Values=<vpc-id>' to ensure internet access.
Summary
Use 'aws ec2 describe-vpcs' with filters to find the default VPC in your AWS account.
Check subnets in the default VPC to understand its network layout.
Verify the internet gateway is attached to allow internet access for resources.

Practice

(1/5)
1. What is the main purpose of the AWS Default VPC?
easy
A. To monitor application performance
B. To store data backups automatically
C. To provide a ready-to-use network for launching resources quickly
D. To manage user permissions and roles

Solution

  1. Step 1: Understand what a VPC is

    A VPC is a virtual network where AWS resources run.
  2. Step 2: Identify the role of the Default VPC

    The Default VPC is pre-made to let users launch resources without extra setup.
  3. Final Answer:

    To provide a ready-to-use network for launching resources quickly -> Option C
  4. Quick Check:

    Default VPC = ready network [OK]
Hint: Default VPC means ready network for quick resource launch [OK]
Common Mistakes:
  • Confusing VPC with storage or permissions
  • Thinking Default VPC manages backups
  • Assuming Default VPC monitors performance
2. Which of the following is TRUE about the Default VPC's subnets?
easy
A. Subnets must be created manually before use
B. It has no subnets by default
C. It only has private subnets without internet access
D. It includes one subnet in each Availability Zone

Solution

  1. Step 1: Recall Default VPC subnet setup

    The Default VPC automatically creates one subnet per Availability Zone.
  2. Step 2: Check internet access for subnets

    These subnets are public and have internet access by default.
  3. Final Answer:

    It includes one subnet in each Availability Zone -> Option D
  4. Quick Check:

    Default VPC = subnet per AZ [OK]
Hint: Default VPC auto-creates subnets per AZ [OK]
Common Mistakes:
  • Thinking Default VPC has no subnets
  • Assuming subnets are private only
  • Believing subnets require manual creation
3. If you launch an EC2 instance in the Default VPC, what is the default behavior regarding internet access?
medium
A. The instance automatically gets a public IP and internet access
B. The instance can only access other instances in the same subnet
C. The instance has no internet access unless manually configured
D. The instance is blocked from all network traffic by default

Solution

  1. Step 1: Understand Default VPC internet setup

    Default VPC subnets are public and assign public IPs automatically.
  2. Step 2: Check instance network behavior

    Instances launched get internet access by default through the internet gateway.
  3. Final Answer:

    The instance automatically gets a public IP and internet access -> Option A
  4. Quick Check:

    Default VPC instance = public IP + internet [OK]
Hint: Default VPC instances get public IPs automatically [OK]
Common Mistakes:
  • Assuming no internet without manual setup
  • Thinking instances are isolated by default
  • Believing network traffic is blocked initially
4. You try to launch an EC2 instance in the Default VPC but get a network error. What is the most likely cause?
medium
A. The Default VPC was deleted or modified incorrectly
B. You forgot to create a subnet manually
C. The instance type is not supported in the Default VPC
D. AWS does not allow EC2 in Default VPC

Solution

  1. Step 1: Recall Default VPC properties

    Default VPC exists by default with subnets and internet gateway.
  2. Step 2: Analyze network error cause

    If network errors occur, it often means the Default VPC was deleted or changed wrongly.
  3. Final Answer:

    The Default VPC was deleted or modified incorrectly -> Option A
  4. Quick Check:

    Network error = Default VPC missing/changed [OK]
Hint: Network errors often mean Default VPC missing or changed [OK]
Common Mistakes:
  • Assuming subnets must be created manually
  • Thinking instance type blocks launch
  • Believing EC2 is disallowed in Default VPC
5. You want to launch a private EC2 instance without internet access using the Default VPC. What should you do?
hard
A. Launch in the Default VPC subnet and disable the public IP
B. Create a new private subnet in the Default VPC and launch the instance there
C. Use the Default VPC as is; all instances are private by default
D. Delete the Default VPC and create a custom VPC with no internet gateway

Solution

  1. Step 1: Understand Default VPC subnet types

    Default VPC subnets are public with internet access by default.
  2. Step 2: Plan for private instance launch

    To have a private instance, create a new private subnet without internet gateway attachment.
  3. Step 3: Avoid deleting Default VPC unnecessarily

    Deleting Default VPC is not required; just add private subnet inside it.
  4. Final Answer:

    Create a new private subnet in the Default VPC and launch the instance there -> Option B
  5. Quick Check:

    Private instance = new private subnet in Default VPC [OK]
Hint: Add private subnet in Default VPC for no internet [OK]
Common Mistakes:
  • Assuming disabling public IP alone makes instance private
  • Thinking all Default VPC instances are private
  • Deleting Default VPC unnecessarily