πŸ”

DVA-C02 β€” questions

Page 7 of 28 Β· 557 total questions.

Topic 1 Β· Question 121

A company's developer is building a static website to be deployed in Amazon S3 for a production environment. The website integrates with an Amazon Aurora PostgreSQL database by using an AWS Lambda function. The website that is deployed to production will use a Lambda alias that points to a specific version of the Lambda function. The company must rotate the database credentials every 2 weeks. Lambda functions that the company deployed previously must be able to use the most recent credentials. Which solution will meet these requirements?

  • AStore the database credentials in AWS Secrets Manager. Turn on rotation. Write code in the Lambda function to retrieve the credentials from Secrets Manager. (correct answer)
  • BInclude the database credentials as part of the Lambda function code. Update the credentials periodically and deploy the new Lambda function.
  • CUse Lambda environment variables. Update the environment variables when new credentials are available.
  • DStore the database credentials in AWS Systems Manager Parameter Store. Turn on rotation. Write code in the Lambda function to retrieve the credentials from Systems Manager Parameter Store.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Store the database credentials in AWS Secrets Manager. Turn on rotation. Write code in the Lambda function to retrieve the credentials from Secrets Manager.

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. AWS Secrets Manager stores and automatically rotates secrets such as database credentials.

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

A developer is developing an application that uses signed requests (Signature Version 4) to call other AWS services. The developer has created a canonical request, has created the string to sign, and has calculated signing information. Which methods could the developer use to complete a signed request? (Choose two.)

  • AAdd the signature to an HTTP header that is named Authorization. (correct answer)
  • BAdd the signature to a session cookie.
  • CAdd the signature to an HTTP header that is named Authentication.
  • DAdd the signature to a query string parameter that is named X-Amz-Signature. (correct answer)
  • EAdd the signature to an HTTP header that is named WWW-Authenticate.
Reveal answer & explanation
Correct answer: A, D

The correct answer is A, D. Option A: Add the signature to an HTTP header that is named Authorization. Option D: Add the signature to a query string parameter that is named X-Amz-Signature.

Topic 1 Β· Question 123

A company must deploy all its Amazon RDS DB instances by using AWS CloudFormation templates as part of AWS CodePipeline continuous integration and continuous delivery (CI/CD) automation. The primary password for the DB instance must be automatically generated as part of the deployment process. Which solution will meet these requirements with the LEAST development effort?

  • ACreate an AWS Lambda-backed CloudFormation custom resource. Write Lambda code that generates a secure string. Return the value of the secure string as a data field of the custom resource response object. Use the CloudFormation Fn::GetAtt intrinsic function to get the value of the secure string. Use the value to create the DB instance.
  • BUse the AWS CodeBuild action of CodePipeline to generate a secure string by using the following AWS CLI command: aws secretsmanager get-random-password. Pass the generated secure string as a CloudFormation parameter with the NoEcho attribute set to true. Use the parameter reference to create the DB instance.
  • CCreate an AWS Lambda-backed CloudFormation custom resource. Write Lambda code that generates a secure string. Return the value of the secure string as a data field of the custom resource response object. Use the CloudFormation Fn::GetAtt intrinsic function to get a value of the secure string. Create secrets in AWS Secrets Manager. Use the secretsmanager dynamic reference to use the value stored in the secret to create the DB instance.
  • DUse the AWS::SecretsManager::Secret resource to generate a secure string. Store the secure string as a secret in AWS Secrets Manager. Use the secretsmanager dynamic reference to use the value stored in the secret to create the DB instance. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Use the AWS::SecretsManager::Secret resource to generate a secure string. Store the secure string as a secret in AWS Secrets Manager. Use the secretsmanager dynamic reference to use the value stored in the secret to c...

Explanation

AWS Secrets Manager stores and automatically rotates secrets such as database credentials. This option needs the least custom development effort.

Topic 1 Β· Question 124

