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 team is developing an application that is deployed on Amazon EC2 instances. During testing, the team receives an error. The EC2 instances are unable to access an Amazon S3 bucket.
Which steps should the team take to troubleshoot this issue? (Select TWO.)
- A . Check whether the policy that is assigned to the JAM role that is attached to the EC2 instances grants access to Amazon S3.
- B . Check the S3 bucket policy to validate the access permissions for the S3 bucket.
- C . Check whether the policy that is assigned to the 1AM user that is attached to the EC2 instances grants access to Amazon S3.
- D . Check the S3 Lifecycle policy to validate the permissions that are assigned to the S3 bucket.
- E . Check the security groups that are assigned to the EC2 instances. Make sure that a rule is not blocking the access to Amazon S3.
A development learn has an Amazon API Gateway REST API that is backed by an AWS Lambda function.
Users have reported performance issues for the Lambda function. The development team identified the source of the issues as a cold start of the Lambda function. The development team needs to reduce the time needed for the Lambda function to initialize.
Which solution will meet this requirement?
- A . Change the Lambda concurrency lo reserved concurrency.
- B . Increase the timeout of the Lambda function.
- C . Increase the memory allocation of the Lambda function.
- D . Configure provisioned concurrency for the Lambda function.
A developer is creating a serverless application that uses an AWS Lambda function. The developer will use AWS CloudFormation to deploy the application The application will write logs to Amazon CloudWatch Logs The developer has created a log group in a CloudFormation template for the application to use The developer needs to modify the CloudFormation template to make the name of the log group available to the application at runtime.
Which solution will meet this requirement?
- A . Use the AWS: lnclude transform in CloudFormation to provide the log group’s name to the application
- B . Pass the log group’s name to the application in the user data section of the CloudFormation template.
- C . Use the CloudFormation template’s Mappings section to specify the log group’s name for the application.
- D . Pass the log group’s Amazon Resource Name (ARN) as an environment variable to the Lambda function
D
Explanation:
CloudFormation and Lambda Environment Variables:
CloudFormation is an excellent tool to manage infrastructure as code, including the log group resource.
Lambda functions can access environment variables at runtime, making them a suitable way to pass
configuration information like the log group ARN.
CloudFormation Template Modification:
In your CloudFormation template, define the log group resource.
In the Lambda function resource, add an Environment section:
YAML
Environment:
Variables:
LOG_GROUP_ARN: !Ref LogGroupResourceName
Use code with caution.
content_copy
The !Ref intrinsic function retrieves the log group’s ARN, which CloudFormation generates during stack creation.
Using the ARN in Your Lambda Function:
Within your Lambda code, access the LOG_GROUP_ARN environment variable.
Configure your logging library (e.g., Python’s logging module) to send logs to the specified log group.
Reference: AWS Lambda Environment
Variables: https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html
CloudFormation !Ref Intrinsic
Function: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html
A developer has an application that makes batch requests directly to Amazon DynamoDB by using the BatchGetItem low-level API operation. The responses frequently return values in the UnprocessedKeys element.
Which actions should the developer take to increase the resiliency of the application when the batch response includes values in UnprocessedKeys? (Choose two.)
- A . Retry the batch operation immediately.
- B . Retry the batch operation with exponential backoff and randomized delay.
- C . Update the application to use an AWS software development kit (AWS SDK) to make the requests.
- D . Increase the provisioned read capacity of the DynamoDB tables that the operation accesses.
- E . Increase the provisioned write capacity of the DynamoDB tables that the operation accesses.
B, C
Explanation:
The UnprocessedKeys element indicates that the BatchGetItem operation did not process all of the requested items in the current response. This can happen if the response size limit is exceeded or if the table’s provisioned throughput is exceeded. To handle this situation, the developer should retry the batch operation with exponential backoff and randomized delay to avoid throttling errors and reduce the load on the table. The developer should also use an AWS SDK to make the requests, as the SDKs automatically retry requests that return UnprocessedKeys.
Reference: [BatchGetItem – Amazon DynamoDB]
[Working with Queries and Scans – Amazon DynamoDB] [Best Practices for Handling DynamoDB Throttling Errors]
An application uses an Amazon EC2 Auto Scaling group. A developer notices that EC2 instances are taking a long time to become available during scale-out events. The UserData script is taking a long time to run.
The developer must implement a solution to decrease the time that elapses before an EC2 instance becomes available. The solution must make the most recent version of the application available at all times and must apply all available security updates. The solution also must minimize the number of images that are created. The images must be validated.
Which combination of steps should the developer take to meet these requirements? (Choose two.)
- A . Use EC2 Image Builder to create an Amazon Machine Image (AMI). Install all the patches and agents that are needed to manage and run the application. Update the Auto Scaling group launch configuration to use the AMI.
- B . Use EC2 Image Builder to create an Amazon Machine Image (AMI). Install the latest version of the
application and all the patches and agents that are needed to manage and run the application.
Update the Auto Scaling group launch configuration to use the AMI. - C . Set up AWS CodeDeploy to deploy the most recent version of the application at runtime.
- D . Set up AWS CodePipeline to deploy the most recent version of the application at runtime.
- E . Remove any commands that perform operating system patching from the UserData script.
BE
Explanation:
AWS CloudFormation is a service that enables developers to model and provision AWS resources using templates. The developer can use the following steps to avoid accidental database deletion in the future:
Set up AWS CodeDeploy to deploy the most recent version of the application at runtime. This will ensure that the application code is always up to date and does not depend on the AMI.
Remove any commands that perform operating system patching from the UserData script. This will reduce the time that the UserData script takes to run and speed up the instance launch process.
Reference: [What Is AWS CloudFormation? – AWS CloudFormation]
[What Is AWS CodeDeploy? – AWS CodeDeploy]
[Running Commands on Your Linux Instance at Launch – Amazon Elastic Compute Cloud]
A developer is receiving an intermittent ProvisionedThroughputExceededException error from an application that is based on Amazon DynamoDB. According to the Amazon CloudWatch metrics for the table, the application is not exceeding the provisioned throughput.
What could be the cause of the issue?
- A . The DynamoDB table storage size is larger than the provisioned size.
- B . The application is exceeding capacity on a particular hash key.
- C . The DynamoDB table is exceeding the provisioned scaling operations.
- D . The application is exceeding capacity on a particular sort key.
B
Explanation:
DynamoDB distributes throughput across partitions based on the hash key. A hot partition (caused by
high usage of a specific hash key) can result in a ProvisionedThroughputExceededException, even if
overall usage is below the provisioned capacity.
Why Option B is Correct:
Partition-Level Limits: Each partition has a limit of 3,000 read capacity units or 1,000 write capacity units per second.
Hot Partition: Excessive use of a single hash key can overwhelm its partition.
Why Not Other Options:
Option A: DynamoDB storage size does not affect throughput.
Option C: Provisioned scaling operations are unrelated to throughput errors.
Option D: Sort keys do not impact partition-level throughput.
Reference: DynamoDB Partition Key Design Best Practices
A company is running a custom application on a set of on-premises Linux servers that are accessed using Amazon API Gateway. AWS X-Ray tracing has been enabled on the API test stage.
How can a developer enable X-Ray tracing on the on-premises servers with the LEAST amount of configuration?
- A . Install and run the X-Ray SDK on the on-premises servers to capture and relay the data to the X-Ray service.
- B . Install and run the X-Ray daemon on the on-premises servers to capture and relay the data to the X-Ray service.
- C . Capture incoming requests on-premises and configure an AWS Lambda function to pull, process, and relay relevant data to X-Ray using the PutTraceSegments API call.
- D . Capture incoming requests on-premises and configure an AWS Lambda function to pull, process, and relay relevant data to X-Ray using the PutTelemetryRecords API call.
B
Explanation:
The X-Ray daemon is a software that collects trace data from the X-Ray SDK and relays it to the X-Ray service. The X-Ray daemon can run on any platform that supports Go, including Linux, Windows, and macOS. The developer can install and run the X-Ray daemon on the on-premises servers to capture and relay the data to the X-Ray service with minimal configuration. The X-Ray SDK is used to instrument the application code, not to capture and relay data. The Lambda function solutions are more complex and require additional configuration.
Reference: [AWS X-Ray concepts – AWS X-Ray]
[Setting up AWS X-Ray – AWS X-Ray]
A developer is testing a new file storage application that uses an Amazon CloudFront distribution to serve content from an Amazon S3 bucket. The distribution accesses the S3 bucket by using an origin access identity (OAI). The S3 bucket’s permissions explicitly deny access to all other users.
The application prompts users to authenticate on a login page and then uses signed cookies to allow users to access their personal storage directories. The developer has configured the distribution to use its default cache behavior with restricted viewer access and has set the origin to point to the S3 bucket. However, when the developer tries to navigate to the login page, the developer receives a 403 Forbidden error.
The developer needs to implement a solution to allow unauthenticated access to the login page. The
solution also must keep all private content secure.
Which solution will meet these requirements?
- A . Add a second cache behavior to the distribution with the same origin as the default cache behavior. Set the path pattern for the second cache behavior to the path of the login page, and make viewer access unrestricted. Keep the default cache behavior’s settings unchanged.
- B . Add a second cache behavior to the distribution with the same origin as the default cache behavior. Set the path pattern for the second cache behavior to *, and make viewer access restricted. Change the default cache behavior’s path pattern to the path of the login page, and make viewer access unrestricted.
- C . Add a second origin as a failover origin to the default cache behavior. Point the failover origin to the S3 bucket. Set the path pattern for the primary origin to *, and make viewer access restricted. Set the path pattern for the failover origin to the path of the login page, and make viewer access unrestricted.
- D . Add a bucket policy to the S3 bucket to allow read access. Set the resource on the policy to the Amazon Resource Name (ARN) of the login page object in the S3 bucket. Add a CloudFront function to the default cache behavior to redirect unauthorized requests to the login page’s S3 URL.
A
Explanation:
The solution that will meet the requirements is to add a second cache behavior to the distribution with the same origin as the default cache behavior. Set the path pattern for the second cache behavior to the path of the login page, and make viewer access unrestricted. Keep the default cache behavior’s settings unchanged. This way, the login page can be accessed without authentication, while all other content remains secure and requires signed cookies. The other options either do not allow unauthenticated access to the login page, or expose private content to unauthorized users.
Reference: Restricting Access to Amazon S3 Content by Using an Origin Access Identity
A developer needs to retrieve all data from an Amazon DynamoDB table that matches a particular partition key.
Which solutions will meet this requirement in the MOST operationally efficient way? (Select TWO.)
- A . Use the Scan API and a filter expression to match on the key.
- B . Use the GetItem API with a request parameter for key that contains the partition key name and specific key value.
- C . Use the ExecuteStatement API and a filter expression to match on the key.
- D . Use the GetItem API and a PartiQL statement to match on the key.
- E . Use the ExecuteStatement API and a PartiQL statement to match on the key.
An online food company provides an Amazon API Gateway HTTP API 1o receive orders for partners. The API is integrated with an AWS Lambda function. The Lambda function stores the orders in an Amazon DynamoDB table.
The company expects to onboard additional partners Some to me panthers require additional Lambda function to receive orders. The company has created an Amazon S3 bucket. The company needs 10 store all orders and updates m the S3 bucket for future analysis
How can the developer ensure that an orders and updates are stored to Amazon S3 with the LEAST development effort?
- A . Create a new Lambda function and a new API Gateway API endpoint. Configure the new Lambda function to write to the S3 bucket. Modify the original Lambda function to post updates to the new
API endpoint. - B . Use Amazon Kinesis Data Streams to create a new data stream. Modify the Lambda function to publish orders to the oats stream Configure in data stream to write to the S3 bucket.
- C . Enable DynamoDB Streams on me DynamoOB table. Create a new lambda function. Associate the stream’s Amazon Resource Name (ARN) with the Lambda Function Configure the Lambda function to write to the S3 bucket as records appear in the table’s stream.
- D . Modify the Lambda function to punish to a new Amazon. Simple Lambda function receives orders. Subscribe a new Lambda function to the topic. Configure the new Lambda function to write to the S3 bucket as updates come through the topic.
C
Explanation:
This solution will ensure that all orders and updates are stored to Amazon S3 with the least development effort because it uses DynamoDB Streams to capture changes in the DynamoDB table and trigger a Lambda function to write those changes to the S3 bucket. This way, the original Lambda function and API Gateway API endpoint do not need to be modified, and no additional services are required.
Option A is not optimal because it will require more development effort to create a new Lambda function and a new API Gateway API endpoint, and to modify the original Lambda function to post updates to the new API endpoint.
Option B is not optimal because it will introduce additional costs and complexity to use Amazon Kinesis Data Streams to create a new data stream, and to modify the Lambda function to publish orders to the data stream.
Option D is not optimal because it will require more development effort to modify the Lambda function to publish to a new Amazon SNS topic, and to create and subscribe a new Lambda function to the topic.
Reference: Using DynamoDB Streams, Using AWS Lambda with Amazon S3