πŸ”

DVA-C02 β€” questions

Page 22 of 28 Β· 557 total questions.

Topic 1 Β· Question 421

A developer is setting up the deployment of application stacks to new test environments by using the AWS Cloud Development Kit (AWS CDK). The application contains the code for several AWS Lambda functions that will be deployed as assets. Each Lambda function is defined by using the AWS CDK Lambda construct library. The developer has already successfully deployed the application stacks to the alpha environment in the first account by using the AWS CDK CLI's cdk deploy command. The developer is preparing to deploy to the beta environment in a second account for the first time. The developer makes no significant changes to the CDK code between deployments, but the initial deployment in the second account is unsuccessful and returns a NoSuchBucket error. Which command should the developer run before redeployment to resolve this error?

  • Acdk synth
  • Bcdk bootstrap (correct answer)
  • Ccdk init
  • Dcdk destroy
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: cdk bootstrap

Explanation

The AWS CDK defines cloud infrastructure as code using familiar programming languages.

Topic 1 Β· Question 422

A developer is automating a new application deployment with AWS Serverless Application Model (AWS SAM). The new application has one AWS Lambda function and one Amazon S3 bucket. The Lambda function must access the S3 bucket to only read objects. How should the developer configure AWS SAM to grant the necessary read privilege to the S3 bucket?

  • AReference a second Lambda authorizer function.
  • BAdd a custom S3 bucket policy to the Lambda function.
  • CCreate an Amazon Simple Queue Service (SQS) topic for only S3 object reads. Reference the topic in the template.
  • DAdd the S3ReadPolicy template to the Lambda function's execution role. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Add the S3ReadPolicy template to the Lambda function's execution role.

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.

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

A development team wants to immediately build and deploy an application whenever there is a change to the source code. Which approaches could be used to trigger the deployment? (Choose two.)

  • AStore the source code in an Amazon S3 bucket. Configure AWS CodePipeline to start whenever a file in the bucket changes. (correct answer)
  • BStore the source code in an encrypted Amazon EBS volume. Configure AWS CodePipeline to start whenever a file in the volume changes.
  • CStore the source code in an AWS CodeCommit repository. Configure AWS CodePipeline to start whenever a change is committed to the repository. (correct answer)
  • DStore the source code in an Amazon S3 bucket. Configure AWS CodePipeline to start every 15 minutes.
  • EStore the source code in an Amazon EC2 instance’s ephemeral storage. Configure the instance to start AWS CodePipeline whenever there are changes to the source code.
Reveal answer & explanation
Correct answer: A, C

The correct answer is A, C. Option A: Store the source code in an Amazon S3 bucket. Configure AWS CodePipeline to start whenever a file in the bucket changes. Option C: Store the source code in an AWS CodeCommit repository. Configure AWS CodePipeline to start whenever a change is committed to the repository.

Explanation

Amazon S3 provides durable, scalable object storage that is fully managed. AWS Config tracks resource configuration changes and evaluates compliance. AWS CodePipeline automates continuous delivery pipelines.

Topic 1 Β· Question 424

A developer is building an application integrating an Amazon API Gateway with an AWS Lambda function. When calling the API, the developer receives the following error: Wed Nov 08 01:13:00 UTC 2017 : Method completed with status: 502 What should the developer do to resolve the error?

  • AChange the HTTP endpoint of the API to an HTTPS endpoint.
  • BChange the format of the payload sent to the API Gateway.
  • CChange the format of the Lambda function response to the API call. (correct answer)
  • DChange the authorization header in the API call to access the Lambda function.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Change the format of the Lambda function response to the API call.

Explanation

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

Topic 1 Β· Question 425

A developer is building various microservices for an application that will run on Amazon EC2 instances. The developer needs to monitor the end-to-end view of the requests between the microservices and debug any issues in the various microservices. What should the developer do to accomplish these tasks?

  • AUse Amazon CloudWatch to aggregate the microservices' logs and metrics, and build the monitoring dashboard.
  • BUse AWS CloudTrail to aggregate the microservices' logs and metrics, and build the monitoring dashboard.
  • CUse the AWS X-Ray SDK to add instrumentation in all the microservices, and monitor using the X-Ray service map. (correct answer)
  • DUse AWS Health to monitor the health of all the microservices.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Use the AWS X-Ray SDK to add instrumentation in all the microservices, and monitor using the X-Ray service map.

