PracticeCF

DVA-C02 Question Bank · Latest 50 Questions Free Preview (Page 3/5)

Questions 21–30 of the latest 50 DVA-C02 questions (5 pages total), with answers and explanations, no login required. Practice all 1394 questions online.

Question 21 · No. 1365 · Single choice

A developer is using AWS CodeDeploy to launch an application onto Amazon EC2 instances. The application deployment fails during testing. The developer notices an IAM_ROLE_PERMISSIONS error code in Amazon CloudWatch logs. What should the developer do to resolve the error?

Answer: C

Explanation: The error code IAM_ROLE_PERMISSIONS indicates that the CodeDeploy service role does not have the necessary permissions to perform the deployment. To resolve this, the developer should ensure that the AWSCodeDeployRole policy, which contains the required permissions for deploying applications on EC2 instances, is attached to the CodeDeploy service role.
Question 22 · No. 1366 · Single choice

A team deploys an AWS CloudFormation template to update a stack that already included an Amazon DynamoDB table. However, before the deployment of the update, the team changed the name of the DynamoDB table on the template by mistake. The DeletionPolicy attribute for all resources has the default value. What will be the result of this mistake?

Answer: A

Explanation: The default DeletionPolicy in AWS CloudFormation is 'Delete'. When the name of the DynamoDB table is changed in the template, CloudFormation treats it as a replacement of the resource. This means that the existing table will be deleted, and a new table with the new name will be created.
Question 23 · No. 1367 · Single choice

A company is launching a photo sharing application on AWS. Users use the application to upload images to an Amazon S3 bucket. When users upload images, an AWS Lambda function creates thumbnail versions of the images and stores the thumbnail versions in another S3 bucket. During development, a developer notices that the Lambda function takes more than 2 minutes to complete the thumbnail process. The company needs alll images to be processed in less than 30 seconds. What should the developer do to meet these requirements?

Answer: C

Explanation: The Lambda function's performance is directly tied to the amount of memory allocated to it. When you increase the memory, AWS also proportionally increases the CPU power available to the function. This allows the function to process tasks faster. In this case, increasing the memory will help the Lambda function complete the thumbnail generation process within the required 30 seconds. The other options are either invalid (like increasing vCPUs or changing instance types which aren't configurable for Lambda) or irrelevant (such as burstable performance).
Question 24 · No. 1368 · Single choice

An application that is running on Amazon EC2 instances stores data in an Amazon S3 bucket. All the data must be encrypted in transit. How can a developer ensure that all traffic to the S3 bucket is encrypted?

Answer: D

Explanation: The correct answer is D because the requirement is to ensure that all traffic to the S3 bucket is encrypted in transit. An S3 bucket policy can be configured with a condition that denies requests where the aws:SecureTransport key is false, effectively enforcing HTTPS (SSL/TLS) for all communication with the S3 bucket. Options A, B, and C do not directly address encryption in transit: A focuses on installing certificates but does not enforce HTTPS; B creates a private VPC endpoint but does not inherently encrypt traffic; and C enables server-side encryption, which protects data at rest, not in transit.
Question 25 · No. 1369 · Single choice

An AWS Lambda function that handles application requests uses the default Lambda logging mechanism to log the timestamp, processing time, and status of requests. A developer needs to create Amazon CloudWatch metrics based on the logs. The developer needs to write the metrics to a custom CloudWatch metrics namespace. Which solution will meet these requirements?

Answer: D

Explanation: The question requires creating custom Amazon CloudWatch metrics from AWS Lambda logs. The best solution is to use the CloudWatch Embedded Metric Format (EMF) directly in the structure of the log statements generated by the Lambda function. EMF allows you to emit custom metrics directly from your logs without requiring additional tools like CloudWatch Logs Insights or RUM, making it efficient and straightforward.
Question 26 · No. 1370 · Single choice

A company is building a social media application. A developer is modifying an AWS Lambda function that updates a database with data that tracks each user's online activity. A web application server uses the AWS SDK to invoke the Lambda function. The developer has tested the new Lambda code and is ready to deploy the code into production. However, the developer wants to allow only a small percentage of the invocations from the AWS SDK to call the new code. Which solution will meet these requirements?

Answer: B

Explanation: The correct solution is to create an alias for the Lambda function and configure a specific weight value for the updated version. Aliases in AWS Lambda allow you to manage different versions of your function and split traffic between them using weights. This capability enables gradual deployment by routing a small percentage of invocations to the new version while the majority still go to the stable version, ensuring controlled testing in production.
Question 27 · No. 1371 · Single choice

A developer published a change to a new version of an AWS Lambda function. To test the change, the developer must route 50% of the traffic to the new version and 60% of the traffic to the current version. What is the MOST operationally efficient way to meet this requirement?

Answer: C

Explanation: The most operationally efficient way to meet the requirement is to use a Lambda function alias. By setting up an alias, you can assign weights to different versions of the Lambda function (50% for the current version and 50% for the new version). This approach eliminates the need for additional services like Route 53 or API Gateway and directly achieves traffic splitting at the Lambda level.
Question 28 · No. 1372 · Single choice

A company has an Amazon DynamoDB table that contains records of users that have signed up for a trial of the company’s product. The company is using a spreadsheet to track data about the product trial. The company needs to ensure the spreadsheet is automatically updated with the latest information when individual trials begin, are updated, or finish. Which solution will meet these requirements?

Answer: C

Explanation: The correct solution is to enable a DynamoDB stream for the table and set the view type to 'new image'. This ensures that any changes to the table (inserts, updates, or deletions) are captured in the stream. A Lambda function can then process these changes and update the spreadsheet accordingly. DynamoDB streams are specifically designed to capture table activity and propagate it to other services like Lambda, making them ideal for this scenario. Using DynamoDB Accelerator (DAX) as proposed in options A and B is incorrect because DAX is a caching layer for DynamoDB and does not provide real-time notifications of changes.
Question 29 · No. 1373 · Single choice

A developer created an AWS Lambda function named ProcessMessages. The Lambda function is invoked asynchronously when a message is published to an Amazon Simple Notification Service (Amazon SNS) topic named InputTopic. The developer uses a second SNS topic named ErrorTopic to handle alerts of failures for other services. The developer wants to receive notifications from the ErrorTopic SNS topic when the ProcessMessages Lambda function fails to process a message. Which solution will meet this requirement?

Answer: B

Explanation: The correct solution is to configure a failure destination for the ProcessMessages Lambda function and specify the ARN of the ErrorTopic SNS topic as the destination. This approach ensures that whenever the Lambda function fails to process a message, the error details are automatically sent to the specified SNS topic for further handling or notification. Other options either involve incorrect configurations (like using filter policies on SNS topics or triggers) or do not directly address the requirement of sending failure notifications to the ErrorTopic.
Question 30 · No. 1374 · Multiple choice

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? (Choose two.)

Answer: B, E

Explanation: The question requires predictable invocation durations and low latency for the Lambda function. To achieve this, initialization activities like loading libraries and instantiating clients should not occur during actual function invocations but instead during allocation time. Option B (configure provisioned concurrency) ensures that the necessary execution environments are pre-initialized, reducing latency during invocation. Option E (publish a new version of the Lambda function) ensures that changes to the function are properly deployed and versioned, which is essential for consistent behavior. Option A is unrelated to solving latency issues, Option C ($LATEST version) is not recommended for production due to unpredictability, and Option D (reserved concurrency) limits scaling but does not address latency.
Prev 12345 Next