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, D
Explanation:
HEALTH_CONSTRAINTS commonly occurs when the CodeDeploy agent is not installed or running, or when deployments cannot proceed because instances encounter access-denied or permission issues. The CloudWatch agent is unrelated, and there are no CodeDeploy-specific health checks to configure on EC2 instances. An instance profile lacking required permissions can prevent the agent from accessing deployment resources. Sources: https://docs.aws.amazon.com/codedeploy/latest/userguide/error-codes.html https://docs.aws.amazon.com/codedeploy/latest/userguide/troubleshooting-deployments.html

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:
AWS SAM provides built-in IAM policy templates for Lambda execution roles. Attaching the S3ReadPolicy template to the Lambda function grants read-only access to the specified S3 bucket, which matches the requirement. The other options do not correctly configure Lambda's IAM permissions for S3 read access.

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:
Publish the updated Lambda code as a new immutable function version. Then create or update a Lambda alias that points to the stable version and configure alias weighted routing so 90% of invocations go to the current version and 10% go to the new version. Configure API Gateway to invoke the alias rather than a specific version. API Gateway stages do not provide weighted routing between Lambda versions, and NLB or Route 53 are not used for Lambda version traffic shifting in this pattern.

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:
AWS Lambda allocates CPU power proportionally to the amount of memory configured for the function. Increasing the memory setting increases the available CPU, which can reduce latency for CPU-bound workloads. Lambda does not provide a setting to directly increase vCPU cores, increasing ephemeral storage does not affect CPU performance, and increasing the timeout only allows the function to run longer without adding compute capacity.

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 for Amazon DynamoDB that reduces read latency from milliseconds to microseconds for suitable read workloads. It is specifically designed to accelerate DynamoDB access. ElastiCache is a general-purpose cache but not the purpose-built DynamoDB accelerator. DynamoDB auto scaling adjusts throughput capacity, not latency. CloudFront caches web content at edge locations and does not reduce DynamoDB query latency.

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:
CloudFormation StackSets are designed to deploy and manage CloudFormation stacks across multiple AWS Regions (and optionally multiple accounts) from a single template. In a single-account environment, StackSets can target multiple Regions, making them the most operationally efficient way to deploy and test the same infrastructure in both the primary and disaster recovery Regions from CodePipeline. CodeDeploy is for application deployments rather than CloudFormation templates, invoking CodeBuild to perform deployments adds unnecessary custom logic, and Snyk is a security scanning tool, not a deployment mechanism.

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:
CloudWatch Embedded Metric Format (EMF) lets a Lambda function write structured logs that automatically extract custom metrics into Amazon CloudWatch in near real time. Those metrics can then be graphed and used with CloudWatch Alarms. CloudTrail does not store custom metrics, Logs Insights is for querying logs rather than creating real-time custom metrics for alarms, and the Kinesis/S3 option is unnecessary and does not directly satisfy the monitoring requirement.

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:
Using an SSM dynamic reference in the CloudFormation template to populate a Lambda environment variable resolves the parameter at deployment/update time rather than on every invocation. Because the parameter changes only during deployments, this eliminates repeated GetParameter calls, avoids Parameter Store rate limiting, and is the most cost-effective solution. Reserved concurrency does not reduce Parameter Store calls, retries still generate API traffic and add latency, and increasing the service quota may incur additional cost and is unnecessary when the value is effectively static between deployments.

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 natively collects the EC2 CPUUtilization metric. A CloudWatch alarm can monitor this metric and trigger an Amazon SNS notification when CPU utilization exceeds the configured threshold (80%). CloudTrail records API activity, not performance metrics, and the cron job and Lambda/CloudTrail approaches do not monitor CPUUtilization appropriately.

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:
Provisioned Concurrency keeps a configured number of Lambda execution environments initialized and ready to serve requests, significantly reducing cold-start latency for latency-sensitive applications. Provisioned concurrency is configured on a published version or alias, so publishing a version is part of the setup. Reserved concurrency only limits or guarantees concurrency but does not pre-initialize execution environments, and increasing account concurrency quotas does not address cold starts.

$19

Get all 553 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.