πŸ”

DVA-C02 β€” questions

Page 6 of 28 Β· 557 total questions.

Topic 1 Β· Question 101

A developer is creating an application. New users of the application must be able to create an account and register by using their own social media accounts. Which AWS service or resource should the developer use to meet these requirements?

  • AIAM role
  • BAmazon Cognito identity pools
  • CAmazon Cognito user pools (correct answer)
  • DAWS Directory Service
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Amazon Cognito user pools

Explanation

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

Topic 1 Β· Question 102

A social media application uses the AWS SDK for JavaScript on the frontend to get user credentials from AWS Security Token Service (AWS STS). The application stores its assets in an Amazon S3 bucket. The application serves its content by using an Amazon CloudFront distribution with the origin set to the S3 bucket. The credentials for the role that the application assumes to make the SDK calls are stored in plaintext in a JSON file within the application code. The developer needs to implement a solution that will allow the application to get user credentials without having any credentials hardcoded in the application code. Which solution will meet these requirements?

  • AAdd a Lambda@Edge function to the distribution. Invoke the function on viewer request. Add permissions to the function's execution role to allow the function to access AWS STS. Move all SDK calls from the frontend into the function. (correct answer)
  • BAdd a CloudFront function to the distribution. Invoke the function on viewer request. Add permissions to the function's execution role to allow the function to access AWS STS. Move all SDK calls from the frontend into the function.
  • CAdd a Lambda@Edge function to the distribution. Invoke the function on viewer request. Move the credentials from the JSON file into the function. Move all SDK calls from the frontend into the function.
  • DAdd a CloudFront function to the distribution. Invoke the function on viewer request. Move the credentials from the JSON file into the function. Move all SDK calls from the frontend into the function.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Add a Lambda@Edge function to the distribution. Invoke the function on viewer request. Add permissions to the function's execution role to allow the function to access AWS STS. Move all SDK calls from the frontend int...

Explanation

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

Topic 1 Β· Question 103

An ecommerce website uses an AWS Lambda function and an Amazon RDS for MySQL database for an order fulfillment service. The service needs to return order confirmation immediately. During a marketing campaign that caused an increase in the number of orders, the website's operations team noticed errors for β€œtoo many connections” from Amazon RDS. However, the RDS DB cluster metrics are healthy. CPU and memory capacity are still available. What should a developer do to resolve the errors?

  • AInitialize the database connection outside the handler function. Increase the max_user_connections value on the parameter group of the DB cluster. Restart the DB cluster.
  • BInitialize the database connection outside the handler function. Use RDS Proxy instead of connecting directly to the DB cluster. (correct answer)
  • CUse Amazon Simple Queue Service (Amazon SQS) FIFO queues to queue the orders. Ingest the orders into the database. Set the Lambda function's concurrency to a value that equals the number of available database connections.
  • DUse Amazon Simple Queue Service (Amazon SQS) FIFO queues to queue the orders. Ingest the orders into the database. Set the Lambda function's concurrency to a value that is less than the number of available database connections.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Initialize the database connection outside the handler function. Use RDS Proxy instead of connecting directly to the DB cluster.

Explanation

Amazon RDS Proxy pools and shares database connections to improve scalability and resilience. Amazon RDS is a managed relational database that handles patching, backups and failover.

Topic 1 Β· Question 104

A company stores its data in data tables in a series of Amazon S3 buckets. The company received an alert that customer credit card information might have been exposed in a data table on one of the company's public applications. A developer needs to identify all potential exposures within the application environment. Which solution will meet these requirements?

  • AUse Amazon Athena to run a job on the S3 buckets that contain the affected data. Filter the findings by using the SensitiveData:S3Object/Personal finding type.
  • BUse Amazon Macie to run a job on the S3 buckets that contain the affected data. Filter the findings by using the SensitiveData:S3Object/Financial finding type. (correct answer)
  • CUse Amazon Macie to run a job on the S3 buckets that contain the affected data. Filter the findings by using the SensitiveData:S3Object/Personal finding type.
  • DUse Amazon Athena to run a job on the S3 buckets that contain the affected data. Filter the findings by using the SensitiveData:S3Object/Financial finding type.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Use Amazon Macie to run a job on the S3 buckets that contain the affected data. Filter the findings by using the SensitiveData:S3Object/Financial finding type.

