Skip to main content

DOP-C02 Real Exam Questions

AWS Certified DevOps Engineer - Professional (DOP-C02)

461 questions available · Page 1 of 47

Updated Exam DumpsVerified AnswersPass Guarantee

Get Complete Exam Dumps
Question 1 Single choice

A DevOps engineer is building a solution that uses Amazon Simple Queue Service (Amazon SQS) standard queues. The solution also includes an AWS Lambda function and an Amazon DynamoDB table.
The Lambda function pulls content from an SQS queue event source and writes the content to the DynamoDB table.

The solution must maximize the scalability of Lambda and must prevent successfully processed SQS messages from being processed multiple times.

Which solution will meet these requirements?

  1. A

    Decrease the batch window to 1 second when configuring the Lambda function's event source mapping.

  2. B

    Decrease the batch size to 1 when configuring the Lambda function's event source mapping.

  3. C

    Include the ReportBatchItemFailures value in the FunctionResponseTypes list in the Lambda function's
    event source mapping.

  4. D

    Set the queue visibility timeout on the Lambda function's event source mapping to account for invocation throttling of the Lambda function.

Show answer and explanation

Correct answer: C

Explanation

C is correct. We need ReportBatchItemFailures to return only failed items
A: batch window is the interval process time
B: batch size is the size of the job
D: queue visibility timeout is about re-process

Question 2 Single choice

Which tool will Ansible not use, even if available, to gather facts?

  1. A

    facter

  2. B

    lsb_release

  3. C

    Ansible setup module

  4. D

    ohai

Show answer and explanation

Correct answer: B

Explanation

