0
0
AWScloud~20 mins

Internet Gateway for public access in AWS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Internet Gateway Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Architecture
intermediate
2:00remaining
Identify the correct Internet Gateway attachment

You have a Virtual Private Cloud (VPC) and want to allow public internet access to instances in a public subnet. Which option correctly attaches an Internet Gateway to the VPC?

AAttach the Internet Gateway to the VPC using its ID, then update the route table to direct 0.0.0.0/0 traffic to the Internet Gateway.
BAttach the Internet Gateway to the subnet directly, then update the subnet's route table to direct 0.0.0.0/0 traffic to the Internet Gateway.
CAttach the Internet Gateway to the VPC, but no need to update any route tables for public access.
DAttach the Internet Gateway to the VPC and create a NAT Gateway in the same subnet for public access.
Attempts:
2 left
💡 Hint

Remember, Internet Gateways attach to VPCs, not subnets. Public access requires routing traffic through the Internet Gateway.

security
intermediate
2:00remaining
Security group configuration for public internet access

You have attached an Internet Gateway and updated the route table for a public subnet. What security group rule is required to allow inbound HTTP traffic from the internet to an EC2 instance?

AAllow inbound UDP traffic on port 80 from source 0.0.0.0/0.
BAllow inbound TCP traffic on port 22 from source 0.0.0.0/0.
CAllow outbound TCP traffic on port 80 to source 0.0.0.0/0.
DAllow inbound TCP traffic on port 80 from source 0.0.0.0/0.
Attempts:
2 left
💡 Hint

HTTP uses TCP port 80 and inbound traffic must be allowed from anywhere for public access.

service_behavior
advanced
2:00remaining
Effect of missing Internet Gateway on public subnet traffic

You have a subnet with a route table directing 0.0.0.0/0 traffic to an Internet Gateway, but the Internet Gateway is not attached to the VPC. What will happen when an instance in this subnet tries to access the internet?

AThe instance will access the internet normally because the route table has the correct route.
BThe instance will fail to reach the internet because the Internet Gateway is not attached to the VPC.
CThe instance will access the internet only for outbound traffic but not receive inbound traffic.
DThe instance will use the NAT Gateway automatically to reach the internet.
Attempts:
2 left
💡 Hint

Routes to an Internet Gateway require the gateway to be attached to the VPC to function.

Configuration
advanced
2:00remaining
Correct Terraform configuration for Internet Gateway attachment

Which Terraform snippet correctly creates and attaches an Internet Gateway to a VPC named 'main-vpc'?

A
resource "aws_internet_gateway" "gw" {
  vpc_id = "main-vpc"
}
B
resource "aws_internet_gateway" "gw" {
  vpc = aws_vpc.main-vpc.id
}
C
resource "aws_internet_gateway" "gw" {
  vpc_id = aws_vpc.main_vpc.id
}
D
resource "aws_internet_gateway" "gw" {
  vpc_id = aws_vpc.main-vpc.id
}
Attempts:
2 left
💡 Hint

Terraform resource attributes are case-sensitive and must match resource names exactly.

Best Practice
expert
2:00remaining
Best practice for high availability of Internet Gateway in multi-AZ VPC

You have a VPC spanning multiple Availability Zones (AZs). What is the best practice to ensure high availability of internet access for public subnets in all AZs?

ACreate one Internet Gateway attached to the VPC; it automatically provides internet access to all AZs.
BAttach the Internet Gateway to each subnet individually to ensure availability.
CCreate a NAT Gateway in each AZ instead of an Internet Gateway for public internet access.
DCreate one Internet Gateway per AZ and attach each to the VPC for redundancy.
Attempts:
2 left
💡 Hint

Internet Gateways are regional and attached to the VPC, not per AZ or subnet.