πŸ”

DVA-C02 β€” questions

Page 26 of 28 Β· 557 total questions.

Topic 1 Β· Question 501

A developer is working on a new authorization mechanism for an application. The developer must create an Amazon API Gateway API and must test JSON Web Token (JWT) authorization on the API. The developer must use the built-in authorizer and must avoid managing the code with custom logic. The developer needs to define an API route that is available at /auth to test the authorizer configuration. Which solution will meet these requirements?

  • ACreate a WebSocket API and the /auth route. Configure and attach the JWT authorizer to the API. Deploy the API.
  • BCreate a WebSocket API and the /auth route. Create and configure an AWS Lambda authorizer. Attach the Lambda authorizer to the API. Deploy the API.
  • CCreate an HTTP API and the /auth route. Create and configure an AWS Lambda authorizer. Attach the Lambda authorizer to the /auth route. Deploy the API.
  • DCreate an HTTP API and the /auth route. Configure the JWT authorizer. Attach the JWT authorizer to the /auth route. Deploy the API. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Create an HTTP API and the /auth route. Configure the JWT authorizer. Attach the JWT authorizer to the /auth route. Deploy the API.

Explanation

AWS Config tracks resource configuration changes and evaluates compliance.

Topic 1 Β· Question 502

A company is creating a new application that gives users the ability to upload and share short video files. The average size of the video files is 10 MB. After a user uploads a file, a message needs to be placed into an Amazon Simple Queue Service (Amazon SQS) queue so the file can be processed. The files need to be accessible for processing within 5 minutes. Which solution will meet these requirements MOST cost-effectively?

  • AWrite the files to Amazon S3 Glacier Deep Archive. Add the S3 location of the files to the SQS queue.
  • BWrite the files to Amazon S3 Standard. Add the S3 location of the files to the SQS queue. (correct answer)
  • CWrite the files to an Amazon Elastic Block Store (Amazon EBS) General Purpose SSD volume. Add the EBS location of the files to the SQS queue.
  • DWrite messages that contain the contents of the uploaded files to the SQS queue.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Write the files to Amazon S3 Standard. Add the S3 location of the files to the SQS queue.

Explanation

Amazon S3 provides durable, scalable object storage that is fully managed. Amazon SQS is a fully managed message queue that decouples components and absorbs traffic spikes. This option delivers the requirement at the lowest cost.

Topic 1 Β· Question 503

A developer is updating the code for an AWS Lambda function to add new capabilities. The Lambda function has version aliases for production and development environments that run separate versions of the function. The developer needs to configure a staging environment for the Lambda function to handle invocations to both the development version and the production version. Which solution will meet these requirements?

  • ACreate a weighted alias that references the production version of the function and the updated version of the function. (correct answer)
  • BAdd a Network Load Balancer. Add the production version of the function and updated version of the function as targets.
  • CUse AWS CodeDeploy to create a linear traffic shifting deployment
  • DCreate a tag for the Lambda function that contains the production version and updated version of the code.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Create a weighted alias that references the production version of the function and the updated version of the function.

Topic 1 Β· Question 504

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: 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?

Exhibit 1 for question 504
  • AIncrease the reserved concurrency of the Lambda function.
  • BIncrease the size of the RDS database to facilitate an increased number of database connections each hour.
  • CMove the database connection and close statement out of the handler. Place the connection in the global space. (correct answer)
  • DReplace Amazon RDS with Amazon DynamoDB to implement control over the number of writes per second.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Move the database connection and close statement out of the handler. Place the connection in the global space.

Topic 1 Β· Question 505

A developer is troubleshooting the permissions of an application that needs to make changes to an Amazon RDS database. The developer has access to the IAM role that the application is using. Which command structure should the developer use to test the role permissions?

  • Aaws sts assume-role (correct answer)
  • Baws iam attach-role-policy
  • Caws ssm resume-session
  • Daws rds add-role-to-db-cluster
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: aws sts assume-role.

Topic 1 Β· Question 506

A gaming company has deployed a web portal on AWS Elastic Beanstalk. The company sometimes needs to deploy new versions three or four times in a day. The company needs to deploy new features for all users as quickly as possible. The solution must minimize performance impact and must maximize availability. What solution will meet these requirements?

  • AUse a rolling deployment policy to deploy to Amazon EC2 instances.
  • BUse an immutable deployment policy to deploy to Amazon EC2 instances. (correct answer)
  • CUse an all-at-once deployment policy to deploy to Amazon EC2 instances.
  • DUse a-canary deployment strategy to deploy changes to Amazon EC2 instances.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Use an immutable deployment policy to deploy to Amazon EC2 instances.

Explanation

Amazon EC2 provides resizable virtual servers when you need full control of the operating system.

Topic 1 Β· Question 507

An AWS Lambda function generates a 3 MB JSON file and then uploads it to an Amazon S3 bucket daily. The file contains sensitive information, so the developer must ensure that it is encrypted before uploading to the bucket. Which of the following modifications should the developer make to ensure that the data is encrypted before uploading it to the bucket?