An organization is storing large files in Amazon S3, and is writing a web application to display meta-data about the files to end-users. Based on the metadata a user selects an object to download. The organization needs a mechanism to index the files and provide single-digit millisecond latency retrieval for the metadata. What AWS service should be used to accomplish this?

  • AAmazon DynamoDB (correct answer)
  • BAmazon EC2
  • CAWS Lambda
  • DAmazon RDS
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Amazon DynamoDB

Explanation

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

Topic 1 Β· Question 125

A developer is creating an AWS Serverless Application Model (AWS SAM) template. The AWS SAM template contains the definition of multiple AWS Lambda functions, an Amazon S3 bucket, and an Amazon CloudFront distribution. One of the Lambda functions runs on Lambda@Edge in the CloudFront distribution. The S3 bucket is configured as an origin for the CloudFront distribution. When the developer deploys the AWS SAM template in the eu-west-1 Region, the creation of the stack fails. Which of the following could be the reason for this issue?

  • ACloudFront distributions can be created only in the us-east-1 Region.
  • BLambda@Edge functions can be created only in the us-east-1 Region. (correct answer)
  • CA single AWS SAM template cannot contain multiple Lambda functions.
  • DThe CloudFront distribution and the S3 bucket cannot be created in the same Region.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Lambda@Edge functions can be created only in the us-east-1 Region.

Explanation

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

Topic 1 Β· Question 126