Explanation

Amazon S3 provides durable, scalable object storage that is fully managed. Amazon Macie discovers and protects sensitive data such as PII in S3.

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

A software company is launching a multimedia application. The application will allow guest users to access sample content before the users decide if they want to create an account to gain full access. The company wants to implement an authentication process that can identify users who have already created an account. The company also needs to keep track of the number of guest users who eventually create an account. Which combination of steps will meet these requirements? (Choose two.)

  • ACreate an Amazon Cognito user pool. Configure the user pool to allow unauthenticated users. Exchange user tokens for temporary credentials that allow authenticated users to assume a role.
  • BCreate an Amazon Cognito identity pool. Configure the identity pool to allow unauthenticated users. Exchange unique identity for temporary credentials that allow all users to assume a role. (correct answer)
  • CCreate an Amazon CloudFront distribution. Configure the distribution to allow unauthenticated users. Exchange user tokens for temporary credentials that allow all users to assume a role.
  • DCreate a role for authenticated users that allows access to all content. Create a role for unauthenticated users that allows access to only the sample content. (correct answer)
  • EAllow all users to access the sample content by default. Create a role for authenticated users that allows access to the other content.
Reveal answer & explanation
Correct answer: B, D

The correct answer is B, D. Option B: Create an Amazon Cognito identity pool. Configure the identity pool to allow unauthenticated users. Exchange unique identity for temporary credentials that allow all users to assume a role. Option D: Create a role for authenticated users that allows access to all content. Create a role for unauthenticated users that allows access to only the sample content.

Explanation

Amazon Cognito manages user sign-up, sign-in and federated identity for applications. AWS Config tracks resource configuration changes and evaluates compliance.

Topic 1 Β· Question 106

A company is updating an application to move the backend of the application from Amazon EC2 instances to a serverless model. The application uses an Amazon RDS for MySQL DB instance and runs in a single VPC on AWS. The application and the DB instance are deployed in a private subnet in the VPC. The company needs to connect AWS Lambda functions to the DB instance. Which solution will meet these requirements?

  • ACreate Lambda functions inside the VPC with the AWSLambdaBasicExecutionRole policy attached to the Lambda execution role. Modify the RDS security group to allow inbound access from the Lambda security group.
  • BCreate Lambda functions inside the VPC with the AWSLambdaVPCAccessExecutionRole policy attached to the Lambda execution role. Modify the RDS security group to allow inbound access from the Lambda security group. (correct answer)
  • CCreate Lambda functions with the AWSLambdaBasicExecutionRole policy attached to the Lambda execution role. Create an interface VPC endpoint for the Lambda functions. Configure the interface endpoint policy to allow the lambda:InvokeFunclion action for each Lambda function's Amazon Resource Name (ARN).
  • DCreate Lambda functions with the AWSLambdaVPCAccessExecutionRole policy attached to the Lambda execution role. Create an interface VPC endpoint for the Lambda functions. Configure the interface endpoint policy to allow the lambda:InvokeFunction action for each Lambda function's Amazon Resource Name (ARN).
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Create Lambda functions inside the VPC with the AWSLambdaVPCAccessExecutionRole policy attached to the Lambda execution role. Modify the RDS security group to allow inbound access from the Lambda security group.

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.

Topic 1 Β· Question 107

A company has a web application that runs on Amazon EC2 instances with a custom Amazon Machine Image (AMI). The company uses AWS CloudFormation to provision the application. The application runs in the us-east-1 Region, and the company needs to deploy the application to the us-west-1 Region. An attempt to create the AWS CloudFormation stack in us-west-1 fails. An error message states that the AMI ID does not exist. A developer must resolve this error with a solution that uses the least amount of operational overhead. Which solution meets these requirements?

  • AChange the AWS CloudFormation templates for us-east-1 and us-west-1 to use an AWS AMI. Relaunch the stack for both Regions.
  • BCopy the custom AMI from us-east-1 to us-west-1. Update the AWS CloudFormation template for us-west-1 to refer to AMI ID for the copied AMI. Relaunch the stack. (correct answer)
  • CBuild the custom AMI in us-west-1. Create a new AWS CloudFormation template to launch the stack in us-west-1 with the new AMI ID.
  • DManually deploy the application outside AWS CloudFormation in us-west-1.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Copy the custom AMI from us-east-1 to us-west-1. Update the AWS CloudFormation template for us-west-1 to refer to AMI ID for the copied AMI. Relaunch the stack.

