🔍

DVA-C02 — questions

Page 3 of 28 · 557 total questions.

Topic 1 · Question 41 · Select all that apply

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.)

  • ACacheHitCount
  • BIntegrationLatency (correct answer)
  • CCacheMissCount
  • DLatency (correct answer)
  • ECount
Reveal answer & explanation
Correct answer: B, D

The correct answer is B, D. Option B: IntegrationLatency Option D: Latency.

Topic 1 · Question 42

A development team wants to build a continuous integration/continuous delivery (CI/CD) pipeline. The team is using AWS CodePipeline to automate the code build and deployment. The team wants to store the program code to prepare for the CI/CD pipeline. Which AWS service should the team use to store the program code?

  • AAWS CodeDeploy
  • BAWS CodeArtifact
  • CAWS CodeCommit (correct answer)
  • DAmazon CodeGuru
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: AWS CodeCommit

Explanation

AWS CodeCommit hosts private Git repositories.

Topic 1 · Question 43

A developer is designing an AWS Lambda function that creates temporary files that are less than 10 MB during invocation. The temporary files will be accessed and modified multiple times during invocation. The developer has no need to save or retrieve these files in the future. Where should the temporary files be stored?

  • Athe /tmp directory (correct answer)
  • BAmazon Elastic File System (Amazon EFS)
  • CAmazon Elastic Block Store (Amazon EBS)
  • DAmazon S3
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: the /tmp directory.

Topic 1 · Question 44

A developer is designing a serverless application with two AWS Lambda functions to process photos. One Lambda function stores objects in an Amazon S3 bucket and stores the associated metadata in an Amazon DynamoDB table. The other Lambda function fetches the objects from the S3 bucket by using the metadata from the DynamoDB table. Both Lambda functions use the same Python library to perform complex computations and are approaching the quota for the maximum size of zipped deployment packages. What should the developer do to reduce the size of the Lambda deployment packages with the LEAST operational overhead?

  • APackage each Python library in its own .zip file archive. Deploy each Lambda function with its own copy of the library.
  • BCreate a Lambda layer with the required Python library. Use the Lambda layer in both Lambda functions. (correct answer)
  • CCombine the two Lambda functions into one Lambda function. Deploy the Lambda function as a single .zip file archive.
  • DDownload the Python library to an S3 bucket. Program the Lambda functions to reference the object URLs.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Create a Lambda layer with the required Python library. Use the Lambda layer in both Lambda functions.

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead.

Topic 1 · Question 45

A developer is writing an AWS Lambda function. The developer wants to log key events that occur while the Lambda function runs. The developer wants to include a unique identifier to associate the events with a specific function invocation. The developer adds the following code to the Lambda function: Which solution will meet this requirement?

Exhibit 1 for question 45
  • AObtain the request identifier from the AWS request ID field in the context object. Configure the application to write logs to standard output. (correct answer)
  • BObtain the request identifier from the AWS request ID field in the event object. Configure the application to write logs to a file.
  • CObtain the request identifier from the AWS request ID field in the event object. Configure the application to write logs to standard output.
  • DObtain the request identifier from the AWS request ID field in the context object. Configure the application to write logs to a file.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Obtain the request identifier from the AWS request ID field in the context object. Configure the application to write logs to standard output.

Explanation

AWS Config tracks resource configuration changes and evaluates compliance.

Topic 1 · Question 46

A developer is working on a serverless application that needs to process any changes to an Amazon DynamoDB table with an AWS Lambda function. How should the developer configure the Lambda function to detect changes to the DynamoDB table?

  • ACreate an Amazon Kinesis data stream, and attach it to the DynamoDB table. Create a trigger to connect the data stream to the Lambda function.
  • BCreate an Amazon EventBridge rule to invoke the Lambda function on a regular schedule. Conned to the DynamoDB table from the Lambda function to detect changes.
  • CEnable DynamoDB Streams on the table. Create a trigger to connect the DynamoDB stream to the Lambda function. (correct answer)
  • DCreate an Amazon Kinesis Data Firehose delivery stream, and attach it to the DynamoDB table. Configure the delivery stream destination as the Lambda function.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Enable DynamoDB Streams on the table. Create a trigger to connect the DynamoDB stream to the Lambda function.

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. Amazon DynamoDB is a fully managed, serverless NoSQL database with single-digit millisecond latency and automatic scaling.