A developer is integrating Amazon ElastiCache in an application. The cache will store data from a database. The cached data must populate real-time dashboards. Which caching strategy will meet these requirements?

  • AA read-through cache
  • BA write-behind cache
  • CA lazy-loading cache
  • DA write-through cache (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: A write-through cache This option meets the real-time / low-latency performance requirement.

Topic 1 Β· Question 127

A developer is creating an AWS Lambda function. The Lambda function needs an external library to connect to a third-party solution. The external library is a collection of files with a total size of 100 MB. The developer needs to make the external library available to the Lambda execution environment and reduce the Lambda package space. Which solution will meet these requirements with the LEAST operational overhead?

  • ACreate a Lambda layer to store the external library. Configure the Lambda function to use the layer. (correct answer)
  • BCreate an Amazon S3 bucket. Upload the external library into the S3 bucket. Mount the S3 bucket folder in the Lambda function. Import the library by using the proper folder in the mount point.
  • CLoad the external library to the Lambda function's /tmp directory during deployment of the Lambda package. Import the library from the /tmp directory.
  • DCreate an Amazon Elastic File System (Amazon EFS) volume. Upload the external library to the EFS volume. Mount the EFS volume in the Lambda function. Import the library by using the proper folder in the mount point.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Create a Lambda layer to store the external library. Configure the Lambda function to use the layer.

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 128

A company has a front-end application that runs on four Amazon EC2 instances behind an Elastic Load Balancer (ELB) in a production environment that is provisioned by AWS Elastic Beanstalk. A developer needs to deploy and test new application code while updating the Elastic Beanstalk platform from the current version to a newer version of Node.js. The solution must result in zero downtime for the application. Which solution meets these requirements?

  • AClone the production environment to a different platform version. Deploy the new application code, and test it. Swap the environment URLs upon verification.
  • BDeploy the new application code in an all-at-once deployment to the existing EC2 instances. Test the code. Redeploy the previous code if verification fails.
  • CPerform an immutable update to deploy the new application code to new EC2 instances. Serve traffic to the new instances after they pass health checks. (correct answer)
  • DUse a rolling deployment for the new application code. Apply the code to a subset of EC2 instances until the tests pass. Redeploy the previous code if the tests fail.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Perform an immutable update to deploy the new application code to new EC2 instances. Serve traffic to the new instances after they pass health checks.

Explanation

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

Topic 1 Β· Question 129

A developer is creating an AWS Lambda function. The Lambda function will consume messages from an Amazon Simple Queue Service (Amazon SQS) queue. The developer wants to integrate unit testing as part of the function's continuous integration and continuous delivery (CI/CD) process. How can the developer unit test the function?

  • ACreate an AWS CloudFormation template that creates an SQS queue and deploys the Lambda function. Create a stack from the template during the CI/CD process. Invoke the deployed function. Verify the output.
  • BCreate an SQS event for tests. Use a test that consumes messages from the SQS queue during the function's Cl/CD process.
  • CCreate an SQS queue for tests. Use this SQS queue in the application's unit test. Run the unit tests during the CI/CD process.
  • DUse the aws lambda invoke command with a test event during the CIICD process. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Use the aws lambda invoke command with a test event during the CIICD process.

Explanation

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

Topic 1 Β· Question 130

A developer is working on a web application that uses Amazon DynamoDB as its data store. The application has two DynamoDB tables: one table that is named artists and one table that is named songs. The artists table has artistName as the partition key. The songs table has songName as the partition key and artistName as the sort key. The table usage patterns include the retrieval of multiple songs and artists in a single database operation from the webpage. The developer needs a way to retrieve this information with minimal network traffic and optimal application performance. Which solution will meet these requirements?

  • APerform a BatchGetltem operation that returns items from the two tables. Use the list of songName/artistName keys for the songs table and the list of artistName key for the artists table. (correct answer)
  • BCreate a local secondary index (LSI) on the songs table that uses artistName as the partition key. Perform a query operation for each artistName on the songs table that filters by the list of songName. Perform a query operation for each artistName on the artists table.
  • CPerform a BatchGetitem operation on the songs table that uses the songName/artistName keys. Perform a BatchGetltem operation on the artists table that uses artistName as the key.
  • DPerform a Scan operation on each table that filters by the list of songName/artistName for the songs table and the list of artistName in the artists table.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Perform a BatchGetltem operation that returns items from the two tables. Use the list of songName/artistName keys for the songs table and the list of artistName key for the artists table.

Explanation

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

Topic 1 Β· Question 131

A company is developing an ecommerce application that uses Amazon API Gateway APIs. The application uses AWS Lambda as a backend. The company needs to test the code in a dedicated, monitored test environment before the company releases the code to the production environment. Which solution will meet these requirements?

  • AUse a single stage in API Gateway. Create a Lambda function for each environment. Configure API clients to send a query parameter that indicates the environment and the specific Lambda function.
  • BUse multiple stages in API Gateway. Create a single Lambda function for all environments. Add different code blocks for different environments in the Lambda function based on Lambda environment variables.
  • CUse multiple stages in API Gateway. Create a Lambda function for each environment. Configure API Gateway stage variables to route traffic to the Lambda function in different environments. (correct answer)
  • DUse a single stage in API Gateway. Configure API clients to send a query parameter that indicates the environment. Add different code blocks for different environments in the Lambda function to match the value of the query parameter.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Use multiple stages in API Gateway. Create a Lambda function for each environment. Configure API Gateway stage variables to route traffic to the Lambda function in different environments.

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. Amazon API Gateway is a fully managed front door for creating and securing APIs at scale. AWS Config tracks resource configuration changes and evaluates compliance.

Topic 1 Β· Question 132

A developer creates an AWS Lambda function that retrieves and groups data from several public API endpoints. The Lambda function has been updated and configured to connect to the private subnet of a VPC. An internet gateway is attached to the VPC. The VPC uses the default network ACL and security group configurations. The developer finds that the Lambda function can no longer access the public API. The developer has ensured that the public API is accessible, but the Lambda function cannot connect to the API How should the developer fix the connection issue?

  • AEnsure that the network ACL allows outbound traffic to the public internet.
  • BEnsure that the security group allows outbound traffic to the public internet.
  • CEnsure that outbound traffic from the private subnet is routed to a public NAT gateway. (correct answer)
  • DEnsure that outbound traffic from the private subnet is routed to a new internet gateway.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Ensure that outbound traffic from the private subnet is routed to a public NAT gateway.

Explanation

A NAT gateway lets private subnet resources reach the internet for outbound traffic only.

Topic 1 Β· Question 133

A developer needs to store configuration variables for an application. The developer needs to set an expiration date and time for the configuration. The developer wants to receive notifications before the configuration expires. Which solution will meet these requirements with the LEAST operational overhead?

  • ACreate a standard parameter in AWS Systems Manager Parameter Store. Set Expiration and ExpirationNotification policy types.
  • BCreate a standard parameter in AWS Systems Manager Parameter Store. Create an AWS Lambda function to expire the configuration and to send Amazon Simple Notification Service (Amazon SNS) notifications.
  • CCreate an advanced parameter in AWS Systems Manager Parameter Store. Set Expiration and ExpirationNotification policy types. (correct answer)
  • DCreate an advanced parameter in AWS Systems Manager Parameter Store. Create an Amazon EC2 instance with a cron job to expire the configuration and to send notifications.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Create an advanced parameter in AWS Systems Manager Parameter Store. Set Expiration and ExpirationNotification policy types.

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 134

A company is developing a serverless application that consists of various AWS Lambda functions behind Amazon API Gateway APIs. A developer needs to automate the deployment of Lambda function code. The developer will deploy updated Lambda functions with AWS CodeDeploy. The deployment must minimize the exposure of potential errors to end users. When the application is in production, the application cannot experience downtime outside the specified maintenance window. Which deployment configuration will meet these requirements with the LEAST deployment time?

  • AUse the AWS CodeDeploy in-place deployment configuration for the Lambda functions. Shift all traffic immediately after deployment.
  • BUse the AWS CodeDeploy linear deployment configuration to shift 10% of the traffic every minute.
  • CUse the AWS CodeDeploy all-at-once deployment configuration to shift all traffic to the updated versions immediately.
  • DUse the AWS CodeDeploy predefined canary deployment configuration to shift 10% of the traffic immediately and shift the remaining traffic after 5 minutes. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Use the AWS CodeDeploy predefined canary deployment configuration to shift 10% of the traffic immediately and shift the remaining traffic after 5 minutes.

Explanation

AWS Config tracks resource configuration changes and evaluates compliance. AWS CodeDeploy automates application deployments to compute services.

Topic 1 Β· Question 135

A company created four AWS Lambda functions that connect to a relational database server that runs on an Amazon RDS instance. A security team requires the company to automatically change the database password every 30 days. Which solution will meet these requirements MOST securely?

  • AStore the database credentials in the environment variables of the Lambda function. Deploy the Lambda function with the new credentials every 30 days.
  • BStore the database credentials in AWS Secrets Manager. Configure a 30-day rotation schedule for the credentials. (correct answer)
  • CStore the database credentials in AWS Systems Manager Parameter Store secure strings. Configure a 30-day schedule for the secure strings.
  • DStore the database credentials in an Amazon S3 bucket that uses server-side encryption with customer-provided encryption keys (SSE-C). Configure a 30-day key rotation schedule for the customer key.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Store the database credentials in AWS Secrets Manager. Configure a 30-day rotation schedule for the credentials.

Explanation

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

Topic 1 Β· Question 136

A developer is setting up a deployment pipeline. The pipeline includes an AWS CodeBuild build stage that requires access to a database to run integration tests. The developer is using a buildspec.yml file to configure the database connection. Company policy requires automatic rotation of all database credentials. Which solution will handle the database credentials MOST securely?

  • ARetrieve the credentials from variables that are hardcoded in the buildspec.yml file. Configure an AWS Lambda function to rotate the credentials.
  • BRetrieve the credentials from an environment variable that is linked to a SecureString parameter in AWS Systems Manager Parameter Store. Configure Parameter Store for automatic rotation.
  • CRetrieve the credentials from an environment variable that is linked to an AWS Secrets Manager secret. Configure Secrets Manager for automatic rotation. (correct answer)
  • DRetrieve the credentials from an environment variable that contains the connection string in plaintext. Configure an Amazon EventBridge event to rotate the credentials.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Retrieve the credentials from an environment variable that is linked to an AWS Secrets Manager secret. Configure Secrets Manager for automatic rotation.

Explanation

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

Topic 1 Β· Question 137

A company is developing a serverless multi-tier application on AWS. The company will build the serverless logic tier by using Amazon API Gateway and AWS Lambda. While the company builds the logic tier, a developer who works on the frontend of the application must develop integration tests. The tests must cover both positive and negative scenarios, depending on success and error HTTP status codes. Which solution will meet these requirements with the LEAST effort?

  • ASet up a mock integration for API methods in API Gateway. In the integration request from Method Execution, add simple logic to return either a success or error based on HTTP status code. In the integration response, add messages that correspond to the HTTP status codes. (correct answer)
  • BCreate two mock integration resources for API methods in API Gateway. In the integration request, return a success HTTP status code for one resource and an error HTTP status code for the other resource. In the integration response, add messages that correspond to the HTTP status codes.
  • CCreate Lambda functions to perform tests. Add simple logic to return either success or error, based on the HTTP status codes. Build an API Gateway Lambda integration. Select appropriate Lambda functions that correspond to the HTTP status codes.
  • DCreate a Lambda function to perform tests. Add simple logic to return either success or error-based HTTP status codes. Create a mock integration in API Gateway. Select the Lambda function that corresponds to the HTTP status codes.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Set up a mock integration for API methods in API Gateway. In the integration request from Method Execution, add simple logic to return either a success or error based on HTTP status code. In the integration response,...

Explanation

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

Topic 1 Β· Question 138

Users are reporting errors in an application. The application consists of several microservices that are deployed on Amazon Elastic Container Service (Amazon ECS) with AWS Fargate. Which combination of steps should a developer take to fix the errors? (Choose two.)

  • ADeploy AWS X-Ray as a sidecar container to the microservices. Update the task role policy to allow access to the X-Ray API. (correct answer)
  • BDeploy AWS X-Ray as a daemonset to the Fargate cluster. Update the service role policy to allow access to the X-Ray API.
  • CInstrument the application by using the AWS X-Ray SDK. Update the application to use the PutXrayTrace API call to communicate with the X-Ray API.
  • DInstrument the application by using the AWS X-Ray SDK. Update the application to communicate with the X-Ray daemon.
  • EInstrument the ECS task to send the stdout and stderr output to Amazon CloudWatch Logs. Update the task role policy to allow the cloudwatch:PullLogs action.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Deploy AWS X-Ray as a sidecar container to the microservices. Update the task role policy to allow access to the X-Ray API.

Explanation

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

Topic 1 Β· Question 139

A developer is creating an application for a company. The application needs to read the file doc.txt that is placed in the root folder of an Amazon S3 bucket that is named DOC-EXAMPLE-BUCKET. The company’s security team requires the principle of least privilege to be applied to the application’s IAM policy.

Which IAM policy statement will meet these security requirements?

  • AOption A for question 139 (correct answer)
  • BOption B for question 139
  • COption C for question 139
  • DOption D for question 139
Reveal answer & explanation
Correct answer: A

The correct answer is A. Compare the policy/code shown in each option image.

Topic 1 Β· Question 140

A company has an application that uses AWS CodePipeline to automate its continuous integration and continuous delivery (CI/CD) workflow. The application uses AWS CodeCommit for version control. A developer who was working on one of the tasks did not pull the most recent changes from the main branch. A week later, the developer noticed merge conflicts. How can the developer resolve the merge conflicts in the developer's branch with the LEAST development effort?

  • AClone the repository. Create a new branch. Update the branch with the changes.
  • BCreate a new branch. Apply the changes from the previous branch.
  • CUse the Commit Visualizer view to compare the commits when a feature was added. Fix the merge conflicts.
  • DStop the pull from the main branch to the feature branch. Rebase the feature branch from the main branch. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Stop the pull from the main branch to the feature branch. Rebase the feature branch from the main branch. This option needs the least custom development effort.

Showing questions 121–140 of 557 Β· Page 7 of 28