Ansible will use its own `setup' module to gather facts for the local system. Additionally, if ohai or facter are installed, those will also be used and all variables will be prefixed with `ohai_' or `facter_' respectively.
`lsb_relase' is a Linux tool for determining distribution information.

References:
http://docs.ansible.com/ansible/setup_module.html

Question 3 Single choice

A company has a single Developer writing code for an automated deployment pipeline. The Developer is storing source code in an Amazon S3 bucket for each project. The company wants to add more Developers to the team but is concerned about code conflicts and lost work. The company also wants to build a test environment to deploy newer versions of code for testing and allow Developers to automatically deploy to both environments when code is changed in the repository.

What is the MOST efficient way to meet these requirements?

  1. A

    Create an AWS CodeCommit repository for each project, use the main branch for production code, and create a testing branch for code deployed to testing. Use feature branches to develop new features and pull requests to merge code to testing and main branches.

  2. B

    Create another S3 bucket for each project for testing code, and use an AWS Lambda function to promote code changes between testing and production buckets. Enable versioning on all buckets to prevent code conflicts.

  3. C

    Create an AWS CodeCommit repository for each project, and use the main branch for production and test code with different deployment pipelines for each environment. Use feature branches to develop new features.

  4. D

    Enable versioning and branching on each S3 bucket, use the main branch for production code, and create a testing branch for code deployed to testing. Have Developers use each branch for developing in each environment.

Show answer and explanation

Correct answer: A

Question 4 Single choice

A company has a single AWS account that runs hundreds of Amazon EC2 instances in a single AWS Region. New EC2 instances are launched and terminated each hour in the account. The account also includes existing EC2 instances that have been running for longer than a week.

The company's security policy requires all running EC2 instances to use an EC2 instance profile. If an EC2 instance does not have an instance profile attached, the EC2 instance must use a default instance profile that has no IAM permissions assigned.

A DevOps engineer reviews the account and discovers EC2 instances that are running without an instance profile. During the review, the DevOps engineer also observes that new EC2 instances are being launched without an instance profile.

Which solution will ensure that an instance profile is attached to all existing and future EC2 instances in the Region?

  1. A

    Configure an Amazon EventBridge rule that reacts to EC2 RunInstances API calls.
    Configure the rule to invoke an AWS Lambda function to attach the default instance profile to the EC2 instances.

  2. B

    Configure the ec2-instance-profile-attached AWS Config managed rule with a trigger type of configuration changes.
    Configure an automatic remediation action that invokes an AWS Systems Manager Automation runbook to attach the default instance profile to the EC2 instances.

  3. C

    Configure an Amazon EventBridge rule that reacts to EC2 StartInstances API calls.
    Configure the rule to invoke an AWS Systems Manager Automation runbook to attach the default instance profile to the EC2 instances.

  4. D

    Configure the iam-role-managed-policy-check AWS Config managed rule with a trigger type of configuration changes.
    Configure an automatic remediation action that invokes an AWS Lambda function to attach the default instance profile to the EC2 instances.

Show answer and explanation

Correct answer: B

Explanation

https://docs.aws.amazon.com/config/latest/developerguide/ec2-instance-profile-attached.html

Question 5 Multiple choice

A company has multiple member accounts that are part of an organization in AWS Organizations. The security team needs to review every Amazon EC2 security group and their inbound and outbound rules.
The security team wants to programmatically retrieve this information from the member accounts using an AWS Lambda function in the management account of the organization.

Which combination of access changes will meet these requirements? (Choose three.)

  1. A

    Create a trust relationship that allows users in the member accounts to assume the management account IAM role.

  2. B

    Create a trust relationship that allows users in the management account to assume the IAM roles of the member accounts.

  3. C

    Create an IAM role in each member account that has access to the AmazonEC2ReadOnlyAccess managed policy.

  4. D

    Create an I AM role in each member account to allow the sts:AssumeRole action against the
    management account IAM role's ARN.

  5. E

    Create an I AM role in the management account that allows the sts:AssumeRole action against the
    member account IAM role's ARN.

  6. F

    Create an IAM role in the management account that has access to the AmazonEC2ReadOnlyAccess managed policy.

Show answer and explanation

Correct answers: B, C, E

Explanation

https://aws.amazon.com/premiumsupport/knowledge-center/lambda-function-assume-iam-role/
https://kreuzwerker.de/post/aws-multi-account-setups-reloaded

Question 6 Multiple choice

A company has application code in an AWS CodeConnections compatible Git repository. The company wants to configure unit tests to run when pull requests are opened. The company wants to ensure that the test status is visible in pull requests when the tests are completed. The company wants to save output data files that the tests generate to an Amazon S3 bucket after the tests are finished.

Which combination of solutions will meet these requirements? (Select THREE.)

  1. A

    Create an IAM service role to allow access to the resources that are required to run the tests.

  2. B

    Create a pipeline in AWS CodePipeline that has a test stage. Create a trigger to run the pipeline when pull requests are created or updated. Add a source action to report test results.

  3. C

    Create an AWS CodeBuild project to run the tests. Enable webhook triggers to run the tests when pull requests are created or updated. Enable build status reporting to report test results.

  4. D

    Create a buildspec.yml file that has a reports section to upload output files when the tests have finished running.

  5. E

    Create a buildspec.yml file that has an artifacts section to upload artifacts when the tests have finished running.

  6. F

    Create an appspec.yml file that has a files section to upload output files when the tests have finished running.

Show answer and explanation

Correct answers: A, C, E

Question 7 Single choice

A media company has several thousand Amazon EC2 instances in an AWS account. The company is using Slack and a shared email inbox for team communications and important updates. A DevOps engineer needs to send all AWS-scheduled EC2 maintenance notifications to the Slack channel and the shared inbox. The solution must include the instances' Name and Owner tags.

Which solution will meet these requirements?

  1. A

    Integrate AWS Trusted Advisor with AWS Config Configure a custom AWS Config rule to invoke an AWS Lambda function to publish notifications to an Amazon Simple Notification Service (Amazon SNS) topic Subscribe a Slack channel endpoint and the shared inbox to the topic.

  2. B

    Use Amazon EventBridge to monitor for AWS Health Events Configure the maintenance events to target an Amazon Simple Notification Service (Amazon SNS) topic Subscribe an AWS Lambda function to the SNS topic to send notifications to the Slack channel and the shared inbox.

  3. C

    Create an AWS Lambda function that sends EC2 maintenance notifications to the Slack channel and the shared inbox Monitor EC2 health events by using Amazon CloudWatch metrics Configure a CloudWatch alarm that invokes the Lambda function when a maintenance notification is received.

  4. D

    Configure AWS Support integration with AWS CloudTrail Create a CloudTrail lookup event to invoke an AWS Lambda function to pass EC2 maintenance notifications to Amazon Simple Notification Service (Amazon SNS) Configure Amazon SNS to target the Slack channel and the shared inbox.

Show answer and explanation

Correct answer: B

Explanation

https://docs.aws.amazon.com/health/latest/ug/cloudwatch-events-health.html

Question 8 Multiple choice

A company deploys its corporate infrastructure on AWS across multiple AWS Regions and Availability Zones. The infrastructure is deployed on Amazon EC2 instances and connects with AWS loT Greengrass devices. The company deploys additional resources on on-premises servers that are located in the corporate headquarters.

The company wants to reduce the overhead involved in maintaining and updating its resources. The company's DevOps team plans to use AWS Systems Manager to implement automated management and application of patches. The DevOps team confirms that Systems Manager is available in the Regions that the resources are deployed m Systems Manager also is available in a Region near the corporate headquarters.

Which combination of steps must the DevOps team take to implement automated patch and configuration management across the company's EC2 instances loT devices and on-premises infrastructure? (Select THREE.)

  1. A

    Apply tags lo all the EC2 instances. AWS loT Greengrass devices, and on-premises servers. Use Systems Manager Session Manager to push patches to all the tagged devices.

  2. B

    Use Systems Manager Run Command to schedule patching for the EC2 instances AWS loT Greengrass devices and on-premises servers.

  3. C

    Use Systems Manager Patch Manager to schedule patching loT the EC2 instances AWS loT Greengrass devices and on-premises servers as a Systems Manager maintenance window task.

  4. D

    Configure Amazon EventBridge to monitor Systems Manager Patch Manager for updates to patch baselines. Associate Systems Manager Run Command with the event lo initiate a patch action for all EC2 instances AWS loT Greengrass devices and on-premises servers.

  5. E

    Create an IAM instance profile for Systems Manager Attach the instance profile to all the EC2 instances in the AWS account. For the AWS loT Greengrass devices and on-premises servers create an IAM service role for Systems Manager.

  6. F

    Generate a managed-instance activation Use the Activation Code and Activation ID to install Systems Manager Agent (SSM Agent) on each server in the on-premises environment Update the AWS loT Greengrass IAM token exchange role Use the role to deploy SSM Agent on all the loT devices.

Show answer and explanation

Correct answers: C, E, F

Explanation

https://aws.amazon.com/blogs/mt/how-to-centrally-manage-aws-iot-greengrass-devices-using-aws-systems-manager/?force_isolation=true

Question 9 Multiple choice

A company is developing an application that will generate log events. The log events consist of five distinct metrics every one tenth of a second and produce a large amount of data The company needs to configure the application to write the logs to Amazon Time stream The company will configure a daily query against the Timestream table.

Which combination of steps will meet these requirements with the FASTEST query performance? (Select THREE.)

  1. A

    Use batch writes to write multiple log events in a Single write operation

  2. B

    Write each log event as a single write operation

  3. C

    Treat each log as a single-measure record

  4. D

    Treat each log as a multi-measure record

  5. E

    Configure the memory store retention period to be longer than the magnetic store retention period

  6. F

    Configure the memory store retention period to be shorter than the magnetic store retention period

Show answer and explanation

Correct answers: A, D, F

Explanation

A comprehensive and detailed explanation is: Option A is correct because using batch writes to write multiple log events in a single write operation is a recommended practice for optimizing the performance and cost of data ingestion in Timestream. Batch writes can reduce the number of network round trips and API calls, and can also take advantage of parallel processing by Timestream. Batch writes can also improve the compression ratio of data in the memory store and the magnetic store, which can reduce the storage costs and improve the query performance 1.
Option B is incorrect because writing each log event as a single write operation is not a recommended practice for optimizing the performance and cost of data ingestion in Timestream. Writing each log event as a single write operation would increase the number of network round trips and API calls, and would also reduce the compression ratio of data in the memory store and the magnetic store. This would increase the storage costs and degrade the query performance 1.
Option C is incorrect because treating each log as a single-measure record is not a recommended practice for optimizing the query performance in Timestream. Treating each log as a single-measure record would result in creating multiple records for each timestamp, which would increase the storage size and the query latency. Moreover, treating each log as a single-measure record would require using joins to query multiple measures for the same timestamp, which would add complexity and overhead to the query processing 2.
Option D is correct because treating each log as a multi-measure record is a recommended practice for optimizing the query performance in Timestream. Treating each log as a multi-measure record would result in creating a single record for each timestamp, which would reduce the storage size and the query latency.
Moreover, treating each log as a multi-measure record would allow querying multiple measures for the same timestamp without using joins, which would simplify and speed up the query processing 2.
Option E is incorrect because configuring the memory store retention period to be longer than the magnetic store retention period is not a valid option in Timestream. The memory store retention period must always be shorter than or equal to the magnetic store retention period. This ensures that data is moved from the memory store to the magnetic store before it expires out of the memory store 3.
Option F is correct because configuring the memory store retention period to be shorter than the magnetic store retention period is a valid option in Timestream. The memory store retention period determines how long data is kept in the memory store, which is optimized for fast point-in-time queries. The magnetic store retention period determines how long data is kept in the magnetic store, which is optimized for fast analytical queries. By configuring these retention periods appropriately, you can balance your storage costs and query performance according to your application needs 3.
References:
1: Batch writes
2: Multi-measure records vs. single-measure records
3: Storage

Question 10 Single choice

When writing custom Ansible modules, which language is not supported?

  1. A

    Python

  2. B

    C++

  3. C

    Bash

  4. D

    All of the languages listed are supported

Show answer and explanation

Correct answer: D

Explanation

Ansible modules can be written in any language that is executable on the target system. The only requirement is that the module can write its results as JSON output to STDOUT for Ansible to consume.

References:
http://docs.ansible.com/ansible/developing_modules.html