Explanation

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

Topic 1 Β· Question 426

A developer is building a microservice that uses AWS Lambda to process messages from an Amazon Simple Queue Service (Amazon SQS) standard queue. The Lambda function calls external APIs to enrich the SQS message data before loading the data into an Amazon Redshift data warehouse. The SQS queue must handle a maximum of 1,000 messages per second. During initial testing, the Lambda function repeatedly inserted duplicate data into the Amazon Redshift table. The duplicate data led to a problem with data analysis. All duplicate messages were submitted to the queue within 1 minute of each other. How should the developer resolve this issue?

  • ACreate an SQS FIFO queue. Enable message deduplication on the SQS FIFO queue. (correct answer)
  • BReduce the maximum Lambda concurrency that the SQS queue can invoke.
  • CUse Lambda's temporary storage to keep track of processed message identifiers
  • DConfigure a message group ID for every sent message. Enable message deduplication on the SQS standard queue.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Create an SQS FIFO queue. Enable message deduplication on the SQS FIFO queue.

Explanation

Amazon SQS is a fully managed message queue that decouples components and absorbs traffic spikes.

Topic 1 Β· Question 427

A company has an application that uses an Amazon API Gateway API to invoke an AWS Lambda function. The application is latency sensitive. A developer needs to configure the Lambda function to reduce the cold start time that is associated with default scaling. What should the developer do to meet these requirements?

  • APublish a new version of the Lambda function. Configure provisioned concurrency. Set the provisioned concurrency limit to meet the company requirements. (correct answer)
  • BIncrease the Lambda function's memory to the maximum amount. Increase the Lambda function's reserved concurrency limit.
  • CIncrease the reserved concurrency of the Lambda function to a number that matches the current production load.
  • DUse Service Quotas to request an increase in the Lambda function's concurrency limit for the AWS account where the function is deployed.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Publish a new version of the Lambda function. Configure provisioned concurrency. Set the provisioned concurrency limit to meet the company requirements.

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 428 Β· Select all that apply

A developer is deploying an application on Amazon EC2 instances that run in Account A. The application needs to read data from an existing Amazon Kinesis data stream in Account B. Which actions should the developer take to provide the application with access to the stream? (Choose two.)

  • AUpdate the instance profile role in Account A with stream read permissions.
  • BCreate an IAM role with stream read permissions in Account B. (correct answer)
  • CAdd a trust policy to the instance profile role and IAM role in Account B to allow the instance profile role to assume the IAM role. (correct answer)
  • DAdd a trust policy to the instance profile role and IAM role in Account B to allow reads from the stream.
  • EAdd a resource-based policy in Account B to allow read access from the instance profile role.
Reveal answer & explanation
Correct answer: B, C

The correct answer is B, C. Option B: Create an IAM role with stream read permissions in Account B. Option C: Add a trust policy to the instance profile role and IAM role in Account B to allow the instance profile role to assume the IAM role.

Explanation

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 429

An ecommerce startup is preparing for an annual sales event. As the traffic to the company's application increases, the development team wants to be notified when the Amazon EC2 instance's CPU utilization exceeds 80%. Which solution will meet this requirement?

  • ACreate a custom Amazon CloudWatch alarm that sends a notification to an Amazon SNS topic when the CPU utilization exceeds 80%. (correct answer)
  • BCreate a custom AWS CloudTrail alarm that sends a notification to an Amazon SNS topic when the CPU utilization exceeds 80%.
  • CCreate a cron job on the EC2 instance that invokes the --describe-instance-information command on the host instance every 15 minutes and sends the results to an Amazon SNS topic.
  • DCreate an AWS Lambda function that queries the AWS CloudTrail logs for the CPUUtilization metric every 15 minutes and sends a notification to an Amazon SNS topic when the CPU utilization exceeds 80%.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Create a custom Amazon CloudWatch alarm that sends a notification to an Amazon SNS topic when the CPU utilization exceeds 80%.

