AWS Certified Developer - Associate (DVA-C02) — Free Practice Questions
10 free sample questions from a bank of 747, with the correct answers and explanations. No signup required — start practising right now.
1A company is implementing an application on Amazon EC2 instances. The application needs to process incoming transactions. When the application detects a transaction that is not valid, the application must send a chat message to the company's support team. To send the message, the application needs to retrieve the access token to authenticate by using the chat API.
A developer needs to implement a solution to store the access token. The access token must be encrypted at rest and in transit. The access token must also be accessible from other AWS accounts.
Which solution will meet these requirements with the LEAST management overhead?
Use an AWS Systems Manager Parameter Store SecureString parameter that uses an AWS Key Management Service (AWS KMS) AWS managed key to store the access token. Add a resource-based policy to the parameter to allow access from other accounts. Update the IAM role of the EC2 instances with permissions to access Parameter Store. Retrieve the token from Parameter Store with the decrypt flag enabled. Use the decrypted access token to send the message to the chat.
Encrypt the access token by using an AWS Key Management Service (AWS KMS) customer managed key. Store the access token in an Amazon DynamoDB table. Update the IAM role of the EC2 instances with permissions to access DynamoDB and AWS KMS. Retrieve the token from DynamoDDecrypt the token by using AWS KMS on the EC2 instances. Use the decrypted access token to send the message to the chat.
Use AWS Secrets Manager with an AWS Key Management Service (AWS KMS) customer managed key to store the access token. Add a resource-based policy to the secret to allow access from other accounts. Update the IAM role of the EC2 instances with permissions to access Secrets Manager. Retrieve the token from Secrets Manager. Use the decrypted access token to send the message to the chat.
Encrypt the access token by using an AWS Key Management Service (AWS KMS) AWS managed key. Store the access token in an Amazon S3 bucket. Add a bucket policy to the S3 bucket to allow access from other accounts. Update the IAM role of the EC2 instances with permissions to access Amazon S3 and AWS KMS. Retrieve the token from the S3 bucket. Decrypt the token by using AWS KMS on the EC2 instances. Use the decrypted access token to send the massage to the chat.
Answer: C
The short version
C — Secrets Manager with customer key and resource policy fits best. It encrypts at rest and in transit, shares across accounts, and needs least upkeep.
Key concepts in this question
Secrets Manager: managed rotation, retrieval, and cross-account sharing for tokens and credentials with built-in encryption.
Resource-based policy: secret policy granting other AWS accounts direct retrieval without custom replication.
Least management overhead: preference for managed retrieval and decryption over hand-rolled DynamoDB, S3, or Parameter Store plumbing.
Why C is correct
C is correct because Secrets Manager encrypts the token at rest with the customer managed key and in transit via TLS, while automatic SDK decryption simplifies EC2 code. Its resource policy natively allows other accounts to retrieve the same secret, satisfying multi-account access. IAM role permissions plus managed rotation and auditing make this the lowest-overhead compliant path.
Why the others are wrong
A. Parameter Store with AWS managed key cannot easily share across accounts because AWS managed keys block cross-account use.
B. DynamoDB plus manual KMS encrypt and decrypt adds table management and custom crypto code overhead.
D. S3 plus AWS managed key adds bucket policy complexity and manual decrypt handling with higher upkeep.
DVA-C02 exam tip
Choose Secrets Manager for cross-account secrets: customer key plus resource policy beats Parameter Store and DIY stores.
2A company is running Amazon EC2 instances in multiple AWS accounts. A developer needs to implement an application that collects all the lifecycle events of the EC2 instances. The application needs to store the lifecycle events in a single Amazon Simple Queue Service (Amazon SQS) queue in the company's main AWS account for further processing.
Which solution will meet these requirements?
Configure Amazon EC2 to deliver the EC2 instance lifecycle events from all accounts to the Amazon EventBridge event bus of the main account. Add an EventBridge rule to the event bus of the main account that matches all EC2 instance lifecycle events. Add the SQS queue as a target of the rule.
Use the resource policies of the SQS queue in the main account to give each account permissions to write to that SQS queue. Add to the Amazon EventBridge event bus of each account an EventBridge rule that matches all EC2 instance lifecycle events. Add the SQS queue in the main account as a target of the rule.
Write an AWS Lambda function that scans through all EC2 instances in the company accounts to detect EC2 instance lifecycle changes. Configure the Lambda function to write a notification message to the SQS queue in the main account if the function detects an EC2 instance lifecycle change. Add an Amazon EventBridge scheduled rule that invokes the Lambda function every minute.
Configure the permissions on the main account event bus to receive events from all accounts. Create an Amazon EventBridge rule in each account to send all the EC2 instance lifecycle events to the main account event bus. Add an EventBridge rule to the main account event bus that matches all EC2 instance lifecycle events. Set the SQS queue as a target for the rule.
Answer: D
The short version
D — forward each account bus to the main bus, then route to SQS. Central rule matches lifecycle events and delivers to the single queue.
Key concepts in this question
EventBridge event buses: account-level routers for AWS service events including EC2 lifecycle notifications.
Cross-account forwarding: permission on the main bus plus per-account rules sending events to the central bus.
Rule matching: main-account rule filtering EC2 lifecycle detail types before delivery to targets.
SQS central target: single queue in the main account aggregating events for downstream processing.
Why D is correct
D is correct because EC2 lifecycle events originate in each member account and must traverse to the main account bus for centralization. Granting the main bus receive permission plus creating sender rules in every account establishes the fan-in path. A final rule on the main bus matching lifecycle events with the SQS queue as target completes aggregation without polling or custom relays.
Why the others are wrong
A. EC2 cannot deliver directly to another account bus without sender rules, so direct fan-in fails.
B. EventBridge cannot target a cross-account SQS queue directly from member rules without the central bus pattern.
C. Minute polling with Lambda scanning all instances adds latency, cost, and missed events versus event routing.
DVA-C02 exam tip
Centralize with bus-to-bus: sender rules in each account plus one matching rule on the main bus feeding SQS.
3An application is using Amazon Cognito user pools and identity pools for secure access. A developer wants to integrate the user-specific file upload and download features in the application with Amazon S3. The developer must ensure that the files are saved and retrieved in a secure manner and that users can access only their own files. The file sizes range from 3 KB to 300 MB.
Which option will meet these requirements with the HIGHEST level of security?
Use S3 Event Notifications to validate the file upload and download requests and update the user interface (UI).
Save the details of the uploaded files in a separate Amazon DynamoDB table. Filter the list of files in the user interface (UI) by comparing the current user ID with the user ID associated with the file in the table.
Use Amazon API Gateway and an AWS Lambda function to upload and download files. Validate each request in the Lambda function before performing the requested operation.
Use an IAM policy within the Amazon Cognito identity prefix to restrict users to use their own folders in Amazon S3.
Answer: D
The short version
D — Cognito identity prefix with user-isolated S3 folders is most secure. IAM policy scoping by identity ID enforces per-user boundaries natively.
Key concepts in this question
Cognito user versus identity pools: user pools authenticate, identity pools vend temporary AWS credentials for resource access.
IAM policy variables: cognito-identity dot amazonaws dot com colon sub placeholder resolving to the caller identity ID.
S3 prefix isolation: folder per user such as private slash identity-ID restricting List and Get to owned objects.
Highest security requirement: enforcement at the storage and IAM layer rather than UI filtering or proxy validation.
Why D is correct
D is correct because an IAM policy attached to the Cognito identity role can condition S3 access to the caller own prefix, blocking cross-user reads even if app logic errs. This scales from 3 KB to 300 MB without proxy bandwidth limits and applies to every S3 API call. Native IAM enforcement therefore delivers stronger guarantees than UI filtering, event checks, or gateway proxies.
Why the others are wrong
A. Event Notifications react after upload and cannot authorize downloads or isolate user prefixes.
B. DynamoDB list filtering is UI-level and bypassable by direct S3 calls outside the interface.
C. API Gateway plus Lambda proxy adds hop cost and still relies on custom code rather than IAM boundaries.
DVA-C02 exam tip
Isolate by identity prefix: Cognito sub plus S3 folder policy is the highest-security user-files pattern.
4A company is building a scalable data management solution by using AWS services to improve the speed and agility of development. The solution will ingest large volumes of data from various sources and will process this data through multiple business rules and transformations.
The solution requires business rules to run in sequence and to handle reprocessing of data if errors occur when the business rules run. The company needs the solution to be scalable and to require the least possible maintenance.
Which AWS service should the company use to manage and automate the orchestration of the data flows to meet these requirements?
AWS Batch
AWS Step Functions
AWS Glue
AWS Lambda
Answer: B
The short version
B — Step Functions orchestrates sequenced rules with retries and scale. It chains business logic, handles reprocessing, and stays serverless.
Key concepts in this question
Sequential orchestration: running business rules in order with state passing and conditional branching.
Error reprocessing: retry, catch, and replay of failed steps without rebuilding pipeline scaffolding.
Serverless scaling: Step Functions scaling transitions automatically while compute runs in Lambda or integrated services.
Least maintenance: managed state machine versus self-managed batch clusters or custom Lambda chaining.
Why B is correct
B is correct because Step Functions models each business rule as a state, enforces sequence, and natively supports retries and dead-path routing for error reprocessing. It scales with data volume and integrates with Glue, Lambda, and Batch without server management. This matches scalable orchestration with minimal upkeep better than raw compute options.
Why the others are wrong
A. Batch schedules container jobs but lacks native sequential rule orchestration and replay semantics.
C. Glue excels at ETL cataloging and transforms but is not a general ordered workflow orchestrator.
D. Lambda alone provides compute, requiring custom code for sequencing, state, and reprocessing.
DVA-C02 exam tip
Pick Step Functions for sequence plus replay: ordered rules needing reprocessing mean state-machine orchestration.
5A developer has created an AWS Lambda function that is written in Python. The Lambda function reads data from objects in Amazon S3 and writes data to an Amazon DynamoDB table. The function is successfully invoked from an S3 event notification when an object is created. However, the function fails when it attempts to write to the DynamoDB table.
What is the MOST likely cause of this issue?
The Lambda function's concurrency limit has been exceeded.
DynamoDB table requires a global secondary index (GSI) to support writes.
The Lambda function does not have IAM permissions to write to DynamoDB.
The DynamoDB table is not running in the same Availability Zone as the Lambda function.
Answer: C
The short version
C — missing DynamoDB write permission is the most likely cause. S3 trigger proves invocation works, while PutItem denial explains write failure.
Key concepts in this question
S3 event invocation: bucket notification successfully triggering Lambda proves permissions and networking for the input path.
Lambda execution role: IAM role whose policies must allow dynamodb colon PutItem and related writes on the target table.
Least-privilege misses: common pattern where read-from-S3 works but write-to-DynamoDB was never granted.
AZ and concurrency distractors: Lambda and DynamoDB are regional services, and throttling produces different error signatures.
Why C is correct
C is correct because successful S3-triggered invocation shows the function runs and can read the event, isolating failure to the DynamoDB write call. Absent IAM write permission, DynamoDB returns AccessDenied, which matches a function that reads S3 then fails on table update. Checking the execution role for PutItem scope is therefore the first diagnostic.
Why the others are wrong
A. Exceeded concurrency would throttle invocation itself, not allow S3 success then fail only on writes.
B. Global secondary indexes speed queries and do not gate basic table writes.
D. Availability Zone placement is irrelevant because both services operate regionally with managed networking.
DVA-C02 exam tip
Split the path: S3 invoke success plus DynamoDB write fail almost always means execution-role IAM lacks table writes.
6A 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?
Create a separate CloudFormation template for each EC2 instance type in the list.
In the Resources section of the CloudFormation template, create resources for each EC2 instance type in the list.
In the CloudFormation template, create a separate parameter for each EC2 instance type in the list.
In the CloudFormation template, create a parameter with the list of EC2 instance types as AllowedValues.
Answer: D
The short version
D — model approved types as a parameter with AllowedValues. CloudFormation validates selection and reuses one template across accounts.
Key concepts in this question
CloudFormation parameters: inputs supplied at stack creation for environment-specific choices like instance type.
AllowedValues: constraint listing permissible strings so invalid types fail fast during validation.
Multi-account reuse: single template deployable in many accounts without per-type template sprawl.
Resources versus parameters: resources declare infrastructure, while parameters constrain choices without duplicating blocks.
Why D is correct
D is correct because a String parameter with AllowedValues presents the approved EC2 list and blocks unapproved types at launch. One template can then deploy any allowed type across accounts by changing the parameter value. This avoids duplicated templates, resource bloat, and per-type parameter sprawl while enforcing governance.
Why the others are wrong
A. Separate template per type multiplies maintenance and breaks single-source governance.
B. Declaring a resource per type provisions excess instances instead of constraining choice.
C. One parameter per type fragments input and still allows invalid combinations without central validation.
DVA-C02 exam tip
Constrain choice with AllowedValues: one parameter listing approved instance types governs all accounts cleanly.
7A 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.)
Retry the batch operation immediately.
Retry the batch operation with exponential backoff and randomized delay.
Update the application to use an AWS software development kit (AWS SDK) to make the requests.
Increase the provisioned read capacity of the DynamoDB tables that the operation accesses.
Increase the provisioned write capacity of the DynamoDB tables that the operation accesses.
Answer: B, D
The short version
BD — back off with jitter and raise read capacity. Retries smooth throttling while more RCUs reduce UnprocessedKeys recurrence.
Key concepts in this question
BatchGetItem throttling: DynamoDB returning UnprocessedKeys when read throughput or partition limits are exceeded.
Provisioned read capacity: RCUs governing sustained read throughput available to tables and indexes.
Write versus read scaling: writes use WCUs, so raising writes cannot relieve read-driven batch throttling.
Why BD is correct
B is correct because AWS guidance requires retrying UnprocessedKeys with exponential backoff and randomized delay rather than immediate retry. D is correct because persistently large UnprocessedKeys signals insufficient read throughput, fixed by increasing provisioned reads on accessed tables. Together they add client resilience and server capacity for batch resilience.
Why the others are wrong
A. Immediate retry amplifies throttling and increases UnprocessedKeys instead of draining them.
C. Switching to an SDK alone does not add backoff or capacity, so throttling behavior persists.
E. Raising write capacity helps writes, not BatchGetItem reads returning UnprocessedKeys.
DVA-C02 exam tip
Pair backoff plus reads: jittered retries handle bursts, extra RCUs fixes chronic UnprocessedKeys.
8A 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?
Install and run the X-Ray SDK on the on-premises servers to capture and relay the data to the X-Ray service.
Install and run the X-Ray daemon on the on-premises servers to capture and relay the data to the X-Ray service.
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.
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.
Answer: B
The short version
B — install and run the X-Ray daemon on premises. It listens locally, batches segments, and forwards to X-Ray with minimal setup.
Key concepts in this question
X-Ray daemon: lightweight UDP listener buffering trace segments and relaying them to the X-Ray API.
X-Ray SDK: code library instrumenting application requests to emit segments toward the daemon.
API Gateway test stage tracing: edge capture that still needs on-premises segment collection for end-to-end maps.
Least configuration goal: favor managed relay over custom Lambda polling and PutTraceSegments plumbing.
Why B is correct
B is correct because the daemon runs as a background process on Linux hosts, accepts SDK or instrumented traffic locally, and handles batching, encryption, and delivery to X-Ray. No application rewrite or custom pull pipeline is needed beyond pointing traffic at localhost. This matches AWS guidance for hybrid tracing with smallest operational lift.
Why the others are wrong
A. Running only the SDK without the daemon leaves no relay path and requires more app changes.
C. Lambda pull plus PutTraceSegments builds bespoke polling and increases configuration substantially.
D. PutTelemetryRecords is the wrong API path and still needs custom capture and relay code.
DVA-C02 exam tip
Default to the daemon for hybrid X-Ray: install locally, point SDK at localhost, let AWS handle delivery.
9A company wants to share information with a third party. The third party has an HTTP API endpoint that the company can use to share the information. The company has the required API key to access the HTTP API.
The company needs a way to manage the API key by using code. The integration of the API key with the application code cannot affect application performance.
Which solution will meet these requirements MOST securely?
Store the API credentials in AWS Secrets Manager. Retrieve the API credentials at runtime by using the AWS SDK. Use the credentials to make the API call.
Store the API credentials in a local code variable. Push the code to a secure Git repository. Use the local code variable at runtime to make the API call.
Store the API credentials as an object in a private Amazon S3 bucket. Restrict access to the S3 object by using IAM policies. Retrieve the API credentials at runtime by using the AWS SDK. Use the credentials to make the API call.
Store the API credentials in an Amazon DynamoDB table. Restrict access to the table by using resource-based policies. Retrieve the API credentials at runtime by using the AWS SDK. Use the credentials to make the API call.
Answer: A
The short version
A — keep the API key in Secrets Manager and fetch at runtime. Managed encryption plus SDK retrieval avoids code secrets and performance coupling.
Key concepts in this question
Secrets Manager retrieval: runtime GetSecretValue call caching credentials in memory for API use.
Code-managed secrets: requirement to rotate and version the key programmatically without redeploys.
Performance isolation: fetching once and caching avoids per-request latency from secret stores.
Security comparison: managed encryption and audit versus plaintext variables, S3 objects, or table rows.
Why A is correct
A is correct because Secrets Manager encrypts the third-party API key, supports rotation via code, and provides SDK retrieval with IAM control. Runtime fetch with local caching meets the code-management need without blocking request paths. Audit logging and fine-grained policy make it more secure than embedded variables or ad-hoc storage.
Why the others are wrong
B. Local code variable bakes secrets into git history and exposes keys to every repo reader.
C. Private S3 object adds bucket IAM plus object handling without rotation or secret semantics.
D. DynamoDB table requires custom encryption and policy work while lacking secret lifecycle features.
DVA-C02 exam tip
Store third-party keys as secrets: Secrets Manager plus cached runtime SDK fetch is the secure performant pattern.
10A developer is deploying a new application to Amazon Elastic Container Service (Amazon ECS). The developer needs to securely store and retrieve different types of variables. These variables include authentication information for a remote API, the URL for the API, and credentials. The authentication information and API URL must be available to all current and future deployed versions of the application across development, testing, and production environments.
How should the developer retrieve the variables with the FEWEST application changes?
Update the application to retrieve the variables from AWS Systems Manager Parameter Store. Use unique paths in Parameter Store for each variable in each environment. Store the credentials in AWS Secrets Manager in each environment.
Update the application to retrieve the variables from AWS Key Management Service (AWS KMS). Store the API URL and credentials as unique keys for each environment.
Update the application to retrieve the variables from an encrypted file that is stored with the application. Store the API URL and credentials in unique files for each environment.
Update the application to retrieve the variables from each of the deployed environments. Define the authentication information and API URL in the ECS task definition as unique names during the deployment process.
Answer: A
The short version
A — read config from Parameter Store paths and secrets from Secrets Manager. Unique per-environment paths plus managed secrets minimize app changes.
Key concepts in this question
Parameter Store hierarchy: slash-delimited paths such as dev versus prod isolating URL and non-secret variables.
Secrets Manager for credentials: purpose-built storage for API auth with rotation and cross-version sharing.
ECS task portability: same image running across dev, test, and prod by resolving environment-specific paths.
Fewest changes goal: single retrieval pattern covering current and future versions without per-env code forks.
Why A is correct
A is correct because Parameter Store paths let the app fetch API URLs and non-secret settings by environment without code edits. Secrets Manager holds authentication material with automatic decryption and rotation support per environment. One SDK pattern serves all versions and stages, satisfying availability to current and future deployments with minimal modification.
Why the others are wrong
B. KMS alone encrypts but does not store or version URLs and credentials as retrievable parameters.
C. Encrypted files bundled with the app force rebuilds per environment and complicate rotation.
D. Task-definition variables scatter config in deployment metadata and require redeploys for every change.
DVA-C02 exam tip
Split plain config from secrets: Parameter Store paths for URLs, Secrets Manager for credentials, one fetch pattern.