Amazon

DVA-C02 Free Practice Questions — Page 12

Question 112

A developer needs to fix an AWS CodeDeploy deployment that failed. During the failed deployment, the developer received the following error message: “The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems. (Error code: HEALTH-CONSTRAINTS)” What are the possible causes of the failed deployment? (Choose two.)

A. The CodeDeploy agent was not running on the instances that CodeDeploy was trying to deploy to.
B. The unified Amazon CloudWatch agent was not running on the instances that CodeDeploy was trying to deploy to.
C. The developer’s IAM role did not have the necessary permissions to perform code deployment to the instances.
D. CodeDeploy was trying to deploy to instances that were attached to an IAM instance profile that did not have the required permissions.
E. CodeDeploy was trying to deploy to instances that were not set up with correct CodeDeploy health checks.
Show Answer
Correct Answer: A, E
Explanation:
The HEALTH_CONSTRAINTS error occurs when CodeDeploy cannot maintain the required number of healthy instances during deployment. If the CodeDeploy agent is not running on target instances, those instances cannot receive or report deployment status and are marked unhealthy (A). Additionally, if instances are not properly configured for CodeDeploy health checks or are failing them, CodeDeploy will consider them unhealthy and halt the deployment (E).

Question 113

A developer is automating a new application deployment with AWS Serverless Application Model (AWS SAM). The new application has one AWS Lambda function and one Amazon S3 bucket. The Lambda function must access the S3 bucket to only read objects. How should the developer configure AWS SAM to grant the necessary read privilege to the S3 bucket?

A. Reference a second Lambda authorizer function.
B. Add a custom S3 bucket policy to the Lambda function.
C. Create an Amazon Simple Queue Service (SQS) topic for only S3 object reads. Reference the topic in the template.
D. Add the S3ReadPolicy template to the Lambda function's execution role.
Show Answer
Correct Answer: D
Explanation:
In AWS SAM, permissions for a Lambda function are granted through its execution role. SAM provides managed policy templates that simplify least-privilege access. Adding the S3ReadPolicy template to the Lambda function's execution role grants read-only access (such as GetObject and ListBucket) to the specified S3 bucket, which directly satisfies the requirement. The other options are unrelated or incorrect for granting Lambda-to-S3 read permissions.

Question 114

A company has a serverless application that uses an Amazon API Gateway API to invoke an AWS Lambda function. A developer creates a fix for a defect in the Lambda function code. The developer wants to deploy this fix to the production environment. To test the changes, the developer needs to send 10% of the live production traffic to the updated Lambda function version. Which combination of steps will meet these requirements? (Choose two.)

A. Publish a new version of the Lambda function that contains the updated code.
B. Set up a new stage in API Gateway with a new Lambda function version. Enable weighted routing in API Gateway stages.
C. Create an alias for the Lambda function. Configure weighted routing on the alias. Specify a 10% weight for the new Lambda function version.
D. Set up a routing policy on a Network Load Balancer. Configure 10% of the traffic to go to the new Lambda function version.
E. Set up a weighted routing policy by using Amazon Route 53. Configure 10% of the traffic to go to the new Lambda function version.
Show Answer
Correct Answer: A, C
Explanation:
To shift a portion of live traffic to updated Lambda code, the developer must first publish the change as a new Lambda function version. Traffic shifting in Lambda is achieved by using an alias with weighted routing, which can split invocations between versions (for example, 90% to the old version and 10% to the new one). API Gateway can then invoke the alias, enabling controlled testing in production. Other options do not support weighted routing to Lambda versions in this scenario.

Question 115

A developer is building an application on AWS. The application has an Amazon API Gateway API that sends requests to an AWS Lambda function. The API is experiencing increased latency because the Lambda function has limited available CPU to fulfill the requests. Before the developer deploys the API into production, the developer must configure the Lambda function to have more CPU. Which solution will meet this requirement?