Topic 1 · Question 47 · Select all that apply

An application uses an Amazon EC2 Auto Scaling group. A developer notices that EC2 instances are taking a long time to become available during scale-out events. The UserData script is taking a long time to run. The developer must implement a solution to decrease the time that elapses before an EC2 instance becomes available. The solution must make the most recent version of the application available at all times and must apply all available security updates. The solution also must minimize the number of images that are created. The images must be validated. Which combination of steps should the developer take to meet these requirements? (Choose two.)

  • AUse EC2 Image Builder to create an Amazon Machine Image (AMI). Install all the patches and agents that are needed to manage and run the application. Update the Auto Scaling group launch configuration to use the AMI. (correct answer)
  • BUse EC2 Image Builder to create an Amazon Machine Image (AMI). Install the latest version of the application and all the patches and agents that are needed to manage and run the application. Update the Auto Scaling group launch configuration to use the AMI.
  • CSet up AWS CodeDeploy to deploy the most recent version of the application at runtime. (correct answer)
  • DSet up AWS CodePipeline to deploy the most recent version of the application at runtime.
  • ERemove any commands that perform operating system patching from the UserData script.
Reveal answer & explanation
Correct answer: A, C

The correct answer is A, C. Option A: Use EC2 Image Builder to create an Amazon Machine Image (AMI). Install all the patches and agents that are needed to manage and run the application. Update the Auto Scaling group launch configuration to use the AMI. Option C: Set up AWS CodeDeploy to deploy the most recent version of the application at runtime.

Explanation

Auto Scaling adjusts capacity automatically to match demand, improving availability and cost efficiency. Amazon EC2 provides resizable virtual servers when you need full control of the operating system. AWS Config tracks resource configuration changes and evaluates compliance.

Topic 1 · Question 48

A developer is creating an AWS Lambda function that needs credentials to connect to an Amazon RDS for MySQL database. An Amazon S3 bucket currently stores the credentials. The developer needs to improve the existing solution by implementing credential rotation and secure storage. The developer also needs to provide integration with the Lambda function. Which solution should the developer use to store and retrieve the credentials with the LEAST management overhead?

  • AStore the credentials in AWS Systems Manager Parameter Store. Select the database that the parameter will access. Use the default AWS Key Management Service (AWS KMS) key to encrypt the parameter. Enable automatic rotation for the parameter. Use the parameter from Parameter Store on the Lambda function to connect to the database.
  • BEncrypt the credentials with the default AWS Key Management Service (AWS KMS) key. Store the credentials as environment variables for the Lambda function. Create a second Lambda function to generate new credentials and to rotate the credentials by updating the environment variables of the first Lambda function. Invoke the second Lambda function by using an Amazon EventBridge rule that runs on a schedule. Update the database to use the new credentials. On the first Lambda function, retrieve the credentials from the environment variables. Decrypt the credentials by using AWS KMS, Connect to the database.
  • CStore the credentials in AWS Secrets Manager. Set the secret type to Credentials for Amazon RDS database. Select the database that the secret will access. Use the default AWS Key Management Service (AWS KMS) key to encrypt the secret. Enable automatic rotation for the secret. Use the secret from Secrets Manager on the Lambda function to connect to the database. (correct answer)
  • DEncrypt the credentials by using AWS Key Management Service (AWS KMS). Store the credentials in an Amazon DynamoDB table. Create a second Lambda function to rotate the credentials. Invoke the second Lambda function by using an Amazon EventBridge rule that runs on a schedule. Update the DynamoDB table. Update the database to use the generated credentials. Retrieve the credentials from DynamoDB with the first Lambda function. Connect to the database.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Store the credentials in AWS Secrets Manager. Set the secret type to Credentials for Amazon RDS database. Select the database that the secret will access. Use the default AWS Key Management Service (AWS KMS) key to en...

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. Amazon RDS is a managed relational database that handles patching, backups and failover. AWS KMS manages encryption keys and integrates with most AWS services for encryption at rest.

Topic 1 · Question 49

A developer has written the following IAM policy to provide access to an Amazon S3 bucket: Which access does the policy allow regarding the s3:GetObject and s3:PutObject actions?