Exhibit 1 for question 507
  • AUse the default AWS Key Management Service (AWS KMS) key for Amazon S3 in the Lambda function code.
  • BUse the S3 managed key and call the GenerateDataKey API to encrypt the file.
  • CUse the GenerateDataKey API, then use that data key to encrypt the file in the Lambda function code. (correct answer)
  • DUse an AWS Key Management Service (AWS KMS) customer managed key for Amazon S3 in the Lambda function code.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Use the GenerateDataKey API, then use that data key to encrypt the file in the Lambda function code.

Explanation

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

Topic 1 Β· Question 508

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?

  • AConfigure a Lambda version that has a specific weight value for the updated Lambda function.
  • BCreate an alias for the Lambda function. Configure a specific weight value for the updated version. (correct answer)
  • CCreate an Application Load Balancer. Specify weighted target groups for the original Lambda function and the updated Lambda function.
  • DCreate a Network Load Balancer. Specify weighted target groups for the original Lambda function and the updated Lambda function.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Create an alias for the Lambda function. Configure a specific weight value for the updated version.

Explanation

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

Topic 1 Β· Question 509

An Amazon 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 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 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. AWS Config tracks resource configuration changes and evaluates compliance.

Topic 1 Β· Question 510

A developer is building a three-tier web application that should be able to handle a minimum of 5000 requests per minute. Requirements state that the web tier should be completely stateless while the application maintains session state for the users. How can session data be externalized, keeping latency at the LOWEST possible value?

  • ACreate an Amazon RDS instance, then implement session handling at the application level to leverage a database inside the RDS database instance for session data storage.
  • BImplement a shared file system solution across the underlying Amazon EC2 instances, then implement session handling at the application level to leverage the shared file system for session data storage.
  • CCreate an Amazon ElastiCache (Memcached) cluster, then implement session handling at the application level to leverage the cluster for session data storage. (correct answer)
  • DCreate an Amazon DynamoDB table, then implement session handling at the application level to leverage the table for session data storage.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Create an Amazon ElastiCache (Memcached) cluster, then implement session handling at the application level to leverage the cluster for session data storage.

Explanation

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

Topic 1 Β· Question 511

A developer has deployed an AWS Lambda function that is subscribed to an Amazon Simple Notification Service (Amazon SNS) topic. The developer must implement a solution to add a record of each Lambda function invocation to an Amazon Simple Queue Service (Amazon SQS) queue. Which solution will meet this requirement?

  • AConfigure the SQS queue as a dead-letter queue for the Lambda function.
  • BCreate code that uses the AWS SDK to call the SQS SendMessage operation to add the invocation details to the SQS queue. Add the code to the end of the Lambda function. (correct answer)
  • CAdd two asynchronous invocation destinations to the Lambda function: one destination for successful invocations and one destination for failed invocations. Configure the SQS queue as the destination for each type. Create an Amazon CloudWatch alarm based on the DestinationDeliveryFailures metric to catch any message that cannot be delivered.
  • DAdd a single asynchronous invocation destination to the Lambda function to capture successful invocations. Configure the SQS queue as the destination. Create an Amazon CloudWatch alarm based on the DestinationDeliveryFailures metric to catch any message that cannot be delivered.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Create code that uses the AWS SDK to call the SQS SendMessage operation to add the invocation details to the SQS queue. Add the code to the end of the Lambda function.

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 512

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?

  • AUse Amazon CloudWatch Logs Insights to generate custom metrics from the logs by using CloudWatch embedded metric format (EMF).
  • BUse Amazon CloudWatch RUM to generate custom metrics from the logs by using CloudWatch embedded metric format (EMF).
  • CUse Amazon CloudWatch Logs Insights to generate custom metrics from the logs by using JSON format.
  • DUse the CloudWatch embedded metric format (EMF) for the structure of the log statements to generate custom CloudWatch metrics. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Use the CloudWatch embedded metric format (EMF) for the structure of the log statements to generate custom CloudWatch metrics.

Explanation

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

Topic 1 Β· Question 513

A developer needs to configure an AWS Lambda function to make HTTP POST requests to an internal application. The application is in the same AWS account that hosts the function. The internal application runs on Amazon EC2 instances in a private subnet within a VPC. Which solution will meet these requirements?

  • AConfigure a VPC endpoint to connect to the private subnet. Attach the endpoint to the Lambda function.
  • BAttach the Lambda function to the VPC and to the private subnet. (correct answer)
  • CConfigure a VPN connection between the Lambda function and the private subnet. Attach the VPN to the Lambda function.
  • DConfigure the VPC route table to include the Lambda function’s IP address.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Attach the Lambda function to the VPC and to the private subnet.

Explanation

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

Topic 1 Β· Question 514