Explanation

Amazon SNS is a managed pub/sub service for fan-out notifications to many subscribers. Amazon CloudWatch collects metrics, logs and alarms to monitor and react to operational health.

Topic 1 Β· Question 430

A company has an application that is deployed on AWS Elastic Beanstalk. The application generates user-specific PDFs and stores the PDFs in an Amazon S3 bucket. The application then uses Amazon Simple Email Service (Amazon SES) to send the PDFs by email to subscribers. Users no longer access the PDFs 90 days after the PDFs are generated. The S3 bucket is not versioned and contains many obsolete PDFs. A developer must reduce the number of files in the S3 bucket by removing PDFs that are older than 90 days. Which solution will meet this requirement with the LEAST development effort?

  • AUpdate the application code. In the code, add a rule to scan all the objects in the S3 bucket every day and to delete objects after 90 days.
  • BCreate an AWS Lambda function. Program the Lambda function to scan all the objects in the S3 bucket every day and to delete objects after 90 days.
  • CCreate an S3 Lifecycle rule for the S3 bucket to expire objects after 90 days. (correct answer)
  • DPartition the S3 objects with a // key prefix. Create an AWS Lambda function to remove objects that have prefixes that have reached the expiration date.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Create an S3 Lifecycle rule for the S3 bucket to expire objects after 90 days.

Explanation

S3 Lifecycle policies automatically transition or expire objects to control storage cost. Amazon S3 provides durable, scalable object storage that is fully managed.

Topic 1 Β· Question 431

A developer is troubleshooting an application. The application includes several AWS Lambda functions that invoke an Amazon API Gateway API. The API Gateway's method request is set up to use an Amazon Cognito authorizer for authentication. All the Lambda functions pass the user ID as part of the Authorization header to the API Gateway API. The API Gateway API returns a 403 status code for all GET requests. How should the developer resolve this issue?

  • AModify the client GET request to include a valid API key in the Authorization header.
  • BModify the client GET request to include a valid token in the Authorization header. (correct answer)
  • CUpdate the resource policy for the API Gateway API to allow the execute-api:Invoke action.
  • DModify the client to send an OPTIONS preflight request before the GET request.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Modify the client GET request to include a valid token in the Authorization header.

Topic 1 Β· Question 432

A company processes incoming documents from an Amazon S3 bucket. Users upload documents to an S3 bucket using a web user interface. Upon receiving files in S3, an AWS Lambda function is invoked to process the files, but the Lambda function times out intermittently. If the Lambda function is configured with the default settings, what will happen to the S3 event when there is a timeout exception?

  • ANotification of a failed S3 event is sent as an email through Amazon SNS.
  • BThe S3 event is sent to the default Dead Letter Queue.
  • CThe S3 event is processed until it is successful.
  • DThe S3 event is discarded after the event is retried twice. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: The S3 event is discarded after the event is retried twice.

Explanation

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

Topic 1 Β· Question 433

A developer uses Amazon S3 Event Notifications to invoke AWS Lambda functions. The Lambda functions process images after the images are uploaded to S3 buckets. The developer has set up a development S3 bucket, a production S3 bucket, a development Lambda function, and a production Lambda function in the same AWS account. The developer notices that uploads to the development S3 bucket wrongly invoke the production Lambda function. The developer must prevent development data from affecting the production Lambda function. What should the developer do to meet these requirements?

  • AUpdate the execution role for the production Lambda function. Add a policy that allows the execution role to read from only the production S3 bucket.
  • BUpdate the S3 bucket policy for the production S3 bucket to invoke the production Lambda function. Update the S3 bucket policy for the development S3 bucket to invoke the development Lambda function.
  • CSeparate the development environment and the production environment into their own AWS accounts. Update the execution role for each Lambda function. Add a policy that allows the execution role to read from only the S3 bucket that is in the same account.
  • DSeparate the development environment and the production environment into their own AWS accounts. Add a resource policy to the Lambda functions to allow only S3 bucket events in the same account to invoke the functions. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Separate the development environment and the production environment into their own AWS accounts. Add a resource policy to the Lambda functions to allow only S3 bucket events in the same account to invoke the functions.

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.

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

