πŸ”

DVA-C02 β€” questions

Page 15 of 28 Β· 557 total questions.

Topic 1 Β· Question 281

A developer creates a static website for their department. The developer deploys the static assets for the website to an Amazon S3 bucket and serves the assets with Amazon CloudFront. The developer uses origin access control (OAC) on the CloudFront distribution to access the S3 bucket. The developer notices users can access the root URL and specific pages but cannot access directories without specifying a file name. For example, /products/index.html works, but /products/ returns an error. The developer needs to enable accessing directories without specifying a file name without exposing the S3 bucket publicly. Which solution will meet these requirements?

  • AUpdate the CloudFront distribution's settings to index.html as the default root object is set.
  • BUpdate the Amazon S3 bucket settings and enable static website hosting. Specify index.html as the Index document. Update the S3 bucket policy to enable access. Update the CloudFront distribution's origin to use the S3 website endpoint.
  • CCreate a CloudFront function that examines the request URL and appends index.html when directories are being accessed. Add the function as a viewer request CloudFront function to the CloudFront distribution's behavior. (correct answer)
  • DCreate a custom error response on the CloudFront distribution with the HTTP error code set to the HTTP 404 Not Found response code and the response page path to /index.html. Set the HTTP response code to the HTTP 200 OK response code.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Create a CloudFront function that examines the request URL and appends index.html when directories are being accessed. Add the function as a viewer request CloudFront function to the CloudFront distribution's behavior.

Explanation

Amazon CloudFront caches content at edge locations to reduce latency and offload origins.

Topic 1 Β· Question 282

A developer is testing a RESTful application that is deployed by using Amazon API Gateway and AWS Lambda. When the developer tests the user login by using credentials that are not valid, the developer receives an HTTP 405: METHOD_NOT_ALLOWED error. The developer has verified that the test is sending the correct request for the resource. Which HTTP error should the application return in response to the request?

  • AHTTP 401 (correct answer)
  • BHTTP 404
  • CHTTP 503
  • DHTTP 505
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: HTTP 401.

Topic 1 Β· Question 283