Exhibit 1 for question 49
  • AAccess on all buckets except the “DOC-EXAMPLE-BUCKET” bucket
  • BAccess on all buckets that start with “DOC-EXAMPLE-BUCKET” except the “DOC-EXAMPLE-BUCKET/secrets” bucket
  • CAccess on all objects in the “DOC-EXAMPLE-BUCKET” bucket along with access to all S3 actions for objects in the “DOC-EXAMPLE-BUCKET” bucket that start with “secrets”
  • DAccess on all objects in the “DOC-EXAMPLE-BUCKET” bucket except on objects that start with “secrets” (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Access on all objects in the “DOC-EXAMPLE-BUCKET” bucket except on objects that start with “secrets”.

Topic 1 · Question 50

A developer is creating a mobile app that calls a backend service by using an Amazon API Gateway REST API. For integration testing during the development phase, the developer wants to simulate different backend responses without invoking the backend service. Which solution will meet these requirements with the LEAST operational overhead?

  • ACreate an AWS Lambda function. Use API Gateway proxy integration to return constant HTTP responses.
  • BCreate an Amazon EC2 instance that serves the backend REST API by using an AWS CloudFormation template.
  • CCustomize the API Gateway stage to select a response type based on the request.
  • DUse a request mapping template to select the mock integration response. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Use a request mapping template to select the mock integration response.

Topic 1 · Question 51

A developer has a legacy application that is hosted on-premises. Other applications hosted on AWS depend on the on-premises application for proper functioning. In case of any application errors, the developer wants to be able to use Amazon CloudWatch to monitor and troubleshoot all applications from one place. How can the developer accomplish this?

  • AInstall an AWS SDK on the on-premises server to automatically send logs to CloudWatch.
  • BDownload the CloudWatch agent to the on-premises server. Configure the agent to use IAM user credentials with permissions for CloudWatch. (correct answer)
  • CUpload log files from the on-premises server to Amazon S3 and have CloudWatch read the files.
  • DUpload log files from the on-premises server to an Amazon EC2 instance and have the instance forward the logs to CloudWatch.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Download the CloudWatch agent to the on-premises server. Configure the agent to use IAM user credentials with permissions for CloudWatch.

Explanation

AWS IAM controls authenticated and authorized access to AWS resources with fine-grained policies. Amazon CloudWatch collects metrics, logs and alarms to monitor and react to operational health. AWS Config tracks resource configuration changes and evaluates compliance.

Topic 1 · Question 52

An Amazon Kinesis Data Firehose delivery stream is receiving customer data that contains personally identifiable information. A developer needs to remove pattern-based customer identifiers from the data and store the modified data in an Amazon S3 bucket. What should the developer do to meet these requirements?

  • AImplement Kinesis Data Firehose data transformation as an AWS Lambda function. Configure the function to remove the customer identifiers. Set an Amazon S3 bucket as the destination of the delivery stream. (correct answer)
  • BLaunch an Amazon EC2 instance. Set the EC2 instance as the destination of the delivery stream. Run an application on the EC2 instance to remove the customer identifiers. Store the transformed data in an Amazon S3 bucket.
  • CCreate an Amazon OpenSearch Service instance. Set the OpenSearch Service instance as the destination of the delivery stream. Use search and replace to remove the customer identifiers. Export the data to an Amazon S3 bucket.
  • DCreate an AWS Step Functions workflow to remove the customer identifiers. As the last step in the workflow, store the transformed data in an Amazon S3 bucket. Set the workflow as the destination of the delivery stream.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Implement Kinesis Data Firehose data transformation as an AWS Lambda function. Configure the function to remove the customer identifiers. Set an Amazon S3 bucket as the destination of the delivery stream.

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. Amazon S3 provides durable, scalable object storage that is fully managed. Kinesis Data Firehose delivers streaming data to destinations like S3/Redshift with no servers to manage.

Topic 1 · Question 53

A developer is using an AWS Lambda function to generate avatars for profile pictures that are uploaded to an Amazon S3 bucket. The Lambda function is automatically invoked for profile pictures that are saved under the /original/ S3 prefix. The developer notices that some pictures cause the Lambda function to time out. The developer wants to implement a fallback mechanism by using another Lambda function that resizes the profile picture. Which solution will meet these requirements with the LEAST development effort?

  • ASet the image resize Lambda function as a destination of the avatar generator Lambda function for the events that fail processing. (correct answer)
  • BCreate an Amazon Simple Queue Service (Amazon SQS) queue. Set the SQS queue as a destination with an on failure condition for the avatar generator Lambda function. Configure the image resize Lambda function to poll from the SQS queue.
  • CCreate an AWS Step Functions state machine that invokes the avatar generator Lambda function and uses the image resize Lambda function as a fallback. Create an Amazon EventBridge rule that matches events from the S3 bucket to invoke the state machine.
  • DCreate an Amazon Simple Notification Service (Amazon SNS) topic. Set the SNS topic as a destination with an on failure condition for the avatar generator Lambda function. Subscribe the image resize Lambda function to the SNS topic.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Set the image resize Lambda function as a destination of the avatar generator Lambda function for the events that fail processing.

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. This option needs the least custom development effort.

Topic 1 · Question 54

A developer needs to migrate an online retail application to AWS to handle an anticipated increase in traffic. The application currently runs on two servers: one server for the web application and another server for the database. The web server renders webpages and manages session state in memory. The database server hosts a MySQL database that contains order details. When traffic to the application is heavy, the memory usage for the web server approaches 100% and the application slows down considerably. The developer has found that most of the memory increase and performance decrease is related to the load of managing additional user sessions. For the web server migration, the developer will use Amazon EC2 instances with an Auto Scaling group behind an Application Load Balancer. Which additional set of changes should the developer make to the application to improve the application's performance?

  • AUse an EC2 instance to host the MySQL database. Store the session data and the application data in the MySQL database.
  • BUse Amazon ElastiCache for Memcached to store and manage the session data. Use an Amazon RDS for MySQL DB instance to store the application data. (correct answer)
  • CUse Amazon ElastiCache for Memcached to store and manage the session data and the application data.
  • DUse the EC2 instance store to manage the session data. Use an Amazon RDS for MySQL DB instance to store the application data.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Use Amazon ElastiCache for Memcached to store and manage the session data. Use an Amazon RDS for MySQL DB instance to store the application data.

Explanation

Amazon RDS is a managed relational database that handles patching, backups and failover. Amazon ElastiCache provides in-memory caching (Redis/Memcached) to reduce latency and offload the database.

Topic 1 · Question 55

An application uses Lambda functions to extract metadata from files uploaded to an S3 bucket; the metadata is stored in Amazon DynamoDB. The application starts behaving unexpectedly, and the developer wants to examine the logs of the Lambda function code for errors. Based on this system configuration, where would the developer find the logs?

  • AAmazon S3
  • BAWS CloudTrail
  • CAmazon CloudWatch (correct answer)
  • DAmazon DynamoDB
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Amazon CloudWatch

Explanation

Amazon CloudWatch collects metrics, logs and alarms to monitor and react to operational health.

Topic 1 · Question 56 · Select all that apply

A company is using an AWS Lambda function to process records from an Amazon Kinesis data stream. The company recently observed slow processing of the records. A developer notices that the iterator age metric for the function is increasing and that the Lambda run duration is constantly above normal. Which actions should the developer take to increase the processing speed? (Choose two.)

  • AIncrease the number of shards of the Kinesis data stream. (correct answer)
  • BDecrease the timeout of the Lambda function.
  • CIncrease the memory that is allocated to the Lambda function. (correct answer)
  • DDecrease the number of shards of the Kinesis data stream.
  • EIncrease the timeout of the Lambda function.
Reveal answer & explanation
Correct answer: A, C

The correct answer is A, C. Option A: Increase the number of shards of the Kinesis data stream. Option C: Increase the memory that is allocated to the Lambda function.

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. Amazon RDS is a managed relational database that handles patching, backups and failover. Amazon Kinesis ingests and processes real-time streaming data at scale.

Topic 1 · Question 57

A company needs to harden its container images before the images are in a running state. The company's application uses Amazon Elastic Container Registry (Amazon ECR) as an image registry. Amazon Elastic Kubernetes Service (Amazon EKS) for compute, and an AWS CodePipeline pipeline that orchestrates a continuous integration and continuous delivery (CI/CD) workflow. Dynamic application security testing occurs in the final stage of the pipeline after a new image is deployed to a development namespace in the EKS cluster. A developer needs to place an analysis stage before this deployment to analyze the container image earlier in the CI/CD pipeline. Which solution will meet these requirements with the MOST operational efficiency?

  • ABuild the container image and run the docker scan command locally. Mitigate any findings before pushing changes to the source code repository. Write a pre-commit hook that enforces the use of this workflow before commit.
  • BCreate a new CodePipeline stage that occurs after the container image is built. Configure ECR basic image scanning to scan on image push. Use an AWS Lambda function as the action provider. Configure the Lambda function to check the scan results and to fail the pipeline if there are findings. (correct answer)
  • CCreate a new CodePipeline stage that occurs after source code has been retrieved from its repository. Run a security scanner on the latest revision of the source code. Fail the pipeline if there are findings.
  • DAdd an action to the deployment stage of the pipeline so that the action occurs before the deployment to the EKS cluster. Configure ECR basic image scanning to scan on image push. Use an AWS Lambda function as the action provider. Configure the Lambda function to check the scan results and to fail the pipeline if there are findings.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Create a new CodePipeline stage that occurs after the container image is built. Configure ECR basic image scanning to scan on image push. Use an AWS Lambda function as the action provider. Configure the Lambda functio...

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. AWS Config tracks resource configuration changes and evaluates compliance. AWS CodePipeline automates continuous delivery pipelines.

Topic 1 · Question 58

A developer is testing a new file storage application that uses an Amazon CloudFront distribution to serve content from an Amazon S3 bucket. The distribution accesses the S3 bucket by using an origin access identity (OAI). The S3 bucket's permissions explicitly deny access to all other users. The application prompts users to authenticate on a login page and then uses signed cookies to allow users to access their personal storage directories. The developer has configured the distribution to use its default cache behavior with restricted viewer access and has set the origin to point to the S3 bucket. However, when the developer tries to navigate to the login page, the developer receives a 403 Forbidden error. The developer needs to implement a solution to allow unauthenticated access to the login page. The solution also must keep all private content secure. Which solution will meet these requirements?

  • AAdd a second cache behavior to the distribution with the same origin as the default cache behavior. Set the path pattern for the second cache behavior to the path of the login page, and make viewer access unrestricted. Keep the default cache behavior's settings unchanged. (correct answer)
  • BAdd a second cache behavior to the distribution with the same origin as the default cache behavior. Set the path pattern for the second cache behavior to *, and make viewer access restricted. Change the default cache behavior's path pattern to the path of the login page, and make viewer access unrestricted.
  • CAdd a second origin as a failover origin to the default cache behavior. Point the failover origin to the S3 bucket. Set the path pattern for the primary origin to *, and make viewer access restricted. Set the path pattern for the failover origin to the path of the login page, and make viewer access unrestricted.
  • DAdd a bucket policy to the S3 bucket to allow read access. Set the resource on the policy to the Amazon Resource Name (ARN) of the login page object in the S3 bucket. Add a CloudFront function to the default cache behavior to redirect unauthorized requests to the login page's S3 URL.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Add a second cache behavior to the distribution with the same origin as the default cache behavior. Set the path pattern for the second cache behavior to the path of the login page, and make viewer access unrestricted...

Topic 1 · Question 59

A developer is using AWS Amplify Hosting to build and deploy an application. The developer is receiving an increased number of bug reports from users. The developer wants to add end-to-end testing to the application to eliminate as many bugs as possible before the bugs reach production. Which solution should the developer implement to meet these requirements?

  • ARun the amplify add test command in the Amplify CLI.
  • BCreate unit tests in the application. Deploy the unit tests by using the amplify push command in the Amplify CLI.
  • CAdd a test phase to the amplify.yml build settings for the application. (correct answer)
  • DAdd a test phase to the aws-exports.js file for the application.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Add a test phase to the amplify.yml build settings for the application.

Topic 1 · Question 60

An ecommerce company is using an AWS Lambda function behind Amazon API Gateway as its application tier. To process orders during checkout, the application calls a POST API from the frontend. The POST API invokes the Lambda function asynchronously. In rare situations, the application has not processed orders. The Lambda application logs show no errors or failures. What should a developer do to solve this problem?

  • AInspect the frontend logs for API failures. Call the POST API manually by using the requests from the log file.
  • BCreate and inspect the Lambda dead-letter queue. Troubleshoot the failed functions. Reprocess the events. (correct answer)
  • CInspect the Lambda logs in Amazon CloudWatch for possible errors. Fix the errors.
  • DMake sure that caching is disabled for the POST API in API Gateway.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Create and inspect the Lambda dead-letter queue. Troubleshoot the failed functions. Reprocess the events.

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. This option decouples the components so they scale independently and absorb load spikes.

Showing questions 4160 of 557 · Page 3 of 28