πŸ”

DVA-C02 β€” questions

Page 9 of 28 Β· 557 total questions.

Topic 1 Β· Question 161

A developer wants to deploy a new version of an AWS Elastic Beanstalk application. During deployment, the application must maintain full capacity and avoid service interruption. Additionally, the developer must minimize the cost of additional resources that support the deployment. Which deployment method should the developer use to meet these requirements?

  • AAll at once
  • BRolling with additional batch (correct answer)
  • CBlue/green
  • DImmutable
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Rolling with additional batch

Explanation

AWS Batch schedules and runs batch computing jobs at any scale without managing clusters.

Topic 1 Β· Question 162

A developer has observed an increase in bugs in the AWS Lambda functions that a development team has deployed in its Node.js application. To minimize these bugs, the developer wants to implement automated testing of Lambda functions in an environment that closely simulates the Lambda environment. The developer needs to give other developers the ability to run the tests locally. The developer also needs to integrate the tests into the team’s continuous integration and continuous delivery (CI/CD) pipeline before the AWS Cloud Development Kit (AWS CDK) deployment. Which solution will meet these requirements?

  • ACreate sample events based on the Lambda documentation. Create automated test scripts that use the cdk local invoke command to invoke the Lambda functions. Check the response. Document the test scripts for the other developers on the team. Update the CI/CD pipeline to run the test scripts.
  • BInstall a unit testing framework that reproduces the Lambda execution environment. Create sample events based on the Lambda documentation. Invoke the handler function by using a unit testing framework. Check the response. Document how to run the unit testing framework for the other developers on the team. Update the CI/CD pipeline to run the unit testing framework.
  • CInstall the AWS Serverless Application Model (AWS SAM) CLI tool. Use the sam local generate-event command to generate sample events for the automated tests. Create automated test scripts that use the sam local invoke command to invoke the Lambda functions. Check the response. Document the test scripts for the other developers on the team. Update the CI/CD pipeline to run the test scripts. (correct answer)
  • DCreate sample events based on the Lambda documentation. Create a Docker container from the Node.js base image to invoke the Lambda functions. Check the response. Document how to run the Docker container for the other developers on the team. Update the CI/CD pipeline to run the Docker container.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Install the AWS Serverless Application Model (AWS SAM) CLI tool. Use the sam local generate-event command to generate sample events for the automated tests. Create automated test scripts that use the sam local invoke...

Explanation

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

Topic 1 Β· Question 163

A developer is troubleshooting an application that uses Amazon DynamoDB in the us-west-2 Region. The application is deployed to an Amazon EC2 instance. The application requires read-only permissions to a table that is named Cars. The EC2 instance has an attached IAM role that contains the following IAM policy: When the application tries to read from the Cars table, an Access Denied error occurs. How can the developer resolve this error?

