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 company has developed an application that uses AWS Lambda functions to process messages from an Amazon SQS queue. One of the Lambda functions makes a call to an external API that is expected to encounter temporary service unavailability.
A developer needs to configure the function to retry failed messages from an Amazon SQS dead-letter queue. The developer notices that the Lambda function is re-processing some messages in the queue more than once.
Which solution will resolve this issue?
- A . Set a message retention period for each message. Configure the Lambda function to add a MessageId to each message.
- B . Set the visibility timeout parameter at the queue level. Configure the Lambda function to delete processed messages from the queue.
- C . Set a receive message wait time for each message. Configure the Lambda function to add a MessageId to each message.
- D . Set the delivery delay parameter at the queue level. Configure the Lambda function to delete processed messages from the queue.
B
Explanation:
Why Option B is Correct:
Setting the visibility timeout ensures that once a message is being processed, it is temporarily hidden from other consumers. The Lambda function must delete processed messages to avoid re-processing when the visibility timeout expires.
Why Other Options are Incorrect:
Option A: Message retention affects how long messages stay in the queue, not how they are processed.
Option C: Receive message wait time optimizes long polling but does not prevent re-processing.
Option D: Delivery delay introduces latency for new messages and does not address message re-processing.
AWS Documentation
Reference: Using SQS Visibility Timeout
A developer deployed an application to an Amazon EC2 instance. The application needs to know the public IPv4 address of the instance
How can the application find this information?
- A . Query the instance metadata from http./M69.254.169.254. latestmeta-data/.
- B . Query the instance user data from http ‘169 254.169 254. latest/user-data/
- C . Query the Amazon Machine Image (AMI) information from http://169.254.169.254/latest/meta-data/ami/.
- D . Check the hosts file of the operating system
A
Explanation:
Instance Metadata Service: EC2 instances have access to an internal metadata service. It provides instance-specific information like instance ID, security groups, and public IP address. Accessing Metadata:
Make an HTTP GET request to the base URL: http://169.254.169.254/latest/meta-data/
You’ll get a list of available categories. The public IPv4 address is under public-ipv4.
Reference: Instance Metadata and User
Data: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
A company needs to package and deploy an application that uses AWS Lambda to compress and decompress video clips. The application uses a video codec library that is larger than 250 MB. The application uses the library to compress the videos before storage and to decompress the videos upon retrieval.
- A . Create one Lambda function. Upload one zip file that contains code to handle video compression and decompression to the function. Include the codec library in the zip file.
- B . Create two Lambda functions. Upload one zip file that contains code to handle video compression to one function. Upload a second zip file that contains code for video decompression to the second function. Include the codec library in both zip files.
- C . Create two Lambda functions. Upload one zip file that contains code to handle video compression to one function. Upload a second zip file that contains code for video decompression to the second function. Create one Lambda layer for the codec library. Add the layer to both functions.
- D . Create two Lambda functions. Build one container image that contains code to handle video compression and a second image that contains video decompression code. Add the codec library to both images. Upload the images to Amazon ECR. Use the containers to create the Lambda functions.
D
Explanation:
Comprehensive and Detailed Step-by-Step
Option D: Use Lambda with Container Images
AWS Lambda supports container images up to 10 GB in size, making it suitable for applications with large dependencies, such as a video codec library larger than 250 MB.
By creating separate container images for video compression and decompression, the application can efficiently isolate functionality while ensuring that each function includes the required dependencies.
The container images are stored in Amazon ECR and used to create the Lambda functions.
Why Other Options Are Incorrect:
Option A: A single Lambda function with all functionalities and dependencies in one zip file is not feasible due to the 250 MB deployment package size limit for zip files.
Option B: Including the library in two separate zip files still exceeds the size limit for Lambda zip deployment packages.
Option C: While using a Lambda layer can reduce redundancy, the combined size of the layer and the
zip files would exceed the limit of 250 MB.
Reference: Using Container Images with AWS Lambda
A company is developing an application that will be accessed through the Amazon API Gateway REST API. Registered users should be the only ones who can access certain resources of this API. The token being used should expire automatically and needs to be refreshed periodically.
How can a developer meet these requirements?
- A . Create an Amazon Cognito identity pool, configure the Amazon Cognito Authorizer in API Gateway, and use the temporary credentials generated by the identity pool.
- B . Create and maintain a database record for each user with a corresponding token and use an AWS Lambda authorizer in API Gateway.
- C . Create an Amazon Cognito user pool, configure the Cognito Authorizer in API Gateway, and use the identity or access token.
- D . Create an 1AM user for each API user, attach an invoke permissions policy to the API. and use an I AM authorizer in API Gateway.
A developer is designing a serverless application for a game in which users register and log in through a web browser The application makes requests on behalf of users to a set of AWS Lambda functions that run behind an Amazon API Gateway HTTP API
The developer needs to implement a solution to register and log in users on the application’s sign-in page. The solution must minimize operational overhead and must minimize ongoing management of user identities.
Which solution will meet these requirements?
- A . Create Amazon Cognito user pools for external social identity providers Configure 1AM roles for the identity pools.
- B . Program the sign-in page to create users’ 1AM groups with the 1AM roles attached to the groups
- C . Create an Amazon RDS for SQL Server DB instance to store the users and manage the permissions to the backend resources in AWS
- D . Configure the sign-in page to register and store the users and their passwords in an Amazon DynamoDB table with an attached IAM policy.
A
Explanation:
Amazon Cognito User Pools: A managed user directory service, simplifying user registration and login.
Social Identity Providers: Cognito supports integration with external providers (e.g., Google, Facebook), reducing development effort.
IAM Roles for Authorization: Cognito-managed IAM roles grant fine-grained access to AWS resources (like Lambda functions).
Operational Overhead: Cognito minimizes the need to manage user identities and credentials independently.
Reference: Amazon Cognito Documentation https://docs.aws.amazon.com/cognito/ Cognito User Pools for Web
Applications: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-app-integration.html
A developer is creating an AWS CloudFormation template to deploy Amazon EC2 instances across multiple AWS accounts. The developer must choose the EC2 instances from a list of approved instance types.
How can the developer incorporate the list of approved instance types in the CloudFormation template?
- A . Create a separate CloudFormation template for each EC2 instance type in the list.
- B . In the Resources section of the CloudFormation template, create resources for each EC2 instance type in the list.
- C . In the CloudFormation template, create a separate parameter for each EC2 instance type in the list.
- D . In the CloudFormation template, create a parameter with the list of EC2 instance types as AllowedValues.
D
Explanation:
In the CloudFormation template, the developer should create a parameter with the list of approved EC2 instance types as AllowedValues. This way, users can select the instance type they want to use when launching the CloudFormation stack, but only from the approved list.
A developer is creating an AWS Lambda function that consumes messages from an Amazon Simple Queue Service (Amazon SQS) standard queue. The developer notices that the Lambda function processes some messages multiple times.
How should developer resolve this issue MOST cost-effectively?
- A . Change the Amazon SQS standard queue to an Amazon SQS FIFO queue by using the Amazon SQS message deduplication ID.
- B . Set up a dead-letter queue.
- C . Set the maximum concurrency limit of the AWS Lambda function to 1
- D . Change the message processing to use Amazon Kinesis Data Streams instead of Amazon SQS.
A
Explanation:
Amazon Simple Queue Service (Amazon SQS) is a fully managed queue service that allows you to de-couple and scale for applications1. Amazon SQS offers two types of queues: Standard and FIFO (First In First Out) queues1. The FIFO queue uses the messageDeduplicationId property to treat messages with the same value as duplicate2. Therefore, changing the Amazon SQS standard queue to an Amazon SQS FIFO queue using the Amazon SQS message deduplication ID can help resolve the issue of the Lambda function processing some messages multiple times. Therefore, option A is correct.
An application that runs on AWS Lambda requires access to specific highly confidential objects in an Amazon S3 bucket. In accordance with the principle of least privilege a company grants access to the S3 bucket by using only temporary credentials.
How can a developer configure access to the S3 bucket in the MOST secure way?
- A . Hardcode the credentials that are required to access the S3 objects in the application code. Use the credentials to access me required S3 objects.
- B . Create a secret access key and access key ID with permission to access the S3 bucket. Store the key and key ID in AWS Secrets Manager. Configure the application to retrieve the Secrets Manager secret and use the credentials to access me S3 objects.
- C . Create a Lambda function execution role Attach a policy to the rote that grants access to specific objects in the S3 bucket.
- D . Create a secret access key and access key ID with permission to access the S3 bucket Store the key and key ID as environment variables m Lambda. Use the environment variables to access the required S3 objects.
C
Explanation:
This solution will meet the requirements by creating a Lambda function execution role, which is an IAM role that grants permissions to a Lambda function to access AWS resources such as Amazon S3 objects. The developer can attach a policy to the role that grants access to specific objects in the S3 bucket that are required by the application, following the principle of least privilege.
Option A is not optimal because it will hardcode the credentials that are required to access S3 objects in the application code, which is insecure and difficult to maintain.
Option B is not optimal because it will create a secret access key and access key ID with permission to access the S3 bucket, which will introduce additional security risks and complexity for storing and managing credentials.
Option D is not optimal because it will store the secret access key and access key ID as environment variables in Lambda, which is also insecure and difficult to maintain.
Reference: [AWS Lambda Execution Role], [Using AWS Lambda with Amazon S3]
A developer is using AWS Amplify Hosting to build and deploy an application. The developer is receiving an increased number of bug reports from users. The developer wants to add end-to-end testing to the application to eliminate as many bugs as possible before the bugs reach production.
Which solution should the developer implement to meet these requirements?
- A . Run the amplify add test command in the Amplify CLI.
- B . Create unit tests in the application. Deploy the unit tests by using the amplify push command in the Amplify CLI.
- C . Add a test phase to the amplify.yml build settings for the application.
- D . Add a test phase to the aws-exports.js file for the application.
C
Explanation:
The solution that will meet the requirements is to add a test phase to the amplify.yml build settings for the application. This way, the developer can run end-to-end tests on every code commit and catch any bugs before deploying to production. The other options either do not support end-to-end testing, or do not run tests automatically.
Reference: End-to-end testing
A developer is using an AWS CloudFormation template to create a pipeline in AWS CodePipeline. The template creates an Amazon S3 bucket that the pipeline references in a source stage. The template also creates an AWS CodeBuild project for a build stage. The pipeline sends notifications to an Amazon SNS topic. Logs for the CodeBuild project are stored in Amazon CloudWatch Logs.
The company needs to ensure that the pipeline’s artifacts are encrypted with an existing customer-managed AWS KMS key. The developer has granted the pipeline permissions to use the KMS key.
Which additional step will meet these requirements?
- A . Create an Amazon S3 gateway endpoint that the pipeline can access.
- B . In the CloudFormation template, use the KMS key to encrypt the logs in CloudWatch Logs.
- C . Apply an S3 bucket policy that ensures the pipeline sends only encrypted objects to the S3 bucket.
- D . Configure the notification topic to use the existing KMS key to enable encryption with the existing
KMS key.
C
Explanation:
Why Option C is Correct:
Ensuring that pipeline artifacts are encrypted with a customer-managed AWS KMS key involves configuring the S3 bucket policy to require encryption. This policy ensures all objects uploaded to the bucket are encrypted with the specified KMS key.
Why Other Options are Incorrect:
Option A: A gateway endpoint improves S3 access efficiency but does not enforce encryption.
Option B: Encrypting CloudWatch Logs is unrelated to securing pipeline artifacts.
Option D: Configuring SNS for encryption does not affect the artifacts stored in the S3 bucket.
AWS Documentation
Reference: Using Server-Side Encryption with S3 Bucket Policies