DVA-C02 Question Bank · Latest 50 Questions Free Preview (Page 2/5)
Questions 11–20 of the latest 50 DVA-C02 questions (5 pages total), with answers and explanations, no login required. Practice all 1394 questions online.
Question 11 · No. 1355 · Single choice
A developer needs to automate deployments for a serverless, event-based workload. The developer needs to create standardized templates to define the infrastructure and to test the functionality of the workload locally before deployment The developer already uses a pipeline in AWS CodePipeline. The developer needs to incorporate any other infrastructure changes into the existing pipeline. Which solution will meet these requirements?
- A. Create an AWS Serverless Application Model (AWS SAM) template. Configure the pipeline stages in CodePipeline to run the necessary AWS SAM CLI commands to deploy the serverless workload.
- B. Create an AWS Step Functions workflow template based on the infrastructure by using the Amazon States Language. Start the Step Functions state machine from the existing pipeline.
- C. Create an AWS CloudFormation template. Use the existing pipeline workflow to build a pipeline for AWS CloudFormation stacks.
- D. Create an AWS Serverless Application Model (AWS SAM) template. Use an automated script to deploy the serverless workload by using the AWS SAM CLI deploy command.
Answer: A
Explanation: The question specifies the need to automate deployments for a serverless, event-based workload and to create standardized templates for infrastructure. AWS Serverless Application Model (AWS SAM) is specifically designed for serverless applications and supports local testing of workloads via the AWS SAM CLI. Additionally, incorporating changes into an existing AWS CodePipeline aligns with Option A, as AWS SAM integrates seamlessly with CodePipeline to automate deployments. Options B and C involve tools not tailored for serverless workloads, and Option D bypasses the pipeline requirement by using an automated script.
Question 12 · No. 1356 · Single choice
A developer is creating an AWS Lambda function that needs network access to private resources in a VPC. Which solution will provide this access with the LEAST operational overhead?
- A. Attach the Lambda function to the VPC through private subnets. Create a security group that allows network access to the private resources. Associate the security group with the Lambda function.
- B. Configure the Lambda function to route traffic through a VPN connection. Create a security group that allows network access to the private resources. Associate the security group with the Lambda function.
- C. Configure a VPC endpoint connection for the Lambda function. Set up the VPC endpoint to route traffic through a NAT gateway.
- D. Configure an AWS PrivateLink endpoint for the private resources. Configure the Lambda function to reference the PrivateLink endpoint.
Answer: A
Explanation: Attaching the Lambda function to the VPC through private subnets and using a security group is the simplest and most direct solution. It avoids the additional complexity and operational overhead of setting up a VPN, NAT gateway, or AWS PrivateLink. This approach ensures that the Lambda function can securely access private resources within the VPC without unnecessary infrastructure.
Question 13 · No. 1357 · Single choice
A developer has an application that runs in AWS Account A. The application must retrieve an AWS Secrets Manager secret that is encrypted by an AWS Key Management Service (AWS KMS) key from AWS Account B. The application’s role has permissions to access the secret in Account B. The developer must add a statement to the KMS key’s key policy to allow the role in Account A to use the KMS key in Account B. The permissions must grant least privilege access to the role. Which permissions will meet these requirements?
- A. kms:Decrypt and kms:DescribeKey
- B. secretsmanager:DescribeSecret and secretsmanager:GetSecretValue
- C. kms:*
- D. secretsmanager:*
Answer: A
Explanation: The question requires granting the least privilege access to the role in Account A to use the KMS key in Account B. Since the application needs to retrieve a Secrets Manager secret encrypted by a KMS key, the necessary permissions are 'kms:Decrypt' (to decrypt the secret) and 'kms:DescribeKey' (to get details about the KMS key). The other options (B, C, D) either grant excessive permissions or do not directly align with the requirement to enable KMS-specific actions.
Question 14 · No. 1358 · Multiple choice
A development team is designing a mobile app that requires multi-factor authentication. Which steps should be taken to achieve this? (Choose two.)
- A. Use Amazon Cognito to create a user pool and create users in the user pool.
- B. Send multi-factor authentication text codes to users with the Amazon SNS Publish API call in the app code.
- C. Enable multi-factor authentication for the Amazon Cognito user pool.
- D. Use AWS IAM to create IAM users.
- E. Enable multifactor authentication for the users created in AWS IAM.
Answer: A, C
Explanation: To implement multi-factor authentication for a mobile app, Amazon Cognito is the most suitable service because it provides user pool functionality and built-in support for MFA. Option A involves creating a user pool and managing users through Cognito, while option C ensures that MFA is enabled specifically for the user pool. Options B, D, and E either involve services not ideal for this use case (like SNS or IAM) or do not provide a direct method to accomplish MFA within the mobile app context.
Question 15 · No. 1359 · Single choice
A developer has implemented an AWS Lambda function that inserts new customers into an Amazon RDS database. The function is expected to run hundreds of times each hour. The function and RDS database are in the same VPC. The function is configured to use 512 MB of RAM and is based on the following pseudo code: <img src="https://img.examtopics.com/aws-certified-developer-associate-dva-c02/image38.png"> After successfully testing the function multiple times, the developer notices that the execution time is longer than expected. What should the developer do to improve performance?
- A. Increase the reserved concurrency of the Lambda function.
- B. Increase the size of the RDS database to facilitate an increased number of database connections each hour.
- C. Move the database connection and close statement out of the handler. Place the connection in the global space.
- D. Replace Amazon RDS with Amazon DynamoDB to implement control over the number of writes per second.
Answer: C
Explanation: The Lambda function is creating a new database connection every time it runs, which is inefficient and can lead to longer execution times. Moving the database connection outside the handler to a global space ensures that the connection is reused across invocations, improving performance.
Question 16 · No. 1360 · Single choice
A developer is building the authentication mechanism for a new mobile app. Users need to be able to sign up, sign in, and access secured backend AWS resources. Which solution will meet these requirements?
- A. Use AWS Identity and Access Management Access Analyzer to generate IAM policies. Create an IAM role. Attach the policies to the role. Integrate the IAM role with an identity provider that the mobile app uses.
- B. Create an IAM policy that grants access to the backend resources. Create an IAM role. Attach the policy to the role. Create an Amazon API Gateway endpoint. Attach the role to the endpoint. Integrate the endpoint with the mobile app.
- C. Create an Amazon Cognito identity pool. Configure permissions by choosing a default IAM role for authenticated users or guest users in the identity pool. Associate the identity pool with an identity provider. Integrate the identity pool with the mobile app.
- D. Create an Amazon Cognito user pool. Configure the security requirements by choosing a password policy, multi-factor authentication (MFA) requirements, and user account recovery options. Create an app client. Integrate the app client with the mobile app.
Answer: D
Explanation: The question asks for a solution that allows users to sign up, sign in, and access secured backend AWS resources. Amazon Cognito User Pools are specifically designed for user authentication and management, providing features like sign-up/sign-in, password policies, MFA, and account recovery. This makes option D the best choice. Options A and B focus on IAM roles and policies but do not directly address user authentication. Option C (Identity Pool) is for federated identity access, but it does not handle the user sign-up and sign-in process as effectively as a User Pool.
Question 17 · No. 1361 · Single choice
A company wants to send notifications to customers to advertise a sale on the company’s products. The company needs to use Amazon Simple Notification Service (Amazon SNS) FIFO topics. The company needs to examine the rate at which the topics send notifications and the latency with which the topics send notifications. Which solution will meet these requirements with the MOST operational efficiency?
- A. Use AWS X-Ray. Enable active tracing for Amazon SNS.
- B. Use the Amazon CloudWatch NumberOfNotificationsFailed metric.
- C. Use AWS CloudTrail to log all Amazon SNS API calls.
- D. Use Amazon GuardDuty. Enable runtime monitoring.
Answer: A
Explanation: The question asks for the most operationally efficient solution to monitor the rate and latency of Amazon SNS FIFO topics. AWS X-Ray is specifically designed for analyzing and tracing application performance, including services like Amazon SNS. By enabling active tracing for SNS, you can gain detailed insights into the notification delivery rate and latency effectively. Other options either don't provide the necessary granularity (e.g., CloudWatch metrics) or are not designed for this purpose (e.g., CloudTrail logs API calls but doesn’t measure performance, GuardDuty focuses on security).
Question 18 · No. 1362 · Single choice
A company stores customer credit reports in an Amazon S3 bucket. An analytics service uses standard Amazon S3 GET requests to access the reports. A developer must implement a solution to redact personally identifiable information (PII) from the reports before the reports reach the analytics service. Which solution will meet this requirement with the MOST operational efficiency?
- A. Load the S3 objects into Amazon Redshift by using a COPY command. Implement dynamic data masking. Refactor the analytics service to read from Amazon Redshift.
- B. Set up an S3 Object Lambda function. Attach the function to an S3 Object Lambda Access Point. Program the function to call a PII redaction API.
- C. Use AWS Key Management Service (AWS KMS) to implement encryption in the S3 bucket. Re-upload all the existing S3 objects. Give the kms:Decrypt permission to the analytics service.
- D. Create an Amazon Simple Notification Service (Amazon SNS) topic. Implement message data protection. Refactor the analytics service to publish data access requests to the SNS topic.
Answer: B
Explanation: The requirement is to redact personally identifiable information (PII) from the reports before they reach the analytics service. The most operationally efficient solution is to use S3 Object Lambda, which allows you to process and transform data on the fly as it is being retrieved from S3. By attaching an S3 Object Lambda function to an S3 Object Lambda Access Point and programming the function to call a PII redaction API, the data can be dynamically redacted without requiring changes to the storage infrastructure or re-uploading objects. Solutions like Amazon Redshift (A), AWS KMS encryption (C), and Amazon SNS (D) either introduce unnecessary complexity or fail to address the need for dynamic PII redaction.
Question 19 · No. 1363 · Single choice
A developer is working on a project that requires regular updates to a web application’s backend code. The code is stored in AWS CodeCommit. Company policy states that all code must have complete unit testing and that the test results must be available for access. The developer needs to implement a solution that will take each change to the code repository, build the code, and run unit tests. The solution also must provide a detailed report of the test results. Which solution will meet these requirements?
- A. Configure AWS CodeDeploy to deploy code from CodeCommit and to run unit tests. Send the test results to Amazon CloudWatch metrics to view reports.
- B. Configure Amazon CodeWhisperer to create the code and to run unit tests. Save the test results in an Amazon S3 bucket to generate reports.
- C. Configure AWS CodeBuild to build the code and to run unit tests. Use test reporting in CodeBuild to generate and view reports.
- D. Create AWS Lambda functions that run when changes are made in CodeCommit. Program the Lambda functions to build the code, run unit tests, and save the test results to a Lambda layer.
Answer: C
Explanation: The question requires a solution that automates building the code, running unit tests, and generating detailed test reports. AWS CodeBuild is specifically designed for this purpose. It integrates seamlessly with AWS CodeCommit, can build the code, run unit tests, and generate detailed test reports using its built-in test reporting feature. Other options either misuse services (e.g., CodeDeploy is for deployment, not testing) or are impractical (e.g., Lambda functions are not ideal for this use case).
Question 20 · No. 1364 · Single choice
A cloud-based video surveillance company is developing an application that analyzes video files. After the application analyzes the files, the company can discard the files. The company stores the files in an Amazon S3 bucket. The files are 1 GB in size on average. No file is larger than 2 GB. An AWS Lambda function will run one time for each video file that is processed. The processing is very I/O intensive, and the application must read each file multiple times. Which solution will meet these requirements in the MOST performance-optimized way?
- A. Attach an Amazon Elastic Block Store (Amazon EBS) volume that is larger than 1 GB to the Lambda function. Copy the files from the S3 bucket to the EBS volume.
- B. Attach an Elastic Network Adapter (ENA) to the Lambda function. Use the ENA to read the video files from the S3 bucket.
- C. Increase the ephemeral storage size to 2 GB. Copy the files from the S3 bucket to the /tmp directory of the Lambda function.
- D. Configure the Lambda function code to read the video files directly from the S3 bucket.
Answer: C
Explanation: The most performance-optimized solution is to increase the ephemeral storage size to 2 GB and copy the files from the S3 bucket to the /tmp directory of the Lambda function. This approach ensures that the I/O-intensive processing can be performed efficiently by leveraging local storage, which provides faster access compared to reading directly from S3 or attaching additional resources like EBS or ENA. Additionally, AWS Lambda supports increasing ephemeral storage up to 10 GB, so this is well within the limits.