Exhibit 1 for question 163
  • AModify the IAM policy resource to be β€œarn:aws:dynamodb:us-west-2:account-id:table/*”.
  • BModify the IAM policy to include the dynamodb:* action.
  • CCreate a trust policy that specifies the EC2 service principal. Associate the role with the policy. (correct answer)
  • DCreate a trust relationship between the role and dynamodb.amazonaws.com.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Create a trust policy that specifies the EC2 service principal. Associate the role with the policy.

Explanation

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

Topic 1 Β· Question 164

When using the AWS Encryption SDK, how does the developer keep track of the data encryption keys used to encrypt data?

  • AThe developer must manually keep track of the data encryption keys used for each data object.
  • BThe SDK encrypts the data encryption key and stores it (encrypted) as part of the returned ciphertext. (correct answer)
  • CThe SDK stores the data encryption keys automatically in Amazon S3.
  • DThe data encryption key is stored in the Userdata for the EC2 instance.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: The SDK encrypts the data encryption key and stores it (encrypted) as part of the returned ciphertext.

Topic 1 Β· Question 165

An application that runs on AWS Lambda requires access to specific highly confidential objects in an Amazon S3 bucket. In accordance with the principle of least privilege, a company grants access to the S3 bucket by using only temporary credentials. How can a developer configure access to the S3 bucket in the MOST secure way?

  • AHardcode the credentials that are required to access the S3 objects in the application code. Use the credentials to access the required S3 objects.
  • BCreate a secret access key and access key ID with permission to access the S3 bucket. Store the key and key ID in AWS Secrets Manager. Configure the application to retrieve the Secrets Manager secret and use the credentials to access the S3 objects.
  • CCreate a Lambda function execution role. Attach a policy to the role that grants access to specific objects in the S3 bucket. (correct answer)
  • DCreate a secret access key and access key ID with permission to access the S3 bucket. Store the key and key ID as environment variables in Lambda. Use the environment variables to access the required S3 objects.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Create a Lambda function execution role. Attach a policy to the role that grants access to specific objects in the S3 bucket.

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 166

A developer has code that is stored in an Amazon S3 bucket. The code must be deployed as an AWS Lambda function across multiple accounts in the same AWS Region as the S3 bucket. An AWS CloudFormation template that runs for each account will deploy the Lambda function. What is the MOST secure way to allow CloudFormation to access the Lambda code in the S3 bucket?

  • AGrant the CloudFormation service role the S3 ListBucket and GetObject permissions. Add a bucket policy to Amazon S3 with the principal of β€œAWS”: [account numbers]. (correct answer)
  • BGrant the CloudFormation service role the S3 GetObject permission. Add a bucket policy to Amazon S3 with the principal of β€œ*”.
  • CUse a service-based link to grant the Lambda function the S3 ListBucket and GetObject permissions by explicitly adding the S3 bucket’s account number in the resource.
  • DUse a service-based link to grant the Lambda function the S3 GetObject permission. Add a resource of β€œ*” to allow access to the S3 bucket.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Grant the CloudFormation service role the S3 ListBucket and GetObject permissions. Add a bucket policy to Amazon S3 with the principal of β€œAWS”: [account numbers].

Explanation

Amazon S3 provides durable, scalable object storage that is fully managed. AWS CloudFormation provisions infrastructure as code repeatably.

Topic 1 Β· Question 167

A developer at a company needs to create a small application that makes the same API call once each day at a designated time. The company does not have infrastructure in the AWS Cloud yet, but the company wants to implement this functionality on AWS. Which solution meets these requirements in the MOST operationally efficient manner?

  • AUse a Kubernetes cron job that runs on Amazon Elastic Kubernetes Service (Amazon EKS).
  • BUse an Amazon Linux crontab scheduled job that runs on Amazon EC2.
  • CUse an AWS Lambda function that is invoked by an Amazon EventBridge scheduled event. (correct answer)
  • DUse an AWS Batch job that is submitted to an AWS Batch job queue.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Use an AWS Lambda function that is invoked by an Amazon EventBridge scheduled event.

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. Amazon EventBridge routes events between services with rules, enabling event-driven, decoupled architectures.

Topic 1 Β· Question 168

A developer is building a serverless application that is based on AWS Lambda. The developer initializes the AWS software development kit (SDK) outside of the Lambda handler function. What is the PRIMARY benefit of this action?

  • AImproves legibility and stylistic convention
  • BTakes advantage of runtime environment reuse (correct answer)
  • CProvides better error handling
  • DCreates a new SDK instance for each invocation
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Takes advantage of runtime environment reuse.

Topic 1 Β· Question 169

A company is using Amazon RDS as the backend database for its application. After a recent marketing campaign, a surge of read requests to the database increased the latency of data retrieval from the database. The company has decided to implement a caching layer in front of the database. The cached content must be encrypted and must be highly available. Which solution will meet these requirements?

  • AAmazon CloudFront
  • BAmazon ElastiCache for Memcached
  • CAmazon ElastiCache for Redis in cluster mode (correct answer)
  • DAmazon DynamoDB Accelerator (DAX)
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Amazon ElastiCache for Redis in cluster mode

Explanation

Amazon ElastiCache provides in-memory caching (Redis/Memcached) to reduce latency and offload the database. By spanning multiple Availability Zones / adding redundancy, this option provides the high availability and resilience required.

Topic 1 Β· Question 170

A developer at a company recently created a serverless application to process and show data from business reports. The application’s user interface (UI) allows users to select and start processing the files. The UI displays a message when the result is available to view. The application uses AWS Step Functions with AWS Lambda functions to process the files. The developer used Amazon API Gateway and Lambda functions to create an API to support the UI. The company’s UI team reports that the request to process a file is often returning timeout errors because of the size or complexity of the files. The UI team wants the API to provide an immediate response so that the UI can display a message while the files are being processed. The backend process that is invoked by the API needs to send an email message when the report processing is complete. What should the developer do to configure the API to meet these requirements?

  • AChange the API Gateway route to add an X-Amz-Invocation-Type header with a static value of β€˜Event’ in the integration request. Deploy the API Gateway stage to apply the changes. (correct answer)
  • BChange the configuration of the Lambda function that implements the request to process a file. Configure the maximum age of the event so that the Lambda function will run asynchronously.
  • CChange the API Gateway timeout value to match the Lambda function timeout value. Deploy the API Gateway stage to apply the changes.
  • DChange the API Gateway route to add an X-Amz-Target header with a static value of β€˜Async’ in the integration request. Deploy the API Gateway stage to apply the changes.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Change the API Gateway route to add an X-Amz-Invocation-Type header with a static value of β€˜Event’ in the integration request. Deploy the API Gateway stage to apply the changes.

Explanation

Amazon API Gateway is a fully managed front door for creating and securing APIs at scale.

Topic 1 Β· Question 171

A developer has an application that is composed of many different AWS Lambda functions. The Lambda functions all use some of the same dependencies. To avoid security issues, the developer is constantly updating the dependencies of all of the Lambda functions. The result is duplicated effort for each function. How can the developer keep the dependencies of the Lambda functions up to date with the LEAST additional complexity?

  • ADefine a maintenance window for the Lambda functions to ensure that the functions get updated copies of the dependencies.
  • BUpgrade the Lambda functions to the most recent runtime version.
  • CDefine a Lambda layer that contains all of the shared dependencies. (correct answer)
  • DUse an AWS CodeCommit repository to host the dependencies in a centralized location.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Define a Lambda layer that contains all of the shared dependencies.

Explanation

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

Topic 1 Β· Question 172

A mobile app stores blog posts in an Amazon DynamoDB table. Millions of posts are added every day, and each post represents a single item in the table. The mobile app requires only recent posts. Any post that is older than 48 hours can be removed. What is the MOST cost-effective way to delete posts that are older than 48 hours?

  • AFor each item, add a new attribute of type String that has a timestamp that is set to the blog post creation time. Create a script to find old posts with a table scan and remove posts that are older than 48 hours by using the BatchWriteItem API operation. Schedule a cron job on an Amazon EC2 instance once an hour to start the script.
  • BFor each item, add a new attribute of type String that has a timestamp that is set to the blog post creation time. Create a script to find old posts with a table scan and remove posts that are older than 48 hours by using the BatchWriteItem API operation. Place the script in a container image. Schedule an Amazon Elastic Container Service (Amazon ECS) task on AWS Fargate that invokes the container every 5 minutes.
  • CFor each item, add a new attribute of type Date that has a timestamp that is set to 48 hours after the blog post creation time. Create a global secondary index (GSI) that uses the new attribute as a sort key. Create an AWS Lambda function that references the GSI and removes expired items by using the BatchWriteItem API operation. Schedule the function with an Amazon CloudWatch event every minute.
  • DFor each item, add a new attribute of type Number that has a timestamp that is set to 48 hours after the blog post creation time. Configure the DynamoDB table with a TTL that references the new attribute. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: For each item, add a new attribute of type Number that has a timestamp that is set to 48 hours after the blog post creation time. Configure the DynamoDB table with a TTL that references the new attribute.

Explanation

Amazon DynamoDB is a fully managed, serverless NoSQL database with single-digit millisecond latency and automatic scaling. AWS Config tracks resource configuration changes and evaluates compliance. This option delivers the requirement at the lowest cost.

Topic 1 Β· Question 173

A developer is modifying an existing AWS Lambda function. While checking the code, the developer notices hardcoded parameter values for an Amazon RDS for SQL Server user name, password, database, host, and port. There are also hardcoded parameter values for an Amazon DynamoDB table, an Amazon S3 bucket, and an Amazon Simple Notification Service (Amazon SNS) topic. The developer wants to securely store the parameter values outside the code in an encrypted format and wants to turn on rotation for the credentials. The developer also wants to be able to reuse the parameter values from other applications and to update the parameter values without modifying code. Which solution will meet these requirements with the LEAST operational overhead?

  • ACreate an RDS database secret in AWS Secrets Manager. Set the user name, password, database, host, and port. Turn on secret rotation. Create encrypted Lambda environment variables for the DynamoDB table, S3 bucket, and SNS topic.
  • BCreate an RDS database secret in AWS Secrets Manager. Set the user name, password, database, host, and port. Turn on secret rotation. Create SecureString parameters in AWS Systems Manager Parameter Store for the DynamoDB table, S3 bucket, and SNS topic. (correct answer)
  • CCreate RDS database parameters in AWS Systems Manager Parameter Store for the user name, password, database, host, and port. Create encrypted Lambda environment variables for the DynamoDB table, S3 bucket, and SNS topic. Create a Lambda function and set the logic for the credentials rotation task. Schedule the credentials rotation task in Amazon EventBridge.
  • DCreate RDS database parameters in AWS Systems Manager Parameter Store for the user name, password, database, host, and port. Store the DynamoDB table, S3 bucket, and SNS topic in Amazon S3. Create a Lambda function and set the logic for the credentials rotation. Invoke the Lambda function on a schedule.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Create an RDS database secret in AWS Secrets Manager. Set the user name, password, database, host, and port. Turn on secret rotation. Create SecureString parameters in AWS Systems Manager Parameter Store for the Dynam...

Explanation

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. Amazon RDS is a managed relational database that handles patching, backups and failover.

Topic 1 Β· Question 174

A developer accesses AWS CodeCommit over SSH. The SSH keys configured to access AWS CodeCommit are tied to a user with the following permissions: The developer needs to create/delete branches. Which specific IAM permissions need to be added, based on the principle of least privilege?

Exhibit 1 for question 174
  • A"codecommit:CreateBranch" "codecommit:DeleteBranch" (correct answer)
  • B"codecommit:Put*"
  • C"codecommit:Update*"
  • D"codecommit:*"
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: "codecommit:CreateBranch" "codecommit:DeleteBranch"

Explanation

AWS CodeCommit hosts private Git repositories.

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

An application that is deployed to Amazon EC2 is using Amazon DynamoDB. The application calls the DynamoDB REST API. Periodically, the application receives a ProvisionedThroughputExceededException error when the application writes to a DynamoDB table. Which solutions will mitigate this error MOST cost-effectively? (Choose two.)

  • AModify the application code to perform exponential backoff when the error is received. (correct answer)
  • BModify the application to use the AWS SDKs for DynamoDB. (correct answer)
  • CIncrease the read and write throughput of the DynamoDB table.
  • DCreate a DynamoDB Accelerator (DAX) cluster for the DynamoDB table.
  • ECreate a second DynamoDB table. Distribute the reads and writes between the two tables.
Reveal answer & explanation
Correct answer: A, B

The correct answer is A, B. Option A: Modify the application code to perform exponential backoff when the error is received. Option B: Modify the application to use the AWS SDKs for DynamoDB.

Explanation

Amazon DynamoDB is a fully managed, serverless NoSQL database with single-digit millisecond latency and automatic scaling. This option delivers the requirement at the lowest cost.

Topic 1 Β· Question 176

When a developer tries to run an AWS CodeBuild project, it raises an error because the length of all environment variables exceeds the limit for the combined maximum of characters. What is the recommended solution?

  • AAdd the export LC_ALL="en_US.utf8" command to the pre_build section to ensure POSIX localization.
  • BUse Amazon Cognito to store key-value pairs for large numbers of environment variables.
  • CUpdate the settings for the build project to use an Amazon S3 bucket for large numbers of environment variables.
  • DUse AWS Systems Manager Parameter Store to store large numbers of environment variables. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Use AWS Systems Manager Parameter Store to store large numbers of environment variables.

Explanation

Systems Manager Parameter Store securely stores configuration data and secrets. AWS Systems Manager operates and automates management of fleets of resources.

Topic 1 Β· Question 177

A company is expanding the compatibility of its photo-sharing mobile app to hundreds of additional devices with unique screen dimensions and resolutions. Photos are stored in Amazon S3 in their original format and resolution. The company uses an Amazon CloudFront distribution to serve the photos. The app includes the dimension and resolution of the display as GET parameters with every request. A developer needs to implement a solution that optimizes the photos that are served to each device to reduce load time and increase photo quality. Which solution will meet these requirements MOST cost-effectively?

  • AUse S3 Batch Operations to invoke an AWS Lambda function to create new variants of the photos with the required dimensions and resolutions. Create a dynamic CloudFront origin that automatically maps the request of each device to the corresponding photo variant.
  • BUse S3 Batch Operations to invoke an AWS Lambda function to create new variants of the photos with the required dimensions and resolutions. Create a Lambda@Edge function to route requests to the corresponding photo variant by using request headers.
  • CCreate a Lambda@Edge function that optimizes the photos upon request and returns the photos as a response. Change the CloudFront TTL cache policy to the maximum value possible.
  • DCreate a Lambda@Edge function that optimizes the photos upon request and returns the photos as a response. In the same function, store a copy of the processed photos on Amazon S3 for subsequent requests. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Create a Lambda@Edge function that optimizes the photos upon request and returns the photos as a response. In the same function, store a copy of the processed photos on Amazon S3 for subsequent requests.

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. This option delivers the requirement at the lowest cost.

Topic 1 Β· Question 178

A company is building an application for stock trading. The application needs sub-millisecond latency for processing trade requests. The company uses Amazon DynamoDB to store all the trading data that is used to process each trading request. A development team performs load testing on the application and finds that the data retrieval time is higher than expected. The development team needs a solution that reduces the data retrieval time with the least possible effort. Which solution meets these requirements?

  • AAdd local secondary indexes (LSIs) for the trading data.
  • BStore the trading data in Amazon S3, and use S3 Transfer Acceleration.
  • CAdd retries with exponential backoff for DynamoDB queries.
  • DUse DynamoDB Accelerator (DAX) to cache the trading data. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Use DynamoDB Accelerator (DAX) to cache the trading data.

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

A developer is working on a Python application that runs on Amazon EC2 instances. The developer wants to enable tracing of application requests to debug performance issues in the code. Which combination of actions should the developer take to achieve this goal? (Choose two.)

  • AInstall the Amazon CloudWatch agent on the EC2 instances.
  • BInstall the AWS X-Ray daemon on the EC2 instances. (correct answer)
  • CConfigure the application to write JSON-formatted logs to /var/log/cloudwatch.
  • DConfigure the application to write trace data to /var/log/xray.
  • EInstall and configure the AWS X-Ray SDK for Python in the application. (correct answer)
Reveal answer & explanation
Correct answer: B, E

The correct answer is B, E. Option B: Install the AWS X-Ray daemon on the EC2 instances. Option E: Install and configure the AWS X-Ray SDK for Python in the application.

Explanation

Amazon EC2 provides resizable virtual servers when you need full control of the operating system. AWS Config tracks resource configuration changes and evaluates compliance. AWS X-Ray traces requests to analyze and debug distributed applications.

Topic 1 Β· Question 180

A company has an application that runs as a series of AWS Lambda functions. Each Lambda function receives data from an Amazon Simple Notification Service (Amazon SNS) topic and writes the data to an Amazon Aurora DB instance. To comply with an information security policy, the company must ensure that the Lambda functions all use a single securely encrypted database connection string to access Aurora. Which solution will meet these requirements?

  • AUse IAM database authentication for Aurora to enable secure database connections for all the Lambda functions.
  • BStore the credentials and read the credentials from an encrypted Amazon RDS DB instance.
  • CStore the credentials in AWS Systems Manager Parameter Store as a secure string parameter. (correct answer)
  • DUse Lambda environment variables with a shared AWS Key Management Service (AWS KMS) key for encryption.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Store the credentials in AWS Systems Manager Parameter Store as a secure string parameter.

Explanation

Systems Manager Parameter Store securely stores configuration data and secrets. AWS Systems Manager operates and automates management of fleets of resources.

Showing questions 161–180 of 557 Β· Page 9 of 28