πŸ”

DVA-C02 β€” questions

Page 20 of 28 Β· 557 total questions.

Topic 1 Β· Question 381

A developer updates an AWS Lambda function that an Amazon API Gateway API uses. The API is the backend for a web application. The developer needs to test the updated Lambda function before deploying the Lambda function to production. The testing must not affect any production users of the web application. Which solution will meet these requirements in the MOST operationally efficient way?

  • ACreate a canary release deployment for the existing API stage. Deploy the API to the existing stage. Test the updated Lambda function by using the existing URL.
  • BUpdate the API Gateway API endpoint type to private. Deploy the changes to the existing API stage. Test the API by using the existing URL.
  • CCreate a new test API stage in API Gateway. Add stage variables to deploy the updated Lambda function to only the test stage. Test the updated Lambda function by using the new stage URL. (correct answer)
  • DCreate a new AWS CloudFormation stack to deploy a copy of the entire production API and Lambda function. Use the stack's API URL to test the updated Lambda function.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Create a new test API stage in API Gateway. Add stage variables to deploy the updated Lambda function to only the test stage. Test the updated Lambda function by using the new stage URL.

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.

Topic 1 Β· Question 382

A developer wants the ability to roll back to a previous version of an AWS Lambda function in the event of errors caused by a new deployment. How can the developer achieve this with MINIMAL impact on users?

  • AChange the application to use an alias that points to the current version. Deploy the new version of the code. Update the alias to use the newly deployed version. If too many errors are encountered, point the alias back to the previous version.
  • BChange the application to use an alias that points to the current version. Deploy the new version of the code. Update the alias to direct 10% of users to the newly deployed version. If too many errors are encountered, send 100% of traffic to the previous version. (correct answer)
  • CDo not make any changes to the application. Deploy the new version of the code. If too many errors are encountered, point the application back to the previous version using the version number in the Amazon Resource Name (ARN).
  • DCreate three aliases: new, existing, and router. Point the existing alias to the current version. Have the router alias direct 100% of users to the existing alias. Update the application to use the router alias. Deploy the new version of the code. Point the new alias to this version. Update the router alias to direct 10% of users to the new alias. If too many errors are encountered, send 100% of traffic to the existing alias.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Change the application to use an alias that points to the current version. Deploy the new version of the code. Update the alias to direct 10% of users to the newly deployed version. If too many errors are encountered,...

Topic 1 Β· Question 383

A company maintains a REST service using Amazon API Gateway and the API Gateway native API key validation. The company recently launched a new registration page, which allows users to sign up for the service. The registration page creates a new API key using CreateApiKey and sends the new key to the user. When the user attempts to call the API using this key, the user receives a 403 Forbidden error. Existing users are unaffected and can still call the API. What code updates will grant these new users access to the API?

  • AThe createDeployment method must be called so the API can be redeployed to include the newly created API key.
  • BThe updateAuthorizer method must be called to update the API's authorizer to include the newly created API key.
  • CThe importApiKeys method must be called to import all newly created API keys into the current stage of the API.
  • DThe createUsagePlanKey method must be called to associate the newly created API key with the correct usage plan. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: The createUsagePlanKey method must be called to associate the newly created API key with the correct usage plan.

Topic 1 Β· Question 384

A company uses an AWS CloudFormation template to deploy and manage its AWS infrastructure. The CloudFormation template creates Amazon VPC security groups and Amazon EC2 security groups. A manager finds out that some engineers modified the security groups of a few EC2 instances for testing purposes. A developer needs to determine what modifications occurred. Which solution will meet this requirement?

  • AAdd a Conditions section statement in the source YAML file of the template. Run the CloudFormation stack.
  • BPerform a drift detection operation on the CloudFormation stack. (correct answer)
  • CExecute a change set for the CloudFormation stack.
  • DUse Amazon Detective to detect the modifications.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Perform a drift detection operation on the CloudFormation stack.

Explanation

AWS CloudFormation provisions infrastructure as code repeatably.

Topic 1 Β· Question 385

An IAM role is attached to an Amazon EC2 instance that explicitly denies access to all Amazon S3 API actions. The EC2 instance credentials file specifies the IAM access key and secret access key, which allow full administrative access. Given that multiple modes of IAM access are present for this EC2 instance, which of the following is correct?

  • AThe EC2 instance will only be able to list the S3 buckets.
  • BThe EC2 instance will only be able to list the contents of one S3 bucket at a time.
  • CThe EC2 instance will be able to perform all actions on any S3 bucket.
  • DThe EC2 instance will not be able to perform any S3 action on any S3 bucket. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: The EC2 instance will not be able to perform any S3 action on any 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.