A. Increase the virtual CPU (vCPU) cores quota of the Lambda function.
B. Increase the amount of memory that is allocated to the Lambda function.
C. Increase the ephemeral storage size of the Lambda function.
D. Increase the timeout value of the Lambda function.
Show Answer
Correct Answer: B
Explanation:
In AWS Lambda, CPU allocation is proportional to the amount of memory configured for the function. Increasing the memory setting automatically increases the available CPU, which reduces execution latency. Lambda does not allow direct vCPU configuration, and ephemeral storage or timeout settings do not affect CPU performance.

Question 116

A company has a virtual reality (VR) game. The game has a serverless backend that consists of Amazon API Gateway, AWS Lambda, and Amazon DynamoDB. Recently, the company noticed a sudden increase of new users globally. The company also noticed delays in the retrieval of user data. Which AWS service or feature can the company use to reduce the database response time to microseconds?

A. Amazon ElastiCache
B. DynamoDB Accelerator (DAX)
C. DynamoDB auto scaling
D. Amazon CloudFront
Show Answer
Correct Answer: B
Explanation:
DynamoDB Accelerator (DAX) is a fully managed, in-memory cache specifically designed for DynamoDB that reduces read latency from milliseconds to microseconds. It is ideal for globally scaled, read-heavy workloads without requiring application code changes.

Question 117

A company has implemented a pipeline in AWS CodePipeline. The company is using a single AWS account and does not use AWS Organizations. The company needs to test its AWS CloudFormation templates in its primary AWS Region and a disaster recovery Region. Which solution will meet these requirements with the MOST operational efficiency?

A. In the CodePipeline pipeline, implement an AWS CodeDeploy action for each Region to deploy and test the CloudFormation templates. Update CodePipeline and AWS CodeBuild with appropriate permissions.
B. Configure CodePipeline to deploy and test the CloudFormation templates. Use CloudFormation StackSets to start deployment across both Regions.
C. Configure CodePipeline to invoke AWS CodeBuild to deploy and test the CloudFormation templates in each Region. Update CodeBuild and CloudFormation with appropriate permissions.
D. Use the Snyk action in CodePipeline to deploy and test the CloudFormation templates in each Region.
Show Answer
Correct Answer: B
Explanation:
The requirement is to deploy and test the same CloudFormation templates in two AWS Regions with the highest operational efficiency. AWS CloudFormation StackSets are designed specifically for this purpose: they allow a single CloudFormation template to be deployed and managed across multiple Regions (and/or accounts) from one operation. Even without AWS Organizations and within a single account, StackSets support multi-Region deployments. Integrating StackSets into CodePipeline minimizes custom scripting, avoids duplicating pipeline actions per Region, and centralizes management. Other options require more manual configuration or misuse services not intended for CloudFormation deployments.

Question 118

A developer is using an AWS Lambda function to process data. The developer needs to extract custom metrics about processing times from the Lambda logs. The developer needs to analyze the metrics, set alarms, and detect issues in real time. Which solution will meet these requirements?

A. Publish custom metric data to AWS CloudTrail by using the PutMetricData API operation. Classify and collect the metrics. Create graphs and alarms in CloudTrail for the custom metrics.
B. Use the open source client libraries provided by Amazon to generate the logs in the Amazon CloudWatch embedded metric format. Use CloudWatch to create the required graphs and alarms for the custom metrics.
C. Use Amazon CloudWatch Logs Insights to create custom metrics by querying the logs that come from the Lambda function. Use CloudWatch to create the required graphs and alarms for the custom metrics.
D. Create an Amazon Kinesis data stream to stream log events in real time from Lambda. Specify an Amazon S3 bucket as the destination for the Kinesis data stream. Use Amazon CloudWatch to visualize the log data and to set alarms.
Show Answer
Correct Answer: B
Explanation:
The requirement is to extract custom metrics from Lambda logs, analyze them in near real time, and create alarms. Using the CloudWatch Embedded Metric Format (EMF) via the AWS-provided client libraries allows the Lambda function to emit structured log entries that CloudWatch automatically extracts as native custom metrics. These metrics are immediately available for dashboards and alarms without running queries. CloudTrail is not used for metrics, Logs Insights is primarily for ad hoc log analysis rather than real-time metric extraction, and streaming logs to Kinesis/S3 adds unnecessary complexity and latency.