Explanation

AWS CloudFormation provisions infrastructure as code repeatably.

Topic 1 Β· Question 108

A developer is updating several AWS Lambda functions and notices that all the Lambda functions share the same custom libraries. The developer wants to centralize all the libraries, update the libraries in a convenient way, and keep the libraries versioned. Which solution will meet these requirements with the LEAST development effort?

  • ACreate an AWS CodeArtifact repository that contains all the custom libraries.
  • BCreate a custom container image for the Lambda functions to save all the custom libraries.
  • CCreate a Lambda layer that contains all the custom libraries. (correct answer)
  • DCreate an Amazon Elastic File System (Amazon EFS) file system to store all the custom libraries.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Create a Lambda layer that contains all the custom libraries.

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 109

A developer wants to use AWS Elastic Beanstalk to test a new version of an application in a test environment. Which deployment method offers the FASTEST deployment?

  • AImmutable
  • BRolling
  • CRolling with additional batch
  • DAll at once (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: All at once.

Topic 1 Β· Question 110

A company is providing read access to objects in an Amazon S3 bucket for different customers. The company uses IAM permissions to restrict access to the S3 bucket. The customers can access only their own files. Due to a regulation requirement, the company needs to enforce encryption in transit for interactions with Amazon S3. Which solution will meet these requirements?

  • AAdd a bucket policy to the S3 bucket to deny S3 actions when the aws:SecureTransport condition is equal to false. (correct answer)
  • BAdd a bucket policy to the S3 bucket to deny S3 actions when the s3:x-amz-acl condition is equal to public-read.
  • CAdd an IAM policy to the IAM users to enforce the usage of the AWS SDK.
  • DAdd an IAM policy to the IAM users that allows S3 actions when the s3:x-amz-acl condition is equal to bucket-owner-read.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Add a bucket policy to the S3 bucket to deny S3 actions when the aws:SecureTransport condition is equal to false.

Explanation

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

Topic 1 Β· Question 111

A company has an image storage web application that runs on AWS. The company hosts the application on Amazon EC2 instances in an Auto Scaling group. The Auto Scaling group acts as the target group for an Application Load Balancer (ALB) and uses an Amazon S3 bucket to store the images for sale. The company wants to develop a feature to test system requests. The feature will direct requests to a separate target group that hosts a new beta version of the application. Which solution will meet this requirement with the LEAST effort?

  • ACreate a new Auto Scaling group and target group for the beta version of the application. Update the ALB routing rule with a condition that looks for a cookie named version that has a value of beta. Update the test system code to use this cookie to test the beta version of the application. (correct answer)
  • BCreate a new ALB, Auto Scaling group, and target group for the beta version of the application. Configure an alternate Amazon Route 53 record for the new ALB endpoint. Use the alternate Route 53 endpoint in the test system requests to test the beta version of the application.
  • CCreate a new ALB, Auto Scaling group, and target group for the beta version of the application. Use Amazon CloudFront with Lambda@Edge to determine which specific request will go to the new ALB. Use the CloudFront endpoint to send the test system requests to test the beta version of the application.
  • DCreate a new Auto Scaling group and target group for the beta version of the application. Update the ALB routing rule with a condition that looks for a cookie named version that has a value of beta. Use Amazon CloudFront with Lambda@Edge to update the test system requests to add the required cookie when the requests go to the ALB.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Create a new Auto Scaling group and target group for the beta version of the application. Update the ALB routing rule with a condition that looks for a cookie named version that has a value of beta. Update the test sy...

Explanation

Auto Scaling adjusts capacity automatically to match demand, improving availability and cost efficiency.

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

A team is developing an application that is deployed on Amazon EC2 instances. During testing, the team receives an error. The EC2 instances are unable to access an Amazon S3 bucket. Which steps should the team take to troubleshoot this issue? (Choose two.)

  • ACheck whether the policy that is assigned to the IAM role that is attached to the EC2 instances grants access to Amazon S3. (correct answer)
  • BCheck the S3 bucket policy to validate the access permissions for the S3 bucket. (correct answer)
  • CCheck whether the policy that is assigned to the IAM user that is attached to the EC2 instances grants access to Amazon S3.
  • DCheck the S3 Lifecycle policy to validate the permissions that are assigned to the S3 bucket.
  • ECheck the security groups that are assigned to the EC2 instances. Make sure that a rule is not blocking the access to Amazon S3.
Reveal answer & explanation
Correct answer: A, B

The correct answer is A, B. Option A: Check whether the policy that is assigned to the IAM role that is attached to the EC2 instances grants access to Amazon S3. Option B: Check the S3 bucket policy to validate the access permissions for the S3 bucket.

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 113

A developer is working on an ecommerce website. The developer wants to review server logs without logging in to each of the application servers individually. The website runs on multiple Amazon EC2 instances, is written in Python, and needs to be highly available. How can the developer update the application to meet these requirements with MINIMUM changes?

  • ARewrite the application to be cloud native and to run on AWS Lambda, where the logs can be reviewed in Amazon CloudWatch.
  • BSet up centralized logging by using Amazon OpenSearch Service, Logstash, and OpenSearch Dashboards.
  • CScale down the application to one larger EC2 instance where only one instance is recording logs.
  • DInstall the unified Amazon CloudWatch agent on the EC2 instances. Configure the agent to push the application logs to CloudWatch. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Install the unified Amazon CloudWatch agent on the EC2 instances. Configure the agent to push the application logs to CloudWatch.

Explanation

Amazon EC2 provides resizable virtual servers when you need full control of the operating system. Amazon CloudWatch collects metrics, logs and alarms to monitor and react to operational health. 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 114 Β· Select all that apply

A company is creating an application that processes .csv files from Amazon S3. A developer has created an S3 bucket. The developer has also created an AWS Lambda function to process the .csv files from the S3 bucket. Which combination of steps will invoke the Lambda function when a .csv file is uploaded to Amazon S3? (Choose two.)

  • ACreate an Amazon EventBridge rule. Configure the rule with a pattern to match the S3 object created event. (correct answer)
  • BSchedule an Amazon EventBridge rule to run a new Lambda function to scan the S3 bucket.
  • CAdd a trigger to the existing Lambda function. Set the trigger type to EventBridge. Select the Amazon EventBridge rule. (correct answer)
  • DCreate a new Lambda function to scan the S3 bucket for recently added S3 objects.
  • EAdd S3 Lifecycle rules to invoke the existing Lambda function.
Reveal answer & explanation
Correct answer: A, C

The correct answer is A, C. Option A: Create an Amazon EventBridge rule. Configure the rule with a pattern to match the S3 object created event. Option C: Add a trigger to the existing Lambda function. Set the trigger type to EventBridge. Select the Amazon EventBridge rule.

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. Amazon EventBridge routes events between services with rules, enabling event-driven, decoupled architectures.

Topic 1 Β· Question 115

A developer needs to build an AWS CloudFormation template that self-populates the AWS Region variable that deploys the CloudFormation template. What is the MOST operationally efficient way to determine the Region in which the template is being deployed?

  • AUse the AWS::Region pseudo parameter. (correct answer)
  • BRequire the Region as a CloudFormation parameter.
  • CFind the Region from the AWS::StackId pseudo parameter by using the Fn::Split intrinsic function.
  • DDynamically import the Region by referencing the relevant parameter in AWS Systems Manager Parameter Store.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Use the AWS::Region pseudo parameter.

Topic 1 Β· Question 116

A company has hundreds of AWS Lambda functions that the company's QA team needs to test by using the Lambda function URLs. A developer needs to configure the authentication of the Lambda functions to allow access so that the QA IAM group can invoke the Lambda functions by using the public URLs. Which solution will meet these requirements?

  • ACreate a CLI script that loops on the Lambda functions to add a Lambda function URL with the AWS_IAM auth type. Run another script to create an IAM identity-based policy that allows the lambda:InvokeFunctionUrl action to all the Lambda function Amazon Resource Names (ARNs). Attach the policy to the QA IAM group. (correct answer)
  • BCreate a CLI script that loops on the Lambda functions to add a Lambda function URL with the NONE auth type. Run another script to create an IAM resource-based policy that allows the lambda:InvokeFunctionUrl action to all the Lambda function Amazon Resource Names (ARNs). Attach the policy to the QA IAM group.
  • CCreate a CLI script that loops on the Lambda functions to add a Lambda function URL with the AWS_IAM auth type. Run another script to loop on the Lambda functions to create an IAM identity-based policy that allows the lambda:InvokeFunctionUrl action from the QA IAM group's Amazon Resource Name (ARN).
  • DCreate a CLI script that loops on the Lambda functions to add a Lambda function URL with the NONE auth type. Run another script to loop on the Lambda functions to create an IAM resource-based policy that allows the lambda:InvokeFunctionUrl action from the QA IAM group's Amazon Resource Name (ARN).
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Create a CLI script that loops on the Lambda functions to add a Lambda function URL with the AWS_IAM auth type. Run another script to create an IAM identity-based policy that allows the lambda:InvokeFunctionUrl action...

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. AWS IAM controls authenticated and authorized access to AWS resources with fine-grained policies.

Topic 1 Β· Question 117

A developer maintains a critical business application that uses Amazon DynamoDB as the primary data store. The DynamoDB table contains millions of documents and receives 30-60 requests each minute. The developer needs to perform processing in near-real time on the documents when they are added or updated in the DynamoDB table. How can the developer implement this feature with the LEAST amount of change to the existing application code?

  • ASet up a cron job on an Amazon EC2 instance. Run a script every hour to query the table for changes and process the documents.
  • BEnable a DynamoDB stream on the table. Invoke an AWS Lambda function to process the documents. (correct answer)
  • CUpdate the application to send a PutEvents request to Amazon EventBridge. Create an EventBridge rule to invoke an AWS Lambda function to process the documents.
  • DUpdate the application to synchronously process the documents directly after the DynamoDB write.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Enable a DynamoDB stream on the table. Invoke an AWS Lambda function to process the documents.

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. This option meets the real-time / low-latency performance requirement.

Topic 1 Β· Question 118

A developer is writing an application for a company. The application will be deployed on Amazon EC2 and will use an Amazon RDS for Microsoft SQL Server database. The company's security team requires that database credentials are rotated at least weekly. How should the developer configure the database credentials for this application?

  • ACreate a database user. Store the user name and password in an AWS Systems Manager Parameter Store secure string parameter. Enable rotation of the AWS Key Management Service (AWS KMS) key that is used to encrypt the parameter.
  • BEnable IAM authentication for the database. Create a database user for use with IAM authentication. Enable password rotation.
  • CCreate a database user. Store the user name and password in an AWS Secrets Manager secret that has daily rotation enabled. (correct answer)
  • DUse the EC2 user data to create a database user. Provide the user name and password in environment variables to the application.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Create a database user. Store the user name and password in an AWS Secrets Manager secret that has daily rotation enabled.

Explanation

AWS Secrets Manager stores and automatically rotates secrets such as database credentials.

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

A real-time messaging application uses Amazon API Gateway WebSocket APIs with backend HTTP service. A developer needs to build a feature in the application to identify a client that keeps connecting to and disconnecting from the WebSocket connection. The developer also needs the ability to remove the client. Which combination of changes should the developer make to the application to meet these requirements? (Choose two.)

  • ASwitch to HTTP APIs in the backend service.
  • BSwitch to REST APIs in the backend service.
  • CUse the callback URL to disconnect the client from the backend service.
  • DAdd code to track the client status in Amazon ElastiCache in the backend service. (correct answer)
  • EImplement $connect and $disconnect routes in the backend service. (correct answer)
Reveal answer & explanation
Correct answer: D, E

The correct answer is D, E. Option D: Add code to track the client status in Amazon ElastiCache in the backend service. Option E: Implement $connect and $disconnect routes in the backend service.

Explanation

Amazon ElastiCache provides in-memory caching (Redis/Memcached) to reduce latency and offload the database. This option meets the real-time / low-latency performance requirement.

Topic 1 Β· Question 120

A developer has written code for an application and wants to share it with other developers on the team to receive feedback. The shared application code needs to be stored long-term with multiple versions and batch change tracking. Which AWS service should the developer use?

  • AAWS CodeBuild
  • BAmazon S3
  • CAWS CodeCommit (correct answer)
  • DAWS Cloud9
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: AWS CodeCommit

Explanation

AWS CodeCommit hosts private Git repositories.

Showing questions 101–120 of 557 Β· Page 6 of 28