Practice Free DVA-C02 Exam Online Questions
A company has an Amazon API Gateway REST API that integrates with an AWS Lambda function. The API’s development stage references a Lambda development alias named dev.
A developer needs to make a production alias of the Lambda function named prod available through the API.
Which solution meets these requirements?
- A . Create a new method on the API named production. Configure the method to include a stage variable that points to the prod Lambda alias.
- B . Create a new method on the API named production. Configure an integration request on the development stage that points to the prod Lambda alias.
- C . Deploy the API to a new stage named production. Configure the stage to include a stage variable that points to the prod Lambda alias.
- D . Deploy the API to a new stage named production. Configure an integration request on the production stage that points directly to the prod Lambda alias.
C
Explanation:
Amazon API Gateway stages are designed to represent different deployment environments such as development, testing, and production. AWS documentation recommends using separate stages combined with stage variables to reference different backend resources without duplicating API definitions.
In this scenario, the development stage already uses a stage variable to reference the Lambda dev alias. To expose the production alias safely, the developer should deploy the API to a new stage named production and configure a stage variable that points to the Lambda prod alias. This approach allows the same API configuration and methods to be reused while cleanly separating environments.
Stage variables are resolved at runtime and are commonly used to reference Lambda aliases in integration ARNs. This enables controlled promotion of code from development to production without modifying methods or integrations.
Creating new methods (Options A and B) is unnecessary and increases operational complexity. Directly hardcoding the Lambda alias in the integration (Option D) removes flexibility and deviates from AWS best practices for environment separation.
Therefore, deploying a new API stage and using stage variables to reference the prod Lambda alias is the correct and most efficient solution.
A company runs an application as an Amazon ECS service on an AWS Fargate cluster. The company has configured the service to use the rolling update deployment type. The company set the minimum healthy percentage to 100% and set the maximum healthy percentage to 200%.
A developer observes that a new deployment of the ECS service is failing continuously. The developer must ensure that Amazon ECS restores the most recently completed service deployment when a new service deployment fails.
Which solution will meet this requirement?
- A . Use Amazon ECS service auto scaling. Set the scaling policy type as step scaling.
- B . Use Amazon ECS service auto scaling. Set the scaling policy type as target tracking.
- C . Use the blue/green deployment type. Enable the deployment circuit breaker and rollback on failures options.
- D . Use the rolling deployment type. Enable deployment circuit breaker and rollback on failures options.
D
Explanation:
The requirement is specifically to have ECS automatically restore the last known good deployment when a new deployment fails, while the service is using the rolling update deployment type. Amazon ECS supports this through the deployment circuit breaker with the option to rollback on failures.
When enabled, the deployment circuit breaker monitors the deployment and detects failure conditions such as tasks repeatedly failing health checks, not reaching steady state, or being unable to start successfully. With rollback enabled, ECS automatically stops the failing deployment and reverts the service to the most recently completed (stable) task definition, restoring service stability without manual intervention.
Option D matches exactly: keep the rolling deployment type and enable circuit breaker + rollback.
This is minimal change and directly addresses the behavior observed.
Options A and B are unrelated: service autoscaling adjusts desired count based on metrics and does not roll back failed deployments.
Option C could also achieve rollback behavior, but switching to blue/green introduces additional components (AWS CodeDeploy integration, target groups, and traffic shifting), which is unnecessary when the requirement can be met within rolling deployments.
Therefore, enabling the ECS deployment circuit breaker with rollback on failures for a rolling deployment is the correct solution.
A company runs an application as an Amazon ECS service on an AWS Fargate cluster. The company has configured the service to use the rolling update deployment type. The company set the minimum healthy percentage to 100% and set the maximum healthy percentage to 200%.
A developer observes that a new deployment of the ECS service is failing continuously. The developer must ensure that Amazon ECS restores the most recently completed service deployment when a new service deployment fails.
Which solution will meet this requirement?
- A . Use Amazon ECS service auto scaling. Set the scaling policy type as step scaling.
- B . Use Amazon ECS service auto scaling. Set the scaling policy type as target tracking.
- C . Use the blue/green deployment type. Enable the deployment circuit breaker and rollback on failures options.
- D . Use the rolling deployment type. Enable deployment circuit breaker and rollback on failures options.
D
Explanation:
The requirement is specifically to have ECS automatically restore the last known good deployment when a new deployment fails, while the service is using the rolling update deployment type. Amazon ECS supports this through the deployment circuit breaker with the option to rollback on failures.
When enabled, the deployment circuit breaker monitors the deployment and detects failure conditions such as tasks repeatedly failing health checks, not reaching steady state, or being unable to start successfully. With rollback enabled, ECS automatically stops the failing deployment and reverts the service to the most recently completed (stable) task definition, restoring service stability without manual intervention.
Option D matches exactly: keep the rolling deployment type and enable circuit breaker + rollback.
This is minimal change and directly addresses the behavior observed.
Options A and B are unrelated: service autoscaling adjusts desired count based on metrics and does not roll back failed deployments.
Option C could also achieve rollback behavior, but switching to blue/green introduces additional components (AWS CodeDeploy integration, target groups, and traffic shifting), which is unnecessary when the requirement can be met within rolling deployments.
Therefore, enabling the ECS deployment circuit breaker with rollback on failures for a rolling deployment is the correct solution.
A company built an online event platform For each event the company organizes quizzes and generates leaderboards that are based on the quiz scores. The company stores the leaderboard data in Amazon DynamoDB and retains the data for 30 days after an event is complete The company then uses a scheduled job to delete the old leaderboard data
The DynamoDB table is configured with a fixed write capacity. During the months when many events occur, the DynamoDB write API requests are throttled when the scheduled delete job runs.
A developer must create a long-term solution that deletes the old leaderboard data and optimizes write throughput
Which solution meets these requirements?
- A . Configure a TTL attribute for the leaderboard data
- B . Use DynamoDB Streams to schedule and delete the leaderboard data
- C . Use AWS Step Functions to schedule and delete the leaderboard data.
- D . Set a higher write capacity when the scheduled delete job runs
A
Explanation:
DynamoDB TTL (Time-to-Live): A native feature that automatically deletes items after a specified expiration time.
Efficiency: Eliminates the need for scheduled deletion jobs, optimizing write throughput by avoiding potential throttling conflicts.
Seamless Integration: TTL works directly within DynamoDB, requiring minimal development overhead.
Reference: DynamoDB TTL
Documentation: https: //docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html
A company is migrating an on-premises database to Amazon RDS for MySQL. The company has read-heavy workloads. The company wants to refactor the code to achieve optimum read performance for queries.
Which solution will meet this requirement with LEAST current and future effort?
- A . Use a multi-AZ Amazon RDS deployment. Increase the number of connections that the code makes to the database or increase the connection pool size if a connection pool is in use.
- B . Use a multi-AZ Amazon RDS deployment. Modify the code so that queries access the secondary RDS instance.
- C . Deploy Amazon RDS with one or more read replicas. Modify the application code so that queries use the URL for the read replicas.
- D . Use open source replication software to create a copy of the MySQL database on an Amazon EC2 instance. Modify the application code so that queries use the IP address of the EC2 instance.
C
Explanation:
Amazon RDS for MySQL supports read replicas, which are copies of the primary database instance that can handle read-only queries. Read replicas can improve the read performance of the database by offloading the read workload from the primary instance and distributing it across multiple replicas. To use read replicas, the application code needs to be modified to direct read queries to the URL of the read replicas, while write queries still go to the URL of the primary instance. This solution requires less current and future effort than using a multi-AZ deployment, which does not provide read scaling benefits, or using open source replication software, which requires additional configuration and maintenance.
Reference: Working with read replicas
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 testing a Python application that is deployed on AWS Elastic Beanstalk. The application is using the Boto3 library to send events to an Amazon SQS queue. An external tool consumes the events.
During the tests, a ThrottlingException error occurs at irregular intervals.
What should the developer do to resolve this error?
- A . Increase the number of instances that are assigned to the Elastic Beanstalk deployment.
- B . Scale up the instances in the Elastic Beanstalk deployment to provide more RAM and CPU to the environment.
- C . Configure Boto3 to use the adaptive retry mode to retry the failing step with progressively longer waits between calls.
- D . Redeploy the Elastic Beanstalk environment. Choose a less memory-intensive programming language.
C
Explanation:
A ThrottlingException indicates that calls to an AWS service are being rate limited. The correct developer response is to use SDK retry behavior with backoff rather than scaling the application servers blindly. Boto3 supports retry modes, including adaptive retry mode, which adjusts client-side request rates based on throttling errors, exceptions, or HTTP status codes returned by AWS services. Increasing Elastic Beanstalk instance count or size can actually worsen throttling by producing more calls to SQS. Changing programming language is irrelevant. Adaptive retry mode is specifically intended to handle throttling more gracefully by slowing requests and retrying failed API calls. AWS SDK documentation describes adaptive retry mode as modifying rate-limit variables based on error responses and using those variables to calculate the next call rate. (AWS Documentation)
A company has a social media application that receives large amounts of traffic User posts and interactions are continuously updated in an Amazon RDS database The data changes frequently, and the data types can be complex The application must serve read requests with minimal latency
The application’s current architecture struggles to deliver these rapid data updates efficiently. The company needs a solution to improve the application’s performance.
Which solution will meet these requirements?
- A . Use Amazon DynamoDB Accelerator (DAX) in front of the RDS database to provide a caching layer for the high volume of rapidly changing data
- B . Set up Amazon S3 Transfer Acceleration on the RDS database to enhance the speed of data transfer from the databases to the application.
- C . Add an Amazon CloudFront distribution in front of the RDS database to provide a caching layer for the high volume of rapidly changing data
- D . Create an Amazon ElastiCache for Redis cluster. Update the application code to use a write-through caching strategy and read the data from Redis.
D
Explanation:
Amazon ElastiCache for Redis: An in-memory data store known for extremely low latency, ideal for caching frequently accessed, complex data.
Write-Through Caching: Ensures that data is always consistent between the cache and the database.
Writes go to both Redis and RDS.
Performance Gains: Redis handles reads with minimal latency, offloading the RDS database and improving the application’s responsiveness.
Reference:
Amazon ElastiCache for Redis
Documentation: https: //docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/
Caching Strategies: https: //docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Strategies.html
A developer is using an AWS account to build an application that stores files in an Amazon S3 bucket. Files must be encrypted at rest by AWS KMS keys. A second AWS account must have access to read files from the bucket.
The developer wants to minimize operational overhead for the application.
Which combination of solutions will meet these requirements? (Select TWO.)
- A . Use a customer managed key to encrypt the files. Create a key policy that grants kms: Decrypt permissions to the second AWS account.
- B . Use an AWS managed key to encrypt the files. Create a key policy that grants kms: Decrypt permissions to the second AWS account.
- C . Create a service control policy (SCP) that grants s3: GetObject permissions to the second AWS account.
- D . Create a bucket policy for the S3 bucket that grants s3: GetObject permissions to the second AWS account.
- E . Create a gateway endpoint for the S3 bucket. Modify the endpoint policy to grant s3: GetObject permissions to the second AWS account.
A,D
Explanation:
Step-by-Step Breakdown:
Requirement Summary:
Encrypt S3 objects using KMS keys
Cross-account read access to another AWS account
Minimize operational overhead
Option A: Use a customer managed key + key policy granting kms: Decrypt to second account
Correct: Customer managed keys allow full control of key policy.
You can add a statement to allow cross-account access using the second account’s IAM principal.
Option B: Use AWS managed key + key policy granting access to second account
Incorrect: AWS-managed KMS keys (aws/s3) cannot be modified to add cross-account access in key policies.
Option C: SCP that grants s3: GetObject to second account
Incorrect: SCPs are used to restrict or allow permissions across AWS Organizations, not to grant S3 or KMS access directly.
Option D: Create a bucket policy granting s3: GetObject to second account
Correct: Bucket policies can grant cross-account access to specific IAM users or roles in the second account.
Option E: Gateway endpoint for S3 with cross-account access
Incorrect: Gateway endpoints only apply within the same VPC/account. Cross-account use with endpoint policies is not the correct pattern for this use case.
Cross-account S3 access with KMS:
https: //docs.aws.amazon.com/AmazonS3/latest/userguide/example-walkthroughs-managing-
access-example2.html
KMS cross-account key policy: https: //docs.aws.amazon.com/kms/latest/developerguide/key-policy-modifying.html
Bucket Policy for cross-account access:
https: //docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html
A developer is building a three-tier web application that should be able to handle a minimum of 5000 requests per minute. Requirements state that the web tier should be completely stateless while the application maintains session state for the users.
How can session data be externalized, keeping latency at the LOWEST possible value?
- A . Create an Amazon RDS instance, then implement session handling at the application level to leverage a database inside the RDS database instance for session data storage.
- B . Implement a shared file system solution across the underlying Amazon EC2 instances, then implement session handling at the application level to leverage the shared file system for session data storage.
- C . Create an Amazon ElastiCache (Memcached) cluster, then implement session handling at the application level to leverage the cluster for session data storage.
- D . Create an Amazon DynamoDB table, then implement session handling at the application level to leverage the table for session data storage.
C
Explanation:
Why Option C is Correct:
Amazon ElastiCache (Memcached) provides low-latency, in-memory caching suitable for session storage. It ensures stateless web tier operations and supports the high throughput of 5000 requests per minute.
Why Other Options are Incorrect:
Option A: RDS has higher latency compared to in-memory caching solutions like ElastiCache.
Option B: Shared file systems introduce additional complexity and are not ideal for low-latency session data storage.
Option D: DynamoDB has low latency but is less performant than ElastiCache for in-memory session management.
AWS Documentation
Reference: Amazon ElastiCache for Session State Management