Topic 1 Β· Question 386

A company uses an AWS Lambda function to transfer files from an Amazon S3 bucket to the company's SFTP server. The Lambda function connects to the SFTP server by using credentials such as username and password. The company uses Lambda environment variables to store these credentials. A developer needs to implement encrypted username and password credentials. Which solution will meet these requirements?

  • ARemove the user credentials from the Lambda environment. Implement IAM database authentication.
  • BMove the user credentials from Lambda environment variables to AWS Systems Manager Parameter Store. (correct answer)
  • CMove the user credentials from Lambda environment variables to AWS Key Management Service (AWS KMS).
  • DMove the user credentials from the Lambda environment to an encrypted .txt file. Store the file in an S3 bucket.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Move the user credentials from Lambda environment variables to AWS Systems Manager Parameter Store.

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. Systems Manager Parameter Store securely stores configuration data and secrets. AWS Systems Manager operates and automates management of fleets of resources.

Topic 1 Β· Question 387

A developer is creating a new batch application that will run on an Amazon EC2 instance. The application requires read access to an Amazon S3 bucket. The developer needs to follow security best practices to grant S3 read access to the application. Which solution meets these requirements?

  • AAdd the permissions to an IAM policy. Attach the policy to a role. Attach the role to the EC2 instance profile. (correct answer)
  • BAdd the permissions inline to an IAM group. Attach the group to the EC2 instance profile.
  • CAdd the permissions to an IAM policy. Attach the policy to a user. Attach the user to the EC2 instance profile.
  • DAdd the permissions to an IAM policy. Use IAM web identity federation to access the S3 bucket with the policy.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Add the permissions to an IAM policy. Attach the policy to a role. Attach the role to the EC2 instance profile.

Explanation

Amazon EC2 provides resizable virtual servers when you need full control of the operating system. AWS IAM controls authenticated and authorized access to AWS resources with fine-grained policies.

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

A company has an application that receives batches of orders from partners every day. The application uses an AWS Lambda function to process the batches. If a batch contains no orders, the Lambda function must publish to an Amazon Simple Notification Service (Amazon SNS) topic as soon as possible. Which combination of steps will meet this requirement with the LEAST implementation effort? (Choose two.)

  • AUpdate the existing Lambda function's code to send an Amazon CloudWatch custom metric for the number of orders in a batch for each partner. (correct answer)
  • BCreate a new Lambda function as an Amazon Kinesis data stream consumer. Configure the new Lambda function to track orders and to publish to the SNS topic when a batch contains no orders.
  • CSet up an Amazon CloudWatch alarm that will send a notification to the SNS topic when the value of the custom metric is 0. (correct answer)
  • DSchedule a new Lambda function to analyze Amazon CloudWatch metrics every 24 hours to identify batches that contain no orders. Configure the Lambda function to publish to the SNS topic.
  • EModify the existing Lambda function to log orders to an Amazon Kinesis data stream.
Reveal answer & explanation
Correct answer: A, C

The correct answer is A, C. Option A: Update the existing Lambda function's code to send an Amazon CloudWatch custom metric for the number of orders in a batch for each partner. Option C: Set up an Amazon CloudWatch alarm that will send a notification to the SNS topic when the value of the custom metric is 0.

Explanation

AWS Lambda runs code without provisioning servers and scales automatically, which minimizes operational overhead. AWS Batch schedules and runs batch computing jobs at any scale without managing clusters. Amazon SNS is a managed pub/sub service for fan-out notifications to many subscribers.

Topic 1 Β· Question 389

A developer has an application that uses an Amazon DynamoDB table with a configured local secondary index (LSI). During application testing, the DynamoDB table metrics report a ProvisionedThroughputExceededException error message. The number of requests made by the test suite did not exceed the table's provisioned capacity limits. What is the cause of this issue?

  • AThe data in the table's partition key column is not evenly distributed. (correct answer)
  • BThe LSI's capacity is different from the table's capacity.
  • CThe application is not implementing exponential backoff retry logic while interacting with the DynamoDB API.
  • DThe application has the IAM permission to query the DynamoDB table but not to query the LSI.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: The data in the table's partition key column is not evenly distributed.

Topic 1 Β· Question 390