A developer must use multi-factor authentication (MFA) to access data in an Amazon S3 bucket that is in another AWS account. Which AWS Security Token Service (AWS STS) API operation should the developer use with the MFA information to meet this requirement?

  • AAssumeRoleWithWebIdentity
  • BGetFederationToken
  • CAssumeRoleWithSAML
  • DAssumeRole (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: AssumeRole.

Topic 1 Β· Question 284 Β· Select all that apply

A developer designed an application on an Amazon EC2 instance. The application makes API requests to objects in an Amazon S3 bucket. Which combination of steps will ensure that the application makes the API requests in the MOST secure manner? (Choose two.)

  • ACreate an IAM user that has permissions to the S3 bucket. Add the user to an IAM group.
  • BCreate an IAM role that has permissions to the S3 bucket. (correct answer)
  • CAdd the IAM role to an instance profile. Attach the instance profile to the EC2 instance. (correct answer)
  • DCreate an IAM role that has permissions to the S3 bucket. Assign the role to an IAM group.
  • EStore the credentials of the IAM user in the environment variables on the EC2 instance.
Reveal answer & explanation
Correct answer: B, C

The correct answer is B, C. Option B: Create an IAM role that has permissions to the S3 bucket. Option C: Add the IAM role to an instance profile. Attach the instance profile to the EC2 instance.

Explanation

Amazon EC2 provides resizable virtual servers when you need full control of the operating system. Amazon S3 provides durable, scalable object storage that is fully managed. An IAM role grants temporary, least-privilege permissions to AWS resources without long-term credentials.

Topic 1 Β· Question 285

An AWS Lambda function requires read access to an Amazon S3 bucket and requires read/write access to an Amazon DynamoDB table. The correct IAM policy already exists. What is the MOST secure way to grant the Lambda function access to the S3 bucket and the DynamoDB table?

  • AAttach the existing IAM policy to the Lambda function.
  • BCreate an IAM role for the Lambda function. Attach the existing IAM policy to the role. Attach the role to the Lambda function. (correct answer)
  • CCreate an IAM user with programmatic access. Attach the existing IAM policy to the user. Add the user access key ID and secret access key as environment variables in the Lambda function.
  • DAdd the AWS account root user access key ID and secret access key as encrypted environment variables in the Lambda function.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Create an IAM role for the Lambda function. Attach the existing IAM policy to the role. Attach the role to the Lambda function.

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. An IAM role grants temporary, least-privilege permissions to AWS resources without long-term credentials. AWS IAM controls authenticated and authorized access to AWS resources with fine-grained policies.

Topic 1 Β· Question 286

A developer is using AWS Step Functions to automate a workflow. The workflow defines each step as an AWS Lambda function task. The developer notices that runs of the Step Functions state machine fail in the GetResource task with either an IllegalArgumentException error or a TooManyRequestsException error. The developer wants the state machine to stop running when the state machine encounters an IllegalArgumentException error. The state machine needs to retry the GetResource task one additional time after 10 seconds if the state machine encounters a TooManyRequestsException error. If the second attempt fails, the developer wants the state machine to stop running. How can the developer implement the Lambda retry functionality without adding unnecessary complexity to the state machine?

  • AAdd a Delay task after the GetResource task. Add a catcher to the GetResource task. Configure the catcher with an error type of TooManyRequestsException. Configure the next step to be the Delay task. Configure the Delay task to wait for an interval of 10 seconds. Configure the next step to be the GetResource task.
  • BAdd a catcher to the GetResource task. Configure the catcher with an error type of TooManyRequestsException, an interval of 10 seconds, and a maximum attempts value of 1. Configure the next step to be the GetResource task.
  • CAdd a retrier to the GetResource task. Configure the retrier with an error type of TooManyRequestsException, an interval of 10 seconds, and a maximum attempts value of 1. (correct answer)
  • DDuplicate the GetResource task. Rename the new GetResource task to TryAgain. Add a catcher to the original GetResource task. Configure the catcher with an error type of TooManyRequestsException. Configure the next step to be TryAgain.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Add a retrier to the GetResource task. Configure the retrier with an error type of TooManyRequestsException, an interval of 10 seconds, and a maximum attempts value of 1.

Explanation

AWS Config tracks resource configuration changes and evaluates compliance.

Topic 1 Β· Question 287

A developer is creating a serverless application that uses an AWS Lambda function. The developer will use AWS CloudFormation to deploy the application. The application will write logs to Amazon CloudWatch Logs. The developer has created a log group in a CloudFormation template for the application to use. The developer needs to modify the CloudFormation template to make the name of the log group available to the application at runtime. Which solution will meet this requirement?

  • AUse the AWS::Include transform in CloudFormation to provide the log group's name to the application.
  • BPass the log group's name to the application in the user data section of the CloudFormation template.
  • CUse the CloudFormation template's Mappings section to specify the log group's name for the application.
  • DPass the log group's Amazon Resource Name (ARN) as an environment variable to the Lambda function. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Pass the log group's Amazon Resource Name (ARN) as an environment variable to the Lambda function.

Explanation

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

Topic 1 Β· Question 288

A developer is creating an Amazon DynamoDB table by using the AWS CLI. The DynamoDB table must use server-side encryption with an AWS owned encryption key. How should the developer create the DynamoDB table to meet these requirements?

  • ACreate an AWS Key Management Service (AWS KMS) customer managed key. Provide the key's Amazon Resource Name (ARN) in the KMSMasterKeyId parameter during creation of the DynamoDB table.
  • BCreate an AWS Key Management Service (AWS KMS) AWS managed key. Provide the key's Amazon Resource Name (ARN) in the KMSMasterKeyId parameter during creation of the DynamoDB table.
  • CCreate an AWS owned key. Provide the key's Amazon Resource Name (ARN) in the KMSMasterKeyId parameter during creation of the DynamoDB table.
  • DCreate the DynamoDB table with the default encryption options. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Create the DynamoDB table with the default encryption options.

Explanation

Amazon DynamoDB is a fully managed, serverless NoSQL database with single-digit millisecond latency and automatic scaling.

Topic 1 Β· Question 289

A company has an application that runs across multiple AWS Regions. The application is experiencing performance issues at irregular intervals. A developer must use AWS X-Ray to implement distributed tracing for the application to troubleshoot the root cause of the performance issues. What should the developer do to meet this requirement?

  • AUse the X-Ray console to add annotations for AWS services and user-defined services.
  • BUse Region annotation that X-Ray adds automatically for AWS services. Add Region annotation for user-defined services. (correct answer)
  • CUse the X-Ray daemon to add annotations for AWS services and user-defined services.
  • DUse Region annotation that X-Ray adds automatically for user-defined services. Configure X-Ray to add Region annotation for AWS services.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Use Region annotation that X-Ray adds automatically for AWS services. Add Region annotation for user-defined services.

Explanation

AWS X-Ray traces requests to analyze and debug distributed applications.

Topic 1 Β· Question 290

A company runs an application on AWS. The application uses an AWS Lambda function that is configured with an Amazon Simple Queue Service (Amazon SQS) queue called high priority queue as the event source. A developer is updating the Lambda function with another SQS queue called low priority queue as the event source. The Lambda function must always read up to 10 simultaneous messages from the high priority queue before processing messages from low priority queue. The Lambda function must be limited to 100 simultaneous invocations. Which solution will meet these requirements?

  • ASet the event source mapping batch size to 10 for the high priority queue and to 90 for the low priority queue.
  • BSet the delivery delay to 0 seconds for the high priority queue and to 10 seconds for the low priority queue.
  • CSet the event source mapping maximum concurrency to 10 for the high priority queue and to 90 for the low priority queue. (correct answer)
  • DSet the event source mapping batch window to 10 for the high priority queue and to 90 for the low priority queue.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Set the event source mapping maximum concurrency to 10 for the high priority queue and to 90 for the low priority queue.

Topic 1 Β· Question 291

A data visualization company wants to strengthen the security of its core applications. The applications are deployed on AWS across its development, staging, pre-production, and production environments. The company needs to encrypt all of its stored sensitive credentials. The sensitive credentials need to be automatically rotated. A version of the sensitive credentials need to be stored for each environment. Which solution will meet these requirements in the MOST operationally efficient way?

  • AConfigure AWS Secrets Manager versions to store different copies of the same credentials across multiple environments.
  • BCreate a new parameter version in AWS Systems Manager Parameter Store for each environment. Store the environment-specific credentials in the parameter version.
  • CConfigure the environment variables in the application code. Use different names for each environment type.
  • DConfigure AWS Secrets Manager to create a new secret for each environment type. Store the environment-specific credentials in the secret. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Configure AWS Secrets Manager to create a new secret for each environment type. Store the environment-specific credentials in the secret.

Explanation

AWS Secrets Manager stores and automatically rotates secrets such as database credentials. AWS Config tracks resource configuration changes and evaluates compliance.

Topic 1 Β· Question 292 Β· Select all that apply

A developer is investigating an issue in part of a company's application. In the application, messages are sent to an Amazon Simple Queue Service (Amazon SQS) queue. The AWS Lambda function polls messages from the SQS queue and sends email messages by using Amazon Simple Email Service (Amazon SES). Users have been receiving duplicate email messages during periods of high traffic. Which reasons could explain the duplicate email messages? (Choose two.)

  • AStandard SQS queues support at-least-once message delivery. (correct answer)
  • BStandard SQS queues support exactly-once processing, so the duplicate email messages are because of user error.
  • CAmazon SES has the DomainKeys Identified Mail (DKIM) authentication incorrectly configured.
  • DThe SQS queue's visibility timeout is lower than or the same as the Lambda function's timeout. (correct answer)
  • EThe Amazon SES bounce rate metric is too high.
Reveal answer & explanation
Correct answer: A, D

The correct answer is A, D. Option A: Standard SQS queues support at-least-once message delivery. Option D: The SQS queue's visibility timeout is lower than or the same as the Lambda function's timeout.

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. Amazon SQS is a fully managed message queue that decouples components and absorbs traffic spikes.

Topic 1 Β· Question 293

A developer is deploying a company's application to Amazon EC2 instances. The application generates gigabytes of data files each day. The files are rarely accessed, but the files must be available to the application's users within minutes of a request during the first year of storage. The company must retain the files for 7 years. How can the developer implement the application to meet these requirements MOST cost-effectively?

  • AStore the files in an Amazon S3 bucket. Use the S3 Glacier Instant Retrieval storage class. Create an S3 Lifecycle policy to transition the files to the S3 Glacier Deep Archive storage class after 1 year. (correct answer)
  • BStore the files in an Amazon S3 bucket. Use the S3 Standard storage class. Create an S3 Lifecycle policy to transition the files to the S3 Glacier Flexible Retrieval storage class after 1 year.
  • CStore the files on an Amazon Elastic Block Store (Amazon EBS) volume. Use Amazon Data Lifecycle Manager (Amazon DLM) to create snapshots of the EBS volumes and to store those snapshots in Amazon S3.
  • DStore the files on an Amazon Elastic File System (Amazon EFS) mount. Configure EFS lifecycle management to transition the files to the EFS Standard- Infrequent Access (Standard-IA) storage class after 1 year.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Store the files in an Amazon S3 bucket. Use the S3 Glacier Instant Retrieval storage class. Create an S3 Lifecycle policy to transition the files to the S3 Glacier Deep Archive storage class after 1 year.

Explanation

S3 Glacier Deep Archive is the lowest-cost storage for long-term archival with retrieval in hours. Amazon S3 Glacier offers low-cost archival storage for infrequently accessed data. S3 Lifecycle policies automatically transition or expire objects to control storage cost. This option delivers the requirement at the lowest cost.

Topic 1 Β· Question 294

A company's developer has deployed an application in AWS by using AWS CloudFormation. The CloudFormation stack includes parameters in AWS Systems Manager Parameter Store that the application uses as configuration settings. The application can modify the parameter values. When the developer updated the stack to create additional resources with tags, the developer noted that the parameter values were reset and that the values ignored the latest changes made by the application. The developer needs to change the way the company deploys the CloudFormation stack. The developer also needs to avoid resetting the parameter values outside the stack. Which solution will meet these requirements with the LEAST development effort?

  • AModify the CloudFormation stack to set the deletion policy to Retain for the Parameter Store parameters. (correct answer)
  • BCreate an Amazon DynamoDB table as a resource in the CloudFormation stack to hold configuration data for the application. Migrate the parameters that the application is modifying from Parameter Store to the DynamoDB table.
  • CCreate an Amazon RDS DB instance as a resource in the CloudFormation stack. Create a table in the database for parameter configuration. Migrate the parameters that the application is modifying from Parameter Store to the configuration table.
  • DModify the CloudFormation stack policy to deny updates on Parameter Store parameters.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Modify the CloudFormation stack to set the deletion policy to Retain for the Parameter Store parameters.

Explanation

AWS CloudFormation provisions infrastructure as code repeatably. This option needs the least custom development effort.

Topic 1 Β· Question 295

A company has a social media application that receives large amounts of traffic. User posts and interactions are continuously updated in an Amazon RDS database. The data changes frequently, and the data types can be complex. The application must serve read requests with minimal latency. The application's current architecture struggles to deliver these rapid data updates efficiently. The company needs a solution to improve the application's performance. Which solution will meet these requirements?

  • AUse Amazon DynamoDB Accelerator (DAX) in front of the RDS database to provide a caching layer for the high volume of rapidly changing data.
  • BSet up Amazon S3 Transfer Acceleration on the RDS database to enhance the speed of data transfer from the databases to the application.
  • CAdd an Amazon CloudFront distribution in front of the RDS database to provide a caching layer for the high volume of rapidly changing data.
  • DCreate an Amazon ElastiCache for Redis cluster. Update the application code to use a write-through caching strategy and read the data from Redis. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Create an Amazon ElastiCache for Redis cluster. Update the application code to use a write-through caching strategy and read the data from Redis.

Explanation

Amazon ElastiCache provides in-memory caching (Redis/Memcached) to reduce latency and offload the database.

Topic 1 Β· Question 296

A developer created an AWS Lambda function that performs a series of operations that involve multiple AWS services. The function's duration time is higher than normal. To determine the cause of the issue, the developer must investigate traffic between the services without changing the function code. Which solution will meet these requirements?

  • AEnable AWS X-Ray active tracing in the Lambda function. Review the logs in X-Ray. (correct answer)
  • BConfigure AWS CloudTrail. View the trail logs that are associated with the Lambda function.
  • CReview the AWS Config logs in Amazon CloudWatch.
  • DReview the Amazon CloudWatch logs that are associated with the Lambda function.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Enable AWS X-Ray active tracing in the Lambda function. Review the logs in X-Ray.

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. AWS X-Ray traces requests to analyze and debug distributed applications. This option needs the least custom development effort.

Topic 1 Β· Question 297 Β· Select all that apply

A company has on-premises data centers that run an image processing service. The service consists of containerized applications that run on Kubernetes clusters. All the applications have access to the same NFS share for files and data storage. The company is running out of NFS capacity in the data centers and needs to migrate to AWS as soon as possible. The Kubernetes clusters must be highly available on AWS. Which combination of actions will meet these requirements? (Choose two.)

  • ATransfer the information that is in the NFS share to an Amazon Elastic Block Store (Amazon EBS) volume. Upload the container images to Amazon Elastic Container Registry (Amazon ECR).
  • BTransfer the information that is in the NFS share to an Amazon Elastic File System (Amazon EFS) volume. Upload the container images to Amazon Elastic Container Registry (Amazon ECR). (correct answer)
  • CCreate an Amazon Elastic Container Service (Amazon ECS) cluster to run the applications. Configure each node of the cluster to mount the Amazon Elastic Block Store (Amazon EBS) volume at the required path for the container images.
  • DCreate an Amazon Elastic Kubernetes Service (Amazon EKS) cluster to run the applications. Configure each node of the cluster to mount the Amazon Elastic Block Store (Amazon EBS) volume at the required path for the container images.
  • ECreate an Amazon Elastic Kubernetes Service (Amazon EKS) cluster to run the applications. Configure each node of the cluster to mount the Amazon Elastic File System (Amazon EFS) volume at the required path for the container images. (correct answer)
Reveal answer & explanation
Correct answer: B, E

The correct answer is B, E. Option B: Transfer the information that is in the NFS share to an Amazon Elastic File System (Amazon EFS) volume. Upload the container images to Amazon Elastic Container Registry (Amazon ECR). Option E: Create an Amazon Elastic Kubernetes Service (Amazon EKS) cluster to run the applications. Configure each node of the cluster to mount the Amazon Elastic File System (Amazon EFS) volume at the required path for the con...

Explanation

Amazon EKS runs managed Kubernetes when you need the Kubernetes ecosystem. Amazon EFS is a shared, elastic NFS file system that multiple instances can mount concurrently across AZs. AWS Config tracks resource configuration changes and evaluates compliance. By spanning multiple Availability Zones / adding redundancy, this option provides the high availability and resilience required.

Topic 1 Β· Question 298

A company has an analytics application that uses an AWS Lambda function to process transaction data asynchronously. A developer notices that asynchronous invocations of the Lambda function sometimes fail. When failed Lambda function invocations occur, the developer wants to invoke a second Lambda function to handle errors and log details. Which solution will meet these requirements?

  • AConfigure a Lambda function destination with a failure condition. Specify Lambda function as the destination type. Specify the error-handling Lambda function's Amazon Resource Name (ARN) as the resource. (correct answer)
  • BEnable AWS X-Ray active tracing on the initial Lambda function. Configure X-Ray to capture stack traces of the failed invocations. Invoke the error-handling Lambda function by including the stack traces in the event object.
  • CConfigure a Lambda function trigger with a failure condition. Specify Lambda function as the destination type. Specify the error-handling Lambda function's Amazon Resource Name (ARN) as the resource.
  • DCreate a status check alarm on the initial Lambda function. Configure the alarm to invoke the error-handling Lambda function when the alarm is initiated. Ensure that the alarm passes the stack trace in the event object.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Configure a Lambda function destination with a failure condition. Specify Lambda function as the destination type. Specify the error-handling Lambda function's Amazon Resource Name (ARN) as the resource.

Explanation

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

Topic 1 Β· Question 299

A company introduced a new feature that should be accessible to only a specific group of premium customers. A developer needs the ability to turn the feature on and off in response to performance and feedback. The developer needs a solution to validate and deploy these configurations quickly without causing any disruptions. What should the developer do to meet these requirements?

  • AUse AWS AppConfig to manage the feature configuration and to validate and deploy changes. Use feature flags to turn the feature on and off. (correct answer)
  • BUse AWS Secrets Manager to securely manage and validate the feature configurations. Enable lifecycle rules to turn the feature on and off.
  • CUse AWS Config to manage the feature configuration and validation. Set up AWS Config rules to turn the feature on and off based on predefined conditions.
  • DUse AWS Systems Manager Parameter Store to store and validate the configuration settings for the feature. Enable lifecycle rules to turn the feature on and off.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Use AWS AppConfig to manage the feature configuration and to validate and deploy changes. Use feature flags to turn the feature on and off.

Explanation

AWS Config tracks resource configuration changes and evaluates compliance.

Topic 1 Β· Question 300

A developer needs approval from a product owner before the developer can deploy code for an application to production. The developer uses AWS CodePipeline to deploy the application. The developer configures an Amazon Simple Notification Service (Amazon SNS) topic to send notifications to the product owner. Which solution is the MOST operationally efficient way for the developer to receive approval from the product owner?

  • AAdd a new stage to CodePipeline before the production deployment. Add a manual approval action to the new stage. Add a new notification rule in the pipeline settings. Specify manual approval as the event that initiates the notification. Specify the SNS topic's Amazon Resource Name (ARN) to notify the product owner. (correct answer)
  • BDevelop an AWS Step Functions state machine that sends a notification to the product owner and accepts an approval. Add a new stage to CodePipeline before the production deployment. Add the state machine as a Step Functions action to the new stage.
  • CAdd a manual approval action to the existing production deployment stage in CodePipeline. Specify the SNS topic's Amazon Resource Name (ARN) while configuring the new manual approval action.
  • DEdit the settings in CodePipeline. Create a new notification rule. Specify manual approval as the event that initiates the notification. Create a new notification target. Specify the SNS topic to notify the product owner. Save the notification rule.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Add a new stage to CodePipeline before the production deployment. Add a manual approval action to the new stage. Add a new notification rule in the pipeline settings. Specify manual approval as the event that initiate...

Explanation

Amazon SNS is a managed pub/sub service for fan-out notifications to many subscribers. AWS CodePipeline automates continuous delivery pipelines.

Showing questions 281–300 of 557 Β· Page 15 of 28