Question 119

A developer has an application that uses AWS Lambda functions and AWS CloudFormation templates. Usage of the application has increased. As a result, the Lambda functions are encountering rate limit errors when they retrieve data. The Lambda functions retrieve an advanced parameter from AWS Systems Manager Parameter Store on every call. The parameter changes only during new deployments. Because the application’s usage is unpredictable, the developer needs a way to avoid the rate limiting. Which solution will meet these requirements MOST cost-effectively?

A. Configure the Lambda functions to use reserved concurrency that is equal to the last month’s average number of concurrent invocations.
B. Add a retry mechanism with exponential backoff to the call to Parameter Store.
C. Request a service quota increase for Parameter Store GetParameter API operations to match the expected usage of the Lambda functions.
D. Add an SSM dynamic reference as an environment variable to the Lambda functions resource in the CloudFormation templates.
Show Answer
Correct Answer: D
Explanation:
The rate limiting occurs because each Lambda invocation calls Systems Manager Parameter Store. Since the parameter changes only during deployments, the most cost-effective solution is to avoid repeated runtime calls. Using an SSM dynamic reference as a Lambda environment variable in the CloudFormation template resolves the parameter at deployment time and stores it in the environment, eliminating per-invocation Parameter Store calls and preventing rate limiting without added cost.

Question 120

An ecommerce startup is preparing for an annual sales event. As the traffic to the company's application increases, the development team wants to be notified when the Amazon EC2 instance's CPU utilization exceeds 80%. Which solution will meet this requirement?

A. Create a custom Amazon CloudWatch alarm that sends a notification to an Amazon SNS topic when the CPU utilization exceeds 80%.
B. Create a custom AWS CloudTrail alarm that sends a notification to an Amazon SNS topic when the CPU utilization exceeds 80%.
C. Create a cron job on the EC2 instance that invokes the --describe-instance-information command on the host instance every 15 minutes and sends the results to an Amazon SNS topic.
D. Create an AWS Lambda function that queries the AWS CloudTrail logs for the CPUUtilization metric every 15 minutes and sends a notification to an Amazon SNS topic when the CPU utilization exceeds 80%.
Show Answer
Correct Answer: A
Explanation:
Amazon CloudWatch is the native AWS service for monitoring EC2 metrics such as CPUUtilization. A CloudWatch alarm can be configured with a threshold of 80% and integrated directly with Amazon SNS to send notifications when the threshold is exceeded. The other options misuse CloudTrail or rely on unnecessary custom scripts or Lambda polling, which are not appropriate for metric-based monitoring.

Question 121

A company has an application that uses an Amazon API Gateway API to invoke an AWS Lambda function. The application is latency sensitive. A developer needs to configure the Lambda function to reduce the cold start time that is associated with default scaling. What should the developer do to meet these requirements?

A. Publish a new version of the Lambda function. Configure provisioned concurrency. Set the provisioned concurrency limit to meet the company requirements.
B. Increase the Lambda function's memory to the maximum amount. Increase the Lambda function's reserved concurrency limit.
C. Increase the reserved concurrency of the Lambda function to a number that matches the current production load.
D. Use Service Quotas to request an increase in the Lambda function's concurrency limit for the AWS account where the function is deployed.
Show Answer
Correct Answer: A
Explanation:
The application is latency sensitive, and the goal is to reduce Lambda cold start time. Provisioned concurrency keeps a specified number of Lambda execution environments initialized and ready to handle requests, which directly mitigates cold starts. Enabling provisioned concurrency requires publishing a function version (or using an alias), and configuring it to the required level ensures consistent low latency. The other options address scaling limits but do not eliminate cold starts.

$19

Get all 555 questions with detailed answers and explanations

  • Instant download HTML + PDF delivered the moment payment clears.
  • Secure Stripe checkout we never see or store your card details.
  • 7-day refund if files are defective see our refund policy.