A developer manages a website that distributes its content by using Amazon CloudFront. The website's static artifacts are stored in an Amazon S3 bucket. The developer deploys some changes and can see the new artifacts in the S3 bucket. However, the changes do not appear on the webpage that the CloudFront distribution delivers. How should the developer resolve this issue?

  • AConfigure S3 Object Lock to update to the latest version of the files every time an S3 object is updated.
  • BConfigure the S3 bucket to clear all old objects from the bucket before new artifacts are uploaded.
  • CSet CloudFront to invalidate the cache after the artifacts have been deployed to Amazon S3. (correct answer)
  • DSet CloudFront to modify the distribution origin after the artifacts have been deployed to Amazon S3.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Set CloudFront to invalidate the cache after the artifacts have been deployed to Amazon S3.

Explanation

Amazon S3 provides durable, scalable object storage that is fully managed. Amazon CloudFront caches content at edge locations to reduce latency and offload origins.

Topic 1 Β· Question 391

A company has a development team that uses AWS CodeCommit for version control. The development team has CodeCommit repositories in multiple AWS accounts. The team is expanding to include developers who work in various locations. The company must ensure that the developers have secure access to the repositories. Which solution will meet these requirements in the MOST operationally efficient way?

  • AConfigure IAM roles for each developer and grant access individually.
  • BConfigure permission sets in AWS IAM Identity Center to grant access to the accounts. (correct answer)
  • CShare AWS access keys with the development team for direct repository access.
  • DUse public SSH keys for authentication to the CodeCommit repositories.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Configure permission sets in AWS IAM Identity Center to grant access to the accounts.

Explanation

AWS IAM controls authenticated and authorized access to AWS resources with fine-grained policies. AWS IAM Identity Center (SSO) centrally manages workforce access to multiple accounts and apps. AWS Config tracks resource configuration changes and evaluates compliance.

Topic 1 Β· Question 392

A developer received the following error message during an AWS CloudFormation deployment: DELETE_FAILED (The following resource(s) failed to delete: [ASGInstanceRole12345678].) Which action should the developer take to resolve this error?

  • AContact AWS Support to report an issue with the Auto Scaling Groups (ASG) service.
  • BAdd a DependsOn attribute to the ASGInstanceRole12345678 resource in the CloudFormation template. Then delete the stack.
  • CModify the CloudFormation template to retain the ASGInstanceRole12345678 resource. Then manually delete the resource after deployment. (correct answer)
  • DAdd a force parameter when calling CloudFormation with the role-arn of ASGInstanceRole12345678.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Modify the CloudFormation template to retain the ASGInstanceRole12345678 resource. Then manually delete the resource after deployment.

Explanation

AWS CloudFormation provisions infrastructure as code repeatably.

Topic 1 Β· Question 393

A company runs a critical application on Amazon Elastic Container Service (Amazon ECS) by using Amazon EC2 instances. The company needs to migrate the application to Amazon ECS on AWS Fargate. A developer is configuring Fargate and the ECS capacity providers to make the change. Which solution will meet these requirements with the LEAST downtime during migration?

  • AUse the PutClusterCapacityProviders API operation to associate the ECS cluster with the FARGATE and FARGATE_SPOT capacity provider strategies. Use FARGATE as Provider 1 with a base value. Use FARGATE_SPOT as Provider 2 for failover. (correct answer)
  • BUse the CreateCapacityProvider API operation to associate the ECS cluster with the FARGATE and FARGATE_SPOT capacity provider strategies. Use FARGATE as Provider 1 with a base value. Use FARGATE_SPOT as Provider 2 for failover.
  • CUse the PutClusterCapacityProviders API operation to associate the ECS cluster with the FARGATE and FARGATE_SPOT capacity provider strategies. Use FARGATE_SPOT as Provider 1 with a base value. Use FARGATE as Provider 2 for failover.
  • DUse the CreateCapacityProvider API operation to associate the ECS cluster with the FARGATE and FARGATE_SPOT capacity provider strategies. Use FARGATE_SPOT as Provider 1 with a base value. Use FARGATE as Provider 2 for failover.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Use the PutClusterCapacityProviders API operation to associate the ECS cluster with the FARGATE and FARGATE_SPOT capacity provider strategies. Use FARGATE as Provider 1 with a base value. Use FARGATE_SPOT as Provider...

Explanation

AWS Fargate runs containers serverlessly so there are no EC2 hosts to manage or patch. Amazon ECS orchestrates containers and integrates natively with AWS networking and IAM.

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

