Amazon DVA-C02 Practice Exams
Last updated on Oct 22,2026- Exam Code: DVA-C02
- Exam Name: AWS Certified Developer - Associate
- Certification Provider: Amazon
- Latest update: Oct 22,2026
A developer is designing an event-driven architecture. An AWS Lambda function that processes data needs to push processed data to a subset of four consumer Lambda functions. The data must be routed based on the value of one field in the data.
Which solution will meet these requirements with the LEAST operational overhead?
- A . Create an Amazon Simple Queue Service {Amazon SQS) queue and even! source mapping for each consumer Lambda function. Add message routing logic to the data-processing Lambda function.
- B . Create an Amazon Simple Notification Service (Amazon SNS) topic. Subscribe the four consumer Lambda functions to the topic. Add message filtering logic to each consumer Lambda function.
Subscribe the data-processing Lambda function to the SNS topic. - C . Create a separate Amazon Simple Notification Service (Amazon SNS) topic and subscription for each consumer Lambda function. Add message routing logic to the data-processing Lambda function to publish to the appropriate topic.
- D . Create a single Amazon Simple Notification Service {Amazon SNS) topic. Subscribe the four consumer Lambda functions to the topic. Add SNS subscription filter policies to each subscription. Configure the data-processing Lambda function to publish to the topic.
A developer is writing an application to analyze the traffic to a fleet of Amazon EC2 instances. The EC2 instances run behind a public Application Load Balancer (ALB). An HTTP server runs on each of the EC2 instances, logging all requests to a log file.
The developer wants to capture the client public IP addresses. The developer analyzes the log files and notices only the IP address of the ALB.
What must the developer do to capture the client public IP addresses in the log file?
- A . Add a Host header to the HTTP server log configuration file.
- B . Install the Amazon CloudWatch Logs agent on each EC2 instance. Configure the agent to write to the log file.
- C . Install the AWS X-Ray daemon on each EC2 instance. Configure the daemon to write to the log file.
- D . Add an X-Forwarded-For header to the HTTP server log configuration file.
A company is using Amazon OpenSearch Service to implement an audit monitoring system. A developer needs to create an AWS Cloudformation custom resource that is associated with an AWS Lambda function to configure the OpenSearch Service domain. The Lambda function must access the OpenSearch Service domain by using Open Search Service internal master user credentials.
What is the MOST secure way to pass these credentials to the Lambdas function?
- A . Use a CloudFormation parameter to pass the master user credentials at deployment to the OpenSearch Service domain’s MasterUserOptions and the Lambda function’s environment variable. Set the No Echo attenuate to true.
- B . Use a CloudFormation parameter to pass the master user credentials at deployment to the OpenSearch Service domain’s MasterUserOptions and to create a parameter. In AWS Systems Manager Parameter Store. Set the No Echo attribute to true. Create an 1AM role that has the ssm GetParameter permission. Assign me role to the Lambda function. Store me parameter name as the Lambda function’s environment variable. Resolve the parameter’s value at runtime.
- C . Use a CloudFormation parameter to pass the master uses credentials at deployment to the OpenSearch Service domain’s MasterUserOptions and the Lambda function’s environment varleWe Encrypt the parameters value by using the AWS Key Management Service (AWS KMS) encrypt command.
- D . Use CloudFoimalion to create an AWS Secrets Manager Secret. Use a CloudFormation dynamic reference to retrieve the secret’s value for the OpenSearch Service domain’s MasterUserOptions. Create an 1AM role that has the secrets manager. GetSecretvalue permission. Assign the role to the Lambda Function Store the secrets name as the Lambda function’s environment variable. Resole the secret’s value at runtime.
D
Explanation:
The solution that will meet the requirements is to use CloudFormation to create an AWS Secrets Manager secret. Use a CloudFormation dynamic reference to retrieve the secret’s value for the OpenSearch Service domain’s MasterUserOptions. Create an IAM role that has the secretsmanager:GetSecretValue permission. Assign the role to the Lambda function. Store the secret’s name as the Lambda function’s environment variable. Resolve the secret’s value at runtime. This way, the developer can pass the credentials to the Lambda function in a secure way, as AWS Secrets Manager encrypts and manages the secrets. The developer can also use a dynamic reference to avoid exposing the secret’s value in plain text in the CloudFormation template. The other options either involve passing the credentials as plain text parameters, which is not secure, or encrypting them with AWS KMS, which is less convenient than using AWS Secrets Manager.
Reference: Using dynamic references to specify template values
A developer has observed an increase in bugs in the AWS Lambda functions that a development team has deployed in its Node.js application.
To minimize these bugs, the developer wants to implement automated testing of Lambda functions in an environment that closely simulates the Lambda environment.
The developer needs to give other developers the ability to run the tests locally. The developer also needs to integrate the tests into the team’s continuous integration and continuous delivery (CI/CD) pipeline before the AWS Cloud Development Kit (AWS CDK) deployment.
Which solution will meet these requirements?
- A . Create sample events based on the Lambda documentation. Create automated test scripts that use the cdk local invoke command to invoke the Lambda functions. Check the response. Document the test scripts for the other developers on the team. Update the CI/CD pipeline to run the test scripts.
- B . Install a unit testing framework that reproduces the Lambda execution environment. Create sample events based on the Lambda documentation. Invoke the handler function by using a unit testing framework. Check the response. Document how to run the unit testing framework for the other developers on the team. Update the CI/CD pipeline to run the unit testing framework.
- C . Install the AWS Serverless Application Model (AWS SAM) CLI tool. Use the sam local generate-event command to generate sample events for the automated tests. Create automated test scripts that use the sam local invoke command to invoke the Lambda functions. Check the response. Document the test scripts for the other developers on the team. Update the CI/CD pipeline to run the test scripts.
- D . Create sample events based on the Lambda documentation. Create a Docker container from the Node.js base image to invoke the Lambda functions. Check the response. Document how to run the Docker container for the other developers on the team. Update the CllCD pipeline to run the Docker container.
C
Explanation:
The AWS Serverless Application Model Command Line Interface (AWS SAM CLI) is a command-line tool for local development and testing of Serverless applications3. The sam local generate-event command of AWS SAM CLI generates sample events for automated tests3. The sam local invoke command is used to invoke Lambda functions3. Therefore, option C is correct.
A software company is launching a multimedia application. The application will allow guest users to access sample content before the users decide if they want to create an account to gain full access. The company wants to implement an authentication process that can identify users who have already created an account. The company also needs to keep track of the number of guest users who eventually create an account.
Which combination of steps will meet these requirements? {Select TWO.)
- A . Create an Amazon Cognito user pool. Configure the user pool to allow unauthenticated users. Exchange user tokens for temporary credentials that allow authenticated users to assume a role.
- B . Create an Amazon Cognito identity pool. Configure the identity pool to allow unauthenticated users. Exchange unique identity for temporary credentials that allow all users to assume a role.
- C . Create an Amazon CloudFront distribution. Configure the distribution to allow unauthenticated users. Exchange user tokens for temporary credentials that allow all users to assume a role.
- D . Create a role for authenticated users that allows access to all content. Create a role for unauthenticated users that allows access to only the sample content.
- E . Allow all users to access the sample content by default. Create a role for authenticated users that allows access to the other content.
A developer is building an application that stores objects in an Amazon S3 bucket. The bucket does not have versioning enabled. The objects are accessed rarely after 1 week. However, the objects must be immediately available at all times. The developer wants to optimize storage costs for the S3 bucket.
Which solution will meet this requirement?
- A . Create an S3 Lifecycle rule to expire objects after 7 days.
- B . Create an S3 Lifecycle rule to transition objects to S3 Standard-Infrequent Access (S3 Standard-IA) after 7 days.
- C . Create an S3 Lifecycle rule to transition objects to S3 Glacier Flexible Retrieval after 7 days.
- D . Create an S3 Lifecycle rule to delete objects that have delete markers.
B
Explanation:
Comprehensive Detailed and Lengthy Step-by-Step Explanation with All AWS Developer
Reference: 1. Understanding the Use Case:
The goal is to store objects in an S3 bucket while optimizing storage costs. The key conditions are:
Objects are accessed infrequently after 1 week.
Objects must remain immediately accessible at all times.
A company is migrating legacy internal applications to AWS. Leadership wants to rewrite the internal employee directory to use native AWS services. A developer needs to create a solution for storing employee contact details and high-resolution photos for use with the new application.
Which solution will enable the search and retrieval of each employee’s individual details and high-resolution photos using AWS APIs?
- A . Encode each employee’s contact information and photos using Base64. Store the information in an Amazon DynamoDB table using a sort key.
- B . Store each employee’s contact information in an Amazon DynamoDB table along with the object keys for the photos stored in Amazon S3.
- C . Use Amazon Cognito user pools to implement the employee directory in a fully managed software-as-a-service (SaaS) method.
- D . Store employee contact information in an Amazon RDS DB instance with the photos stored in Amazon Elastic File System (Amazon EFS).
B
Explanation:
Amazon DynamoDB is a fully managed NoSQL database service that provides fast and consistent performance with seamless scalability. The developer can store each employee’s contact information in a DynamoDB table along with the object keys for the photos stored in Amazon S3. Amazon S3 is an object storage service that offers industry-leading scalability, data availability, security, and performance. The developer can use AWS APIs to search and retrieve the employee details and photos from DynamoDB and S3.
Reference: [Amazon DynamoDB]
[Amazon Simple Storage Service (S3)]
A developer uses AWS CloudFormation to deploy an Amazon API Gateway API and an AWS Step Functions state machine The state machine must reference the API Gateway API after the CloudFormation template is deployed The developer needs a solution that uses the state machine to reference the API Gateway endpoint.
Which solution will meet these requirements MOST cost-effectively?
- A . Configure the CloudFormation template to reference the API endpoint in the DefinitionSubstitutions property for the AWS StepFunctions StateMachme resource.
- B . Configure the CloudFormation template to store the API endpoint in an environment variable for the AWS::StepFunctions::StateMachine resourc Configure the state machine to reference the environment variable
- C . Configure the CloudFormation template to store the API endpoint in a standard AWS: SecretsManager Secret resource Configure the state machine to reference the resource
- D . Configure the CloudFormation template to store the API endpoint in a standard AWS::AppConfig;:ConfigurationProfile resource Configure the state machine to reference the resource.
A
Explanation:
CloudFormation and Dynamic
Reference: The DefinitionSubstitutions property in CloudFormation allows you to pass values into Step Functions state machines at runtime.
Cost-Effectiveness: This solution is cost-effective as it leverages CloudFormation’s built-in capabilities, avoiding the need for additional services like Secrets Manager or AppConfig.
Reference: AWS Step Functions State
Machine: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-stepfunctions-statemachine.html
CloudFormation DefinitionSubstitutions: https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-stepfunctions/issues/14
A developer needs to use a code template to create an automated deployment of an application
onto Amazon EC2 instances. The template must be configured to repeat deployment, installation,
and updates of resources for the application. The template must be able to create identical
environments and roll back to previous versions.
Which solution will meet these requirements?
- A . Use AWS Amplify for automatic deployment templates. Use a traffic-splitting deployment to copy any deployments. Modify any resources created by Amplify, if necessary.
- B . Use AWS CodeBuild for automatic deployment. Upload the required AppSpec file template. Save the appspec.yml file in the root directory folder of the revision. Specify the deployment group that includes the EC2 instances for the deployment.
- C . Use AWS CloudFormation to create an infrastructure template in JSON format to deploy the EC2 instances. Use Cloud Formation helper scripts to install the necessary software and to start the application. Call the scripts directly from the template.
- D . Use AWS AppSync to deploy the application. Upload the template as a GraphQL schema. Specify the EC2 instances for deployment of the application. Use resolvers as a version control mechanism and to make any updates to the deployments.
A developer is working on an app for a company that uses an Amazon DynamoDB table named
Orders to store customer orders. The table uses OrderlD as the partition key and there is no sort key. The table contains more than 100,000 records. The developer needs to add a functionality that will retrieve all Orders records that contain an OrderSource attribute with the MobileApp value.
Which solution will improve the user experience in the MOST efficient way?
- A . Perform a Scan operation on the Orders table. Provide a QueryFilter condition to filter to only the items where the OrderSource attribute is equal to the MobileApp value.
- B . Create a local secondary index (LSI) with OrderSource as the partition key. Perform a Query operation by using MobileApp as the key.
- C . Create a global secondary index (GSI) with OrderSource as the sort key. Perform a Query operation by using MobileApp as the key.
- D . Create a global secondary index (GSI) with OrderSource as the partition key. Perform a Query operation by using MobileApp as the key.
D
Explanation:
Requirement Summary:
DynamoDB table Orders
Partition key: OrderID
No sort key
100,000+ records
Need to efficiently retrieve all records where:
OrderSource = "MobileApp"
Must optimize for user experience (i.e., performance)
Evaluate Options:
Option A: Scan with FilterExpression
❌ Inefficient for large tables
A Scan reads every item in the table and then applies a filter condition. This is slow, expensive, and not scalable as the dataset grows.
Option B: Create a Local Secondary Index (LSI) with OrderSource
❌ Invalid: LSIs require the same partition key (OrderID) as the base table.
Since OrderSource is not part of the primary key, and we want to query based on it, LSI won’t help.
Option C: Create a GSI with OrderSource as the sort key
❌ Misuse of sort key: Querying by sort key alone is not allowed in DynamoDB. You must specify a partition key in a Query.
This design is not valid for the use case.
Option D: Create a GSI with OrderSource as the partition key
✅✅ BEST CHOICE: With a GSI on OrderSource, you can query efficiently for all items where OrderSource = "MobileApp".
DynamoDB GSIs allow an alternative access pattern for queries not supported by the base table schema.
GSI Design: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.html
Querying a GSI:
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html
Scan vs Query: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-query-scan.html