Two containerized microservices are hosted on Amazon EC2 ECS. The first microservice reads an Amazon RDS Aurora database instance, and the second microservice reads an Amazon DynamoDB table. How can each microservice be granted the minimum privileges?

  • ASet ECS_ENABLE_TASK_IAM_ROLE to false on EC2 instance boot in ECS agent configuration file. Run the first microservice with an IAM role for ECS tasks with read-only access for the Aurora database. Run the second microservice with an IAM role for ECS tasks with read-only access to DynamoDB.
  • BSet ECS_ENABLE_TASK_IAM ROLE to false on EC2 instance boot in the ECS agent configuration file. Grant the instance profile role read-only access to the Aurora database and DynamoDB.
  • CSet ECS_ENABLE_TASK_IAM ROLE to true on EC2 instance boot in the ECS agent configuration file. Run the first microservice with an IAM role for ECS tasks with read-only access for the Aurora database. Run the second microservice with an IAM role for ECS tasks with read-only access to DynamoDB. (correct answer)
  • DSet ECS_ENABLE_TASK_IAM_ROLE to true on EC2 instance boot in the ECS agent configuration file. Grant the instance profile role read-only access to the Aurora database and DynamoDB.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Set ECS_ENABLE_TASK_IAM ROLE to true on EC2 instance boot in the ECS agent configuration file. Run the first microservice with an IAM role for ECS tasks with read-only access for the Aurora database. Run the second mi...

Explanation

Amazon EC2 provides resizable virtual servers when you need full control of the operating system. Amazon ECS orchestrates containers and integrates natively with AWS networking and IAM. Amazon Aurora is a high-performance managed relational database with built-in replication and failover.

Topic 1 Β· Question 515

A developer is writing a mobile application that allows users to view images from an S3 bucket. The users must be able to log in with their Amazon login, as well as supported social media accounts. How can the developer provide this authentication functionality?

  • AUse Amazon Cognito with web identity federation. (correct answer)
  • BUse Amazon Cognito with SAML-based identity federation.
  • CUse IAM access keys and secret keys in the application code to allow Get* on the S3 bucket.
  • DUse AWS STS AssumeRole in the application code and assume a role with Get* permissions on the S3 bucket.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Use Amazon Cognito with web identity federation.

Explanation

Amazon Cognito manages user sign-up, sign-in and federated identity for applications.

Topic 1 Β· Question 516

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?

  • AInstall certificates on the EC2 instances.
  • BCreate a private VPC endpoint.
  • CConfigure the S3 bucket with server-side encryption with AWS KMS managed encryption keys (SSE-KMS).
  • DCreate an S3 bucket policy that denies traffic when the value for the aws:SecureTransport condition key is false. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Create an S3 bucket policy that denies traffic when the value for the aws:SecureTransport condition key is false.

Explanation

Amazon S3 provides durable, scalable object storage that is fully managed.

Topic 1 Β· Question 517

A company is hosting an Amazon AP! Gateway REST API that calls a single AWS Lambda function. The function is infrequently invoked by multiple clients at the same time. The code performance is optimal, but the company wants to optimize the startup time of the function What can a developer do to optimize the initialization of the function?

  • AEnable API Gateway caching for the REST API.
  • BConfigure provisioned concurrency for the Lambda function. (correct answer)
  • CUse Lambda proxy integration for the REST API.
  • DConfigure AWS Global Accelerator for the Lambda function.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Configure provisioned concurrency for the Lambda function.

Explanation

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

Topic 1 Β· Question 518

A developer is building a three-tier application with an Application Load Balancer (ALB), Amazon EC2 instances, and Amazon RDS. There is an alias record in Amazon Route 53 that points to the ALB. When the developer tries to access the ALB from a laptop, the request times out. Which logs should the developer investigate to verify that the request is reaching the AWS network?

  • AVPC Flow Logs (correct answer)
  • BAmazon Route 53 logs
  • CAWS Systems Manager Agent logs
  • DAmazon CloudWatch agent logs
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: VPC Flow Logs.

Topic 1 Β· Question 519

A developer has an application that uses AWS Security Token Service (AWS STS). The application calls the STS AssumeRole API operation to provide trusted users with temporary security credentials. The application calls AWS STS at the service's default endpoint: https://sts.amazonaws.com. The application is deployed in an Asia Pacific AWS Region. The application is experiencing errors that are related to intermittent latency when the application calls AWS STS. What should the developer do to resolve this issue?

  • AUpdate the application to use the GetSessionToken API operation.
  • BUpdate the application to use the AssumeRoleWithSAML API operation.
  • CUpdate the application to use a Regional STS endpoint that is closer to the application deployment. (correct answer)
  • DUpdate the application to use the AssumeRoleWithWebldentity API operation. Move the STS endpoint to a global endpoint.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Update the application to use a Regional STS endpoint that is closer to the application deployment.

Topic 1 Β· Question 520

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?

  • AIncrease the virtual CPUs (vCPUs) for the Lambda function to use 10 vCPUs.
  • BChange Lambda function instance type to use m6a.4xlarge.
  • CConfigure the Lambda function to increase the amount of memory. (correct answer)
  • DConfigure burstable performance for the Lambda function.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Configure the Lambda function to increase the amount of memory.

Explanation

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

Showing questions 501–520 of 557 Β· Page 26 of 28