A company has a web application that is hosted on AWS. The application is behind an Amazon CloudFront distribution. A developer needs a dashboard to monitor error rates and anomalies of the CloudFront distribution as frequently as possible. Which combination of steps should the developer take to meet these requirements? (Choose two.)

  • AStream the CloudFront distribution logs to an Amazon S3 bucket. Detect anomalies and error rates by using Amazon Athena.
  • BEnable real-time logs on the CloudFront distribution. Create a data stream in Amazon Kinesis Data Streams. (correct answer)
  • CSet up Amazon Kinesis Data Streams to send the logs to Amazon OpenSearch Service by using an AWS Lambda function. Make a dashboard in OpenSearch Dashboards. (correct answer)
  • DStream the CloudFront distribution logs to Amazon Kinesis Data Firehose.
  • ESet up Amazon Kinesis Data Firehose to send the logs to AWS CloudTrail. Create CloudTrail metrics, alarms, and dashboards.
Reveal answer & explanation
Correct answer: B, C

The correct answer is B, C. Option B: Enable real-time logs on the CloudFront distribution. Create a data stream in Amazon Kinesis Data Streams. Option C: Set up Amazon Kinesis Data Streams to send the logs to Amazon OpenSearch Service by using an AWS Lambda function. Make a dashboard in OpenSearch Dashboards.

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. Amazon CloudFront caches content at edge locations to reduce latency and offload origins.

Topic 1 Β· Question 395

A developer creates an Amazon DynamoDB table. The table has OrderID as the partition key and NumberOfItemsPurchased as the sort key. The data type of the partition key and the sort key is Number. When the developer queries the table, the results are sorted by NumberOfItemsPurchased in ascending order. The developer needs the query results to be sorted by NumberOfItemsPurchased in descending order. Which solution will meet this requirement?

  • ACreate a local secondary index (LSI) on the NumberOfItemsPurchased sort key.
  • BChange the sort key from NumberOfItemsPurchased to NumberOfItemsPurchasedDescending.
  • CIn the Query operation, set the ScanIndexForward parameter to false. (correct answer)
  • DIn the Query operation, set the KeyConditionExpression parameter to false.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: In the Query operation, set the ScanIndexForward parameter to false.

Topic 1 Β· Question 396

A developer needs to use a code template to create an automated deployment of an application onto Amazon EC2 instances. The template must be configured to repeat deployment, installation, and updates of resources for the application. The template must be able to create identical environments and roll back to previous versions. Which solution will meet these requirements?

  • AUse AWS Amplify for automatic deployment templates. Use a traffic-splitting deployment to copy any deployments. Modify any resources created by Amplify, if necessary.
  • BUse AWS CodeBuild for automatic deployment. Upload the required AppSpec file template. Save the appspec.yml file in the root directory folder of the revision. Specify the deployment group that includes the EC2 instances for the deployment.
  • CUse AWS CloudFormation to create an infrastructure template in JSON format to deploy the EC2 instances. Use CloudFormation helper scripts to install the necessary software and to start the application. Call the scripts directly from the template. (correct answer)
  • DUse AWS AppSync to deploy the application. Upload the template as a GraphQL schema. Specify the EC2 instances for deployment of the application. Use resolvers as a version control mechanism and to make any updates to the deployments.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Use AWS CloudFormation to create an infrastructure template in JSON format to deploy the EC2 instances. Use CloudFormation helper scripts to install the necessary software and to start the application. Call the script...

Explanation

Amazon EC2 provides resizable virtual servers when you need full control of the operating system. AWS CloudFormation provisions infrastructure as code repeatably.

Topic 1 Β· Question 397

A developer has a continuous integration and continuous delivery (CI/CD) pipeline that uses AWS CodeArtifact and AWS CodeBuild. The build artifacts are between 0.5 GB and 1.5 GB in size. The builds happen frequently and retrieve many dependencies from CodeArtifact each time. The builds have been slow because of the time it takes to transfer dependencies. The developer needs to improve build performance by reducing the number of dependencies that are retrieved for each build. Which solution will meet this requirement?

  • ASpecify an Amazon S3 cache in CodeBuild. Add the S3 cache folder path to the buildspec.yaml file for the build project.
  • BSpecify a local cache in CodeBuild. Add the CodeArtifact repository name to the buildspec.yaml file for the build project.
  • CSpecify a local cache in CodeBuild. Add the cache folder path to the buildspec.yaml file for the build project. (correct answer)
  • DRetrieve the buildspec.yaml file directly from CodeArtifact. Add the CodeArtifact repository name to the buildspec.yaml file for the build project.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Specify a local cache in CodeBuild. Add the cache folder path to the buildspec.yaml file for the build project.