A developer is writing an application that will run on Amazon EC2 instances in an Auto Scaling group. The developer wants to externalize the session state to support the application. Which AWS services or resources can the developer use to meet these requirements? (Choose two.)

  • AAmazon DynamoDB (correct answer)
  • BAmazon Cognito
  • CAmazon ElastiCache (correct answer)
  • DApplication Load Balancer
  • EAmazon Simple Queue Service (Amazon SQS)
Reveal answer & explanation
Correct answer: A, C

The correct answer is A, C. Option A: Amazon DynamoDB Option C: Amazon ElastiCache

Explanation

Amazon DynamoDB is a fully managed, serverless NoSQL database with single-digit millisecond latency and automatic scaling. Amazon ElastiCache provides in-memory caching (Redis/Memcached) to reduce latency and offload the database.

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

A company has a serverless application that uses an Amazon API Gateway API to invoke an AWS Lambda function. A developer creates a fix for a defect in the Lambda function code. The developer wants to deploy this fix to the production environment. To test the changes, the developer needs to send 10% of the live production traffic to the updated Lambda function version. Which combination of steps will meet these requirements? (Choose two.)

  • APublish a new version of the Lambda function that contains the updated code. (correct answer)
  • BSet up a new stage in API Gateway with a new Lambda function version. Enable weighted routing in API Gateway stages.
  • CCreate an alias for the Lambda function. Configure weighted routing on the alias. Specify a 10% weight for the new Lambda function version. (correct answer)
  • DSet up a routing policy on a Network Load Balancer. Configure 10% of the traffic to go to the new Lambda function version.
  • ESet up a weighted routing policy by using Amazon Route 53. Configure 10% of the traffic to go to the new Lambda function version.
Reveal answer & explanation
Correct answer: A, C

The correct answer is A, C. Option A: Publish a new version of the Lambda function that contains the updated code. Option C: Create an alias for the Lambda function. Configure weighted routing on the alias. Specify a 10% weight for the new Lambda function 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 436

A developer is creating a video search application for a global company. The video files have an average size of 2.5 TB. The video storage system must provide instant access to the video files for the first 90 days. After the first 90 days, the video files can take more than 10 minutes to load. Which solution will meet these requirements MOST cost-effectively?

  • AUpload the video files to the Amazon Elastic File System (Amazon EFS) Standard storage class for the first 90 days. After 90 days, transition the video files to the EFS Standard-Infrequent Access (Standard-IA) storage class.
  • BUpload the video files to Amazon S3. Use the S3 Glacier Deep Archive storage class for the first 90 days. After 90 days, transition the video file to the S3 Glacier Flexible Retrieval storage class.
  • CUse Amazon Elastic Block Store (Amazon EBS) to store the video files for the first 90 days. After 90 days, transition the video files to the Amazon S3 Glacier Deep Archive storage class.
  • DUpload the video files to Amazon S3. Use the S3 Glacier Instant Retrieval storage class for the first 90 days. After 90 days, transition the video files to the S3 Glacier Flexible Retrieval storage class. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Upload the video files to Amazon S3. Use the S3 Glacier Instant Retrieval storage class for the first 90 days. After 90 days, transition the video files to the S3 Glacier Flexible Retrieval storage class.

Explanation

Amazon S3 Glacier offers low-cost archival storage for infrequently accessed data. Amazon S3 provides durable, scalable object storage that is fully managed. This option delivers the requirement at the lowest cost.

Topic 1 Β· Question 437

A company has a virtual reality (VR) game. The game has a serverless backend that consists of Amazon API Gateway, AWS Lambda, and Amazon DynamoDB. Recently, the company noticed a sudden increase of new users globally. The company also noticed delays in the retrieval of user data. Which AWS service or feature can the company use to reduce the database response time to microseconds?

  • AAmazon ElastiCache
  • BDynamoDB Accelerator (DAX) (correct answer)
  • CDynamoDB auto scaling
  • DAmazon CloudFront
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: DynamoDB Accelerator (DAX)

