A developer is creating an application that uses an AWS Lambda function to transform and
load data from an Amazon S3 bucket. When the developer tests the application, the
developer finds that some invocations of the Lambda function are slower than others.
The developer needs to update the Lambda function to have predictable invocation
durations that run with low latency. Any initialization activities, such as loading libraries and
instantiating clients, must run during allocation time rather than during actual function
invocations.
Which combination of steps will meet these requirements? (Select TWO.)
Show answerHide answer
Correct answer: B, DConfigure provisioned concurrency for the Lambda function to have the necessary
number of execution environments.
Configure reserved concurrency for the Lambda function to have the necessary number
of execution environments.
Question 42Choose 1
A company has deployed an application on AWS Elastic Beanstalk. The company has
configured the Auto Scaling group that is associated with the Elastic Beanstalk
environment to have five Amazon EC2 instances. If the capacity is fewer than four
EC2instances during the deployment, application performance degrades. The company is
using the all-at-once deployment policy.
What is the MOST cost-effective way to solve the deployment issue?
Show answerHide answer
Correct answer: CChange the deployment policy to rolling with additional batch. Specify a batch size of 1.
Explanation
Explanation: This solution will solve the deployment issue by deploying the new version of
the application to one new EC2 instance at a time, while keeping the old version running on
the existing instances. This way, there will always be at least four instances serving traffic
during the deployment, and no downtime or performance degradation will occur. Option A
is not optimal because it will increase the cost of running the Elastic Beanstalk environment
without solving the deployment issue. Option B is not optimal because it will split the traffic
between two versions of the application, which may cause inconsistency and confusion for
the customers. Option D is not optimal because it will deploy the new version of the
application to two existing instances at a time, which may reduce the capacity below four
instances during the deployment.
Question 43Choose 1
A developer needs to build an AWS CloudFormation template that self-populates the AWS
Region variable that deploys the CloudFormation template.
What is the MOST operationally efficient way to determine the Region in which the
template is being deployed?
Show answerHide answer
Correct answer: AUse the AWS:.Region pseudo parameter
Explanation
Explanation:
Pseudo Parameters: CloudFormation provides pseudo parameters that reference
runtime context, including the current AWS Region.
Operational Efficiency: The AWS::Region pseudo parameter offers the most direct
and self-contained way to obtain the Region dynamically within the template.
Question 44Choose 1
A developer is using AWS Step Functions to automate a workflow The workflow defines
each step as an AWS Lambda function task The developer notices that runs of the Step
Functions state machine fail in the GetResource task with either an
UlegalArgumentException error or a TooManyRequestsException error.
The developer wants the state machine to stop running when the state machine encounters
an UlegalArgumentException error. The state machine needs to retry the GetResource
task one additional time after 10 seconds if the state machine encounters a
TooManyRequestsException error. If the second attempt fails, the developer wants the
state machine to stop running.
How can the developer implement the Lambda retry functionality without adding
unnecessary complexity to the state machine'?
Show answerHide answer
Correct answer: CAdd a retrier to the GetResource task Configure the retrier with an error type of
TooManyRequestsException, an interval of 10 seconds, and a maximum attempts value of
1.
Explanation
Explanation:
Step Functions Retriers: Retriers provide a built-in way to gracefully handle
transient errors within State Machines. Here's how to use them:
Error Handling
Question 45Choose 2
A developer is building a web application that uses Amazon API Gateway to expose an
AWS Lambda function to process requests from clients. During testing, the developer
notices that the API Gateway times out even though the Lambda function finishes under
the set time limit.
Which of the following API Gateway metrics in Amazon CloudWatch can help the
developer troubleshoot the issue? (Choose two.)
Show answerHide answer
Correct answer: B, DIntegrationLatency
Latency
Explanation
Explanation: Amazon API Gateway is a service that enables developers to create, publish,
maintain, monitor, and secure APIs at any scale. Amazon CloudWatch is a service that
monitors AWS resources and applications. API Gateway provides several CloudWatch
metrics to help developers troubleshoot issues with their APIs. Two of the metrics that can
help the developer troubleshoot the issue of API Gateway timing out are:
Integration Latency: This metric measures the time between when API Gateway
relays a request to the backend and when it receives a response from the
backend. A high value for this metric indicates that the backend is taking too long
to respond and may cause API Gateway to time out.
Latency: This metric measures the time between when API Gateway receives a
request from a client and when it returns a response to the client. A high value for
this metric indicates that either the integration latency is high or API Gateway is
taking too long to process the request or response.
Question 46Choose 1
A developer is creating an application that will be deployed on IoT devices. The application
will send data to a RESTful API that is deployed as an AWS Lambda function. The
application will assign each API request a unique identifier. The volume of API requests
from the application can randomly increase at any given time of day.
During periods of request throttling, the application might need to retry requests. The API
must be able to handle duplicate requests without inconsistencies or data loss.
Which solution will meet these requirements?
Show answerHide answer
Correct answer: BCreate an Amazon DynamoDB table. Store the unique identifier for each request in the
table. Modify the Lambda function to check the table for the identifier before processing the
request.
Explanation
Explanation: Amazon DynamoDB is a fully managed NoSQL database service that can
store and retrieve any amount of data with high availability and performance. DynamoDB
can handle concurrent requests from multiple IoT devices without throttling or data loss. To
prevent duplicate requests from causing inconsistencies or data loss, the Lambda function
can use DynamoDB conditional writes to check if the unique identifier for each request
already exists in the table before processing the request. If the identifier exists, the function
can skip or abort the request; otherwise, it can process the request and store the identifier
in the table.
Question 47Choose 1
A developer built an application that calls an external API to obtain data, processes the
data, and saves the result to Amazon S3. The developer built a container image with all of
the necessary dependencies to run the application as a container.
The application runs locally and requires minimal CPU and RAM resources. The developer
has created an Amazon ECS cluster. The developer needs to run the application hourly in
Amazon ECS.
Which solution will meet these requirements with the LEAST amount of infrastructure
management overhead?
Show answerHide answer
Correct answer: CDefine a task definition with an AWS Fargate launch type.
Explanation
Explanation: Requirement Summary:
Containerized app
Runshourly
Minimal CPU and RAM
Goal:Least infrastructure management
Evaluate Options:
A. Add a capacity provider to manage instances
Capacity providers are used for managingEC2-backed ECS clusters, which still
requireunderlying EC2management.
B. Add an Amazon EC2 instance
Involvesmanaging infrastructure(provisioning, patching, scaling, etc.)
C. Use AWS Fargate launch type
Serverless containerruntime
No server management
Easily scheduled usingEventBridge + ECS Fargate Task
Best fit for periodic workloadslike this
D. Use managed node groups
Applies toEKS (Kubernetes), not ECS
Unnecessary overheadfor this use case
Question 48Choose 1
A company is providing read access to objects in an Amazon S3 bucket for different
customers. The company uses 1AM permissions to restrict access to the S3 bucket. The
customers can access only their own files.
Due to a regulation requirement, the company needs to enforce encryption in transit for
interactions with Amazon S3.
Which solution will meet these requirements?
Show answerHide answer
Correct answer: AAdd a bucket policy to the S3 bucket to deny S3 actions when the aws:SecureTransport
condition is equal to false.
Question 49Choose 1
A developer is receiving HTTP 400: ThrottlingException errors intermittently when calling
the Amazon CloudWatch API. When a call fails, no data is retrieved.
What best practice should first be applied to address this issue?
Show answerHide answer
Correct answer: DRetry the call with exponential backoff.
Question 50Choose 1
A developer is migrating some features from a legacy monolithic application to use AWS
Lambda functions instead. The application currently stores data in an Amazon Aurora DB cluster that runs in private subnets in a VPC. The AWS account has one VPC deployed.
The Lambda functions and the DB cluster are deployed in the same AWS Region in the
same AWS account.
The developer needs to ensure that the Lambda functions can securely access the DB
cluster without crossing the public internet.
Which solution will meet these requirements?
Show answerHide answer
Correct answer: DConfigure the VPC, subnets, and a security group for the Lambda functions.
Explanation
Explanation: This solution will meet the requirements by allowing the Lambda functions to
access the DB cluster securely within the same VPC without crossing the public internet.
The developer can configure a VPC endpoint for RDS in a private subnet and assign it to
the Lambda functions. The developer can also configure a security group forthe Lambda
functions that allows inbound traffic from the DB cluster on port 3306 (MySQL). Option A is
not optimal because it will expose the DB cluster to public access, which may compromise
its security and data integrity. Option B is not optimal because it will introduce additional
latency and complexity to use an RDS database proxy for accessing the DB cluster from
Lambda functions within the same VPC. Option C is not optimal because it will require
additional costs and configuration to use a NAT gateway for accessing resources in private
subnets from Lambda functions.
Full mock exam
Sit the DVA-C02 exam before exam day
Full-length mocks with the same number of questions and the same time limit as the real DVA-C02 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.