Explanation

AWS CodeBuild compiles, tests and packages code in a managed build service.

Topic 1 Β· Question 398

A company that has large online business uses an Amazon DynamoDB table to store sales data. The company enabled Amazon DynamoDB Streams on the table. The transaction status of each sale is stored in a TransactionStatus attribute in the table. The value of the TransactionStatus attribute must be either failed, pending, or completed. The company wants to be notified of failed sales where the Price attribute is above a specific threshold. A developer needs to set up notification for the failed sales. Which solution will meet these requirements with the LEAST development effort?

  • ACreate an event source mapping between DynamoDB Streams and an AWS Lambda function. Use Lambda event filtering to trigger the Lambda function only if sales fail when the price is above the specified threshold. Configure the Lambda function to publish the data to an Amazon Simple Notification Service (Amazon SNS) topic. (correct answer)
  • BCreate an event source mapping between DynamoDB Streams and an AWS Lambda function. Configure the Lambda function handler code to publish to an Amazon Simple Notification Service (Amazon SNS) topic if sales fail when price is above the specified threshold.
  • CCreate an event source mapping between DynamoDB Streams and an Amazon Simple Notification Service (Amazon SNS) topic. Use event filtering to publish to the SNS topic if sales fail when the price is above the specified threshold.
  • DCreate an Amazon CloudWatch alarm to monitor the DynamoDB Streams sales data. Configure the alarm to publish to an Amazon Simple Notification Service (Amazon SNS) topic if sales fail due when price is above the specified threshold.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Create an event source mapping between DynamoDB Streams and an AWS Lambda function. Use Lambda event filtering to trigger the Lambda function only if sales fail when the price is above the specified threshold. Configu...

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. Amazon SNS is a managed pub/sub service for fan-out notifications to many subscribers. This option needs the least custom development effort.

Topic 1 Β· Question 399

An AWS Lambda function is invoked asynchronously to process events. Occasionally, the Lambda function falls to process events. A developer needs to collect and analyze these failed events to fix the issue. What should the developer do to meet these requirements with the LEAST development effort?

  • AAdd logging statements for all events in the Lambda function. Filter AWS CloudTrail logs for errors.
  • BConfigure the Lambda function to start an AWS Step Functions workflow with retries for failed events.
  • CAdd a dead-letter queue to send messages to an Amazon Simple Queue Service (Amazon SQS) standard queue. (correct answer)
  • DAdd a dead-letter queue to send messages to an Amazon Simple Notification Service (Amazon SNS) FIFO topic.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Add a dead-letter queue to send messages to an Amazon Simple Queue Service (Amazon SQS) standard queue.

Explanation

Amazon SQS is a fully managed message queue that decouples components and absorbs traffic spikes. This option decouples the components so they scale independently and absorb load spikes.

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

A company has an application that uses an Amazon S3 bucket for object storage. A developer needs to configure in-transit encryption for the S3 bucket. All the S3 objects containing personal data needs to be encrypted at rest with AWS Key Management Service (AWS KMS) keys, which can be rotated on demand. Which combination of steps will meet these requirements? (Choose two.)

  • AWrite an S3 bucket policy to allow only encrypted connections over HTTPS by using permissions boundary.
  • BConfigure an S3 bucket policy to enable client-side encryption for the objects containing personal data by using an AWS KMS customer managed key.
  • CConfigure the application to encrypt the objects by using an AWS KMS customer managed key before uploading the objects containing personal data to Amazon S3. (correct answer)
  • DWrite an S3 bucket policy to allow only encrypted connections over HTTPS by using the aws:SecureTransport condition. (correct answer)
  • EConfigure S3 Block Public Access settings for the S3 bucket to allow only encrypted connections over HTTPS.
Reveal answer & explanation
Correct answer: C, D

The correct answer is C, D. Option C: Configure the application to encrypt the objects by using an AWS KMS customer managed key before uploading the objects containing personal data to Amazon S3. Option D: Write an S3 bucket policy to allow only encrypted connections over HTTPS by using the aws:SecureTransport condition.

Explanation

Amazon S3 provides durable, scalable object storage that is fully managed. AWS KMS manages encryption keys and integrates with most AWS services for encryption at rest. AWS Config tracks resource configuration changes and evaluates compliance.

Showing questions 381–400 of 557 Β· Page 20 of 28