Explanation

Amazon DynamoDB is a fully managed, serverless NoSQL database with single-digit millisecond latency and automatic scaling. DynamoDB Accelerator (DAX) adds an in-memory cache for microsecond DynamoDB reads.

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

A developer is creating a solution to track an account's Amazon S3 buckets over time. The developer has created an AWS Lambda function that will run on a schedule. The function will list the account's S3 buckets and will store the list in an Amazon DynamoDB table. The developer receives a permissions error when the developer runs the function with the AWSLambdaBasicExecutionRole AWS managed policy. Which combination of permissions should the developer use to resolve this error? (Choose two.)

  • ACross-account IAM role
  • BPermission for the Lambda function to list buckets in Amazon S3 (correct answer)
  • CPermission for the Lambda function to write in DynamoDB (correct answer)
  • DPermission for Amazon S3 to invoke the Lambda function
  • EPermission for DynamoDB to invoke the Lambda function
Reveal answer & explanation
Correct answer: B, C

The correct answer is B, C. Option B: Permission for the Lambda function to list buckets in Amazon S3 Option C: Permission for the Lambda function to write in DynamoDB

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 DynamoDB is a fully managed, serverless NoSQL database with single-digit millisecond latency and automatic scaling.

Topic 1 Β· Question 439

A company uses AWS to run its learning management system (LMS) application. The application runs on Amazon EC2 instances behind an Application Load Balancer (ALB). The application's domain name is managed in Amazon Route 53. The application is deployed in a single AWS Region, but the company wants to improve application performance for users all over the world. Which solution will improve global performance with the LEAST operational overhead?

  • ASet up an Amazon CloudFront distribution that uses the ALB as the origin server. Configure Route 53 to create a DNS alias record that points the application's domain name to the CloudFront distribution URL. (correct answer)
  • BLaunch more EC2 instances behind the ALConfigure the ALB to use session affinity (sticky sessions). Create a Route 53 alias record for the ALB by using a geolocation routing policy.
  • CCreate an AWS Client VPN endpoint in the VPInstruct users to connect to the VPN to access the application. Create a Route 53 alias record for the VPN endpoint. Configure Route 53 to use a geolocation routing policy.
  • DDeploy the application to multiple Regions across the world. Create a Route 53 alias record for the ALB by using a latency-based routing policy.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Set up an Amazon CloudFront distribution that uses the ALB as the origin server. Configure Route 53 to create a DNS alias record that points the application's domain name to the CloudFront distribution URL.

Explanation

Amazon CloudFront caches content at edge locations to reduce latency and offload origins. Amazon Route 53 provides DNS with health checks and routing policies for availability and latency. AWS Config tracks resource configuration changes and evaluates compliance.

Topic 1 Β· Question 440

A developer hosts a static website on Amazon S3 and connects the website to an Amazon CloudFront distribution. The website uses a custom domain name that points to the CloudFront URL. The developer has set up a continuous integration and continuous delivery (CI/CD) pipeline. The pipeline automatically runs when changes occur in an AWS CodeCommit repository. The pipeline has a source stage and then a build stage. The build stage invokes an AWS CodeBuild project that references a buildspec.yml file. The buildspec.yml file builds the code and deploys the static files to the S3 bucket. The pipeline runs successfully, and the latest website files are visible in the S3 bucket and at the S3 website URL. However, when the developer accesses the website through the CloudFront domain, the updates are not reflected on the website. What should the developer configure the buildspec.yml file to do to resolve this issue?

  • AProperly synchronize the objects in the S3 bucket with new files from the source stage.
  • BDelete the previous website files in the S3 bucket and redeploy the website files.
  • CInvalidate the file caches for the primary CloudFront distribution. (correct answer)
  • DModify the cross-origin resource sharing (CORS) policy of the S3 bucket and redeploy the website files.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Invalidate the file caches for the primary CloudFront distribution.

Explanation

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

Showing questions 421–440 of 557 Β· Page 22 of 28