Amazon DVA-C02 Practice Exams
Last updated on Oct 23,2026- Exam Code: DVA-C02
- Exam Name: AWS Certified Developer - Associate
- Certification Provider: Amazon
- Latest update: Oct 23,2026
A company is migrating its PostgreSQL database into the AWS Cloud. The company wants to use a database that will secure and regularly rotate database credentials. The company wants a solution that does not require additional programming overhead.
Which solution will meet these requirements?
- A . Use Amazon Aurora PostgreSQL tor the database. Store the database credentials in AWS Systems Manager Parameter Store Turn on rotation.
- B . Use Amazon Aurora PostgreSQL for the database. Store the database credentials in AWS Secrets Manager Turn on rotation.
- C . Use Amazon DynamoDB for the database. Store the database credentials in AWS Systems Manager Parameter Store Turn on rotation.
- D . Use Amazon DynamoDB for the database. Store the database credentials in AWS Secrets Manager Turn on rotation.
B
Explanation:
This solution meets the requirements because it uses a PostgreSQL-compatible database that can secure and regularly rotate database credentials without requiring additional programming overhead. Amazon Aurora PostgreSQL is a relational database service that is compatible with PostgreSQL and offers high performance, availability, and scalability. AWS Secrets Manager is a service that helps you protect secrets needed to access your applications, services, and IT resources. You can store database credentials in AWS Secrets Manager and use them to access your Aurora PostgreSQL database. You can also enable automatic rotation of your secrets according to a schedule or an event. AWS Secrets Manager handles the complexity of rotating secrets for you, such as generating new passwords and updating your database with the new credentials. Using Amazon DynamoDB for the database will not meet the requirements because it is a NoSQL database that is not compatible with PostgreSQL. Using AWS Systems Manager Parameter Store for storing and rotating database credentials will require additional programming overhead to integrate with your database.
Reference: [What Is Amazon Aurora?], [What Is AWS Secrets Manager?]
A developer created a Node.js-based AWS Lambda function by using a container image of an AWS OS-only base image. There is a new security patch for Node.js that must be patched to the new Lambda function.
Which solution will meet this requirement?
- A . Set the runtime update mode of the Lambda function to Auto.
- B . Patch the runtime version by redeploying the same version of the Lambda function.
- C . Rebuild the Lambda container code with the latest version of the AWS OS base image. Publish a new version of the Lambda function.
- D . Rebuild the Lambda container code with the latest Node.js patch version. Publish a new version of the Lambda function.
D
Explanation:
Why Option D is Correct:
When using a container-based AWS Lambda function, you are responsible for updating the base image for runtime patches. Rebuilding the container with the latest Node.js patch version ensures the function is updated with the required security patches. Publishing a new version of the Lambda function makes the updated image available for use.
Why Other Options are Incorrect:
Option A: The runtime update mode applies to functions using AWS-managed runtimes, not container-based runtimes.
Option B: Redeploying the same version of the Lambda function does not apply the security patch.
Option C: Rebuilding with the AWS OS base image does not guarantee that the latest Node.js patch version is included.
AWS Documentation
Reference: Lambda Function Container Images
Node.js Updates in AWS Lambda
A developer is creating an AWS Lambda function that will connect to an Amazon RDS for MySQL instance. The developer wants to store the database credentials. The database credentials need to be encrypted and the database password needs to be automatically rotated.
Which solution will meet these requirements?
- A . Store the database credentials as environment variables for the Lambda function. Set the environment variables to rotate automatically.
- B . Store the database credentials in AWS Secrets Manager. Set up managed rotation on the database credentials.
- C . Store the database credentials in AWS Systems Manager Parameter Store as secure string parameters. Set up managed rotation on the parameters.
- D . Store the database credentials in the X-Amz-Security-Token parameter. Set up managed rotation on the parameter.
A developer is building an application that uses Amazon DynamoDB. The developer wants to retrieve multiple specific items from the database with a single API call.
Which DynamoDB API call will meet these requirements with the MINIMUM impact on the database?
- A . BatchGetltem
- B . Getltem
- C . Scan
- D . Query
A developer is building various microservices for an application that will run on Amazon EC2 instances. The developer needs to monitor the end-to-end view of the requests between the microservices and debug any issues in the various microservices.
What should the developer do to accomplish these tasks?
- A . Use Amazon CloudWatch to aggregate the microservices’ logs and metrics, and build the monitoring dashboard.
- B . Use AWS CloudTrail to aggregate the microservices’ logs and metrics, and build the monitoring dashboard.
- C . Use the AWS X-Ray SDK to add instrumentation in all the microservices, and monitor using the X-Ray service map.
- D . Use AWS Health to monitor the health of all the microservices.
C
Explanation:
To monitor end-to-end requests and debug issues across microservices, you need distributed tracing.
Among AWS tools, AWS X-Ray is specifically built for this use case.
Step-by-Step Breakdown:
Step 1: Understand the Requirement
The developer needs:
End-to-end request tracing across microservices
Debugging capability for performance issues or failures
This points directly to a distributed tracing solution rather than just logs or metrics.
Step 2: Evaluate the Options
Option A: Amazon CloudWatch
CloudWatch is powerful for metrics, logs, and alerts.
But it does not provide distributed tracing or request path visualization between microservices.
So, it’s not sufficient alone for the requirement.
Option B: AWS CloudTrail
CloudTrail tracks API calls made through the AWS Management Console, CLI, SDKs.
It is meant for auditing and governance, not microservices request tracing.
Not suitable for debugging microservices interactions.
Option C: AWS X-Ray SDK with X-Ray service map
✅ Purpose-built for distributed tracing
Automatically collects data about requests as they travel through your microservices
You can instrument your code with the AWS X-Ray SDK in Java, Node.js, Python, Go, .NET, etc.
Visualizes requests using a service map, showing latency, errors, and time spent in downstream
services.
How it works:
Instrument each microservice using the AWS X-Ray SDK.
Use the SDK to trace requests, propagate trace headers across services.
The X-Ray daemon collects and sends trace data to the X-Ray service.
You can view the service map, see bottlenecks, error rates, etc.
Option D: AWS Health
AWS Health provides information on AWS service outages or account-level events.
It does not monitor your application or microservices health or request flows.
Correct Choice: C is the only option that meets the developer’s requirement to monitor end-to-end request paths and debug issues in a microservices architecture.
AWS Developer
Reference: AWS X-Ray Documentation: https://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html
Instrumenting your application: https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk.html
Viewing the Service Map: https://docs.aws.amazon.com/xray/latest/devguide/xray-console-service-map.html
Tracing Microservices with AWS X-Ray: https://aws.amazon.com/blogs/compute/tracing-microservices-aws-x-ray/
A developer is building various microservices for an application that will run on Amazon EC2 instances. The developer needs to monitor the end-to-end view of the requests between the microservices and debug any issues in the various microservices.
What should the developer do to accomplish these tasks?
- A . Use Amazon CloudWatch to aggregate the microservices’ logs and metrics, and build the monitoring dashboard.
- B . Use AWS CloudTrail to aggregate the microservices’ logs and metrics, and build the monitoring dashboard.
- C . Use the AWS X-Ray SDK to add instrumentation in all the microservices, and monitor using the X-Ray service map.
- D . Use AWS Health to monitor the health of all the microservices.
C
Explanation:
To monitor end-to-end requests and debug issues across microservices, you need distributed tracing.
Among AWS tools, AWS X-Ray is specifically built for this use case.
Step-by-Step Breakdown:
Step 1: Understand the Requirement
The developer needs:
End-to-end request tracing across microservices
Debugging capability for performance issues or failures
This points directly to a distributed tracing solution rather than just logs or metrics.
Step 2: Evaluate the Options
Option A: Amazon CloudWatch
CloudWatch is powerful for metrics, logs, and alerts.
But it does not provide distributed tracing or request path visualization between microservices.
So, it’s not sufficient alone for the requirement.
Option B: AWS CloudTrail
CloudTrail tracks API calls made through the AWS Management Console, CLI, SDKs.
It is meant for auditing and governance, not microservices request tracing.
Not suitable for debugging microservices interactions.
Option C: AWS X-Ray SDK with X-Ray service map
✅ Purpose-built for distributed tracing
Automatically collects data about requests as they travel through your microservices
You can instrument your code with the AWS X-Ray SDK in Java, Node.js, Python, Go, .NET, etc.
Visualizes requests using a service map, showing latency, errors, and time spent in downstream
services.
How it works:
Instrument each microservice using the AWS X-Ray SDK.
Use the SDK to trace requests, propagate trace headers across services.
The X-Ray daemon collects and sends trace data to the X-Ray service.
You can view the service map, see bottlenecks, error rates, etc.
Option D: AWS Health
AWS Health provides information on AWS service outages or account-level events.
It does not monitor your application or microservices health or request flows.
Correct Choice: C is the only option that meets the developer’s requirement to monitor end-to-end request paths and debug issues in a microservices architecture.
AWS Developer
Reference: AWS X-Ray Documentation: https://docs.aws.amazon.com/xray/latest/devguide/aws-xray.html
Instrumenting your application: https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk.html
Viewing the Service Map: https://docs.aws.amazon.com/xray/latest/devguide/xray-console-service-map.html
Tracing Microservices with AWS X-Ray: https://aws.amazon.com/blogs/compute/tracing-microservices-aws-x-ray/
An application that is hosted on an Amazon EC2 instance needs access to files that are stored in an Amazon S3 bucket. The application lists the objects that are stored in the S3 bucket and displays a table to the user. During testing, a developer discovers that the application does not show any objects in the list.
What is the MOST secure way to resolve this issue?
- A . Update the IAM instance profile that is attached to the EC2 instance to include the S3:* permission for the S3 bucket.
- B . Update the IAM instance profile that is attached to the EC2 instance to include the S3:ListBucket permission for the S3 bucket.
- C . Update the developer’s user permissions to include the S3:ListBucket permission for the S3 bucket.
- D . Update the S3 bucket policy by including the S3:ListBucket permission and by setting the Principal element to specify the account number of the EC2 instance.
B
Explanation:
IAM instance profiles are containers for IAM roles that can be associated with EC2 instances. An IAM role is a set of permissions that grant access to AWS resources. An IAM role can be used to allow an EC2 instance to access an S3 bucket by including the appropriate permissions in the role’s policy. The S3:ListBucket permission allows listing the objects in an S3 bucket. By updating the IAM instance profile with this permission, the application on the EC2 instance can retrieve the objects from the S3 bucket and display them to the user.
Reference: Using an IAM role to grant permissions to applications running on Amazon EC2 instances
Which AWS service would you use to orchestrate microservices that include both containerized and serverless components?
- A . AWS Elastic Beanstalk
- B . AWS ECS and AWS Fargate
- C . AWS Step Functions
- D . Amazon EKS
A developer is updating an Amazon API Gateway REST API to have a mock endpoint. The developer wants to update the integration request mapping template so the endpoint will respond to mock integration requests with specific HTTP status codes based on various conditions.
- A . { if( $input.params(‘integration’) == "mock" ) "statusCode": 404 else "statusCode": 500 end }
- B . { if( $input.params(‘scope’) == "internal" ) "statusCode": 200 else "statusCode": 500 end }
- C . { if( $input.path("integration") ) "statusCode": 200 else "statusCode":404 end }
- D . { if( $context.integration.status ) "statusCode": 200 else "statusCode": 500 end }
D
Explanation:
Comprehensive Detailed Step by Step Explanation with All AWS Developer
Reference: In this scenario, the developer is configuring a mock integration in API Gateway. The integration request mapping template allows you to map the incoming request data to a format that the API expects. For mock integration, it’s common to return specific HTTP status codes based on the conditions.
Using $context.integration.status: The $context.integration.status variable refers to the status of the API Gateway integration, which is useful for generating responses based on the condition.
Option D
correctly uses this variable to determine the HTTP status code, returning 200 for a successful mock request or 500 for a failure.
Alternatives:
Options A, B, and C do not use the correct context variables for handling mock integrations. These options would not return the correct status codes based on the actual integration status.
Reference: API Gateway Mapping Templates and Accessing Context Variables
A developer created an AWS Lambda function to process data in an application. The function pulls large objects from an Amazon S3 bucket, processes the data, and loads the processed data into a second S3 bucket. Application users have reported slow response times. The developer checks the logs and finds that Lambda function invocations run much slower than expected. The function itself is simple and has a small deployment package. The function initializes quickly. The developer needs to improve the performance of the application.
Which solution will meet this requirement with the LEAST operational overhead?
- A . Store the data in an Amazon EFS file system. Mount the file system to a local directory in the function.
- B . Create an Amazon EventBridge rule to schedule invocations of the function every minute.
- C . Configure the function to use ephemeral storage. Upload the objects and process data in the /tmp directory.
- D . Create a Lambda layer to package the function dependencies. Add the layer to the function.
C
Explanation:
Configuring the Lambda function to use ephemeral storage and processing data in the /tmp directory improves performance by leveraging local storage during execution.
Why Option C is Correct:
Ephemeral Storage: Lambda provides temporary storage (up to 10 GB) in the /tmp directory for each invocation, which is faster than pulling data directly from S3 multiple times.
Performance Boost: Data can be downloaded to /tmp, processed locally, and uploaded to the destination S3 bucket, minimizing S3 network calls.
Low Overhead: This approach requires only minimal changes to the function’s configuration.
Why Not Other Options:
Option A: Using Amazon EFS adds complexity and is unnecessary for this use case.
Option B: Scheduling the function does not address the root cause of slow performance.
Option D: Lambda layers improve deployment efficiency, not runtime performance for this scenario.
Reference: Using Ephemeral Storage in AWS Lambda
Best Practices for S3 and Lambda Performance