Courseiva
Design for New Solutions →mediumMultiple Choice

SAP-C02 Design for New Solutions Practice Question

A company is designing a serverless application using AWS Lambda. The function needs to access a VPC resource. What is the correct way to configure this?

⚠ Common exam trap

It's easy for candidates to confuse external connectivity (Internet Gateway, NAT Gateway) with internal VPC access, mistakenly thinking those components are required for a Lambda function to reach resources within the same VPC.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Assign the Lambda function to the VPC and configure a security group

Lambda functions must be attached to a VPC and assigned a security group to access resources within the VPC, such as an RDS database or an Elasticache cluster. This configuration creates an elastic network interface (ENI) in the VPC, allowing the function to communicate with VPC resources via private IP addresses. The security group acts as a virtual firewall to control inbound and outbound traffic for the Lambda function.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Attach an Internet Gateway to the VPC

    Why it's wrong here

    An Internet Gateway enables inbound and outbound internet traffic for a VPC, which is irrelevant to reaching an internal VPC resource. It is tempting because Lambda needs network pathing, but the function must instead be attached to private subnets within the VPC.

  • ✓

    Assign the Lambda function to the VPC and configure a security group

    Why this is correct

    Attaching the function to the VPC places its elastic network interfaces in specified subnets, and the security group controls outbound and inbound traffic to the VPC resource. This satisfies the requirement to reach a private VPC resource.

  • ✗

    Set up a VPC peering connection

    Why it's wrong here

    VPC peering connects two VPCs to each other, so it cannot place a Lambda function inside the VPC containing the resource. It is tempting because peering links networks, but the function must be configured with VPC subnet and security group settings.

  • ✗

    Configure a NAT Gateway in the public subnet

    Why it's wrong here

    A NAT Gateway provides outbound internet access for private subnets; it does not give Lambda access to a VPC resource. It is tempting because Lambda needs subnet routing, but the requirement is attaching the function to private subnets with appropriate security groups.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

This SAP-C02 question is part of Courseiva's 984-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SAP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SAP-C02 exam.