A company runs its container workloads in AWS App Runner. A DevOps engineer
manages the company's container repository in Amazon Elastic Container Registry
(Amazon ECR).
The DevOps engineer must implement a solution that continuously monitors the container repository. The solution must create a new container image when the solution detects an
operating system vulnerability or language package vulnerability.
Which solution will meet these requirements?
Show answerHide answer
Correct answer: AUse EC2 Image Builder to create a container image pipeline. Use Amazon ECR as the
target repository. Turn on enhanced scanning on the ECR repository. Create an Amazon
EventBridge rule to capture an Inspector2 finding event. Use the event to invoke the image
pipeline. Re-upload the container to the repository.
Explanation
Explanation:
The solution that meets the requirements is to use EC2 Image Builder to create a container
image pipeline, use Amazon ECR as the target repository, turn on enhanced scanning on
the ECR repository, create an Amazon EventBridge rule to capture an Inspector2 finding
event, and use the event to invoke the image pipeline. Re-upload the container to the
repository.
This solution will continuously monitor the container repository for vulnerabilities using
enhanced scanning, which is a feature of Amazon ECR that provides detailed information
and guidance on how to fix security issues found in your container images. Enhanced
scanning uses Inspector2, a security assessment service that integrates with Amazon ECR
and generates findings for any vulnerabilities detected in your images. You can use
Amazon EventBridge to create a rule that triggers an action when an Inspector2 finding
event occurs. The action can be to invoke an EC2 Image Builder pipeline, which is a
service that automates the creation of container images. The pipeline can use the latest
patches and updates to build a new container image and upload it to the same ECR
repository, replacing the vulnerable image.
The other options are not correct because they do not meet all the requirements or use
services that are not relevant for the scenario.
Option B is not correct because it uses Amazon GuardDuty Malware Protection, which is a
feature of GuardDuty that detects malicious activity and unauthorized behavior on your
AWS accounts and resources. GuardDuty does not scan container images for
vulnerabilities, nor does it integrate with Amazon ECR or EC2 Image Builder.
Option C is not correct because it uses basic scanning on the ECR repository, which only
provides a summary of the vulnerabilities found in your container images. Basic scanning
does not use Inspector2 or generate findings that can be captured by Amazon
EventBridge. Moreover, basic scanning does not provide guidance on how to fix the
vulnerabilities.
Option D is not correct because it uses AWS Systems Manager Compliance, which is a
feature of Systems Manager that helps you monitor and manage the compliance status of
your AWS resources based on AWS Config rules and AWS Security Hub standards.
Systems Manager Compliance does not scan container images for vulnerabilities, nor does
it integrate with Amazon ECR or EC2 Image Builder.
Question 32Choose 1
A development team is using AWS CodeCommit to version control application code and
AWS CodePipeline to orchestrate software deployments. The team has decided to use a
remote main branch as the trigger for the pipeline to integrate code changes. A developer
has pushed code changes to the CodeCommit repository, but noticed that the pipeline had
no reaction, even after 10 minutes.
Which of the following actions should be taken to troubleshoot this issue?
Show answerHide answer
Correct answer: ACheck that an Amazon EventBridge rule has been created for the main branch to trigger
the pipeline.
Explanation
Explanation: When you create a pipeline from CodePipeline during the step-by-step it
creates a CloudWatch Event rule for a given branch and repo like this:
To run an application, a DevOps engineer launches an Amazon EC2 instance with public
IP addresses in a public subnet. A user data script obtains the application artifacts and
installs them on the instances upon launch. A change to the security classification of the
application now requires the instances to run with no access to the internet. While the
instances launch successfully and show as healthy, the application does not seem to be
installed.
Which of the following should successfully install the application while complying with the
new rule?
Show answerHide answer
Correct answer: CPublish the application artifacts to an Amazon S3 bucket and create a VPC endpoint for
S3. Assign an IAM instance profile to the EC2 instances so they can read the application
artifacts from the S3 bucket.
Explanation
Explanation: EC2 instances running in private subnets of a VPC can now have controlled
access to S3 buckets, objects, and API functions that are in the same region as the VPC.
You can use an S3 bucket policy to indicate which VPCs and which VPC Endpoints have
access to your S3 buckets
Question 34Choose 2
A company is using AWS CodePipeline to deploy an application. According to a new
guideline, a member of the company's security team must sign off on any application
changes before the changes are deployed into production. The approval must be recorded
and retained.
Which combination of actions will meet these requirements? (Select TWO.)
Show answerHide answer
Correct answer: C, ECreate an AWS CloudTrail trail to deliver logs to Amazon S3.Create a CodePipeline manual approval action before the deployment step. Create a
policy that grants the security team access to approve manual approval stages.
Explanation
Explanation:
To meet the new guideline for application deployment, the company can use a combination
of AWS CodePipeline and AWS CloudTrail. A manual approval action in CodePipeline allows the security team to review and approve changes before they are deployed. This
action can be configured to pause the pipeline until approval is granted, ensuring that no
changes move to production without the necessary sign-off. Additionally, by creating an
AWS CloudTrail trail, all actions taken withinCodePipeline, including approvals, are
recorded and delivered to an Amazon S3 bucket. This provides an audit trail that can be
retained for compliance and review purposes.
Question 35Choose 1
A company has chosen AWS to host a new application. The company needs to implement
a multi-account strategy. A DevOps engineer creates a new AWS account and an
organization in AWS Organizations. The DevOps engineer also creates the OU structure
for the organization and sets up a landing zone by using AWS Control Tower.
The DevOps engineer must implement a solution that automatically deploys resources for
new accounts that users create through AWS Control Tower Account Factory. When a user
creates a new account, the solution must apply AWS CloudFormation templates and SCPs
that are customized for the OU or the account to automatically deploy all the resources that
are attached to the account. All the OUs are enrolled in AWS Control Tower.
Which solution will meet these requirements in the MOST automated way?
Show answerHide answer
Correct answer: DDeploy the Customizations for AWS Control Tower (CfCT) solution. Use an AWS
CodeCommit repository as the source. In the repository, create a custom package that
includes the CloudFormation templates and the SCP JSON documents.
Explanation
Explanation: The CfCT solution is designed for the exact purpose stated in the question. It
extends the capabilities of AWS Control Tower by providing you with a way to automate
resource provisioning and apply custom configurations across all AWS accounts created in
the Control Tower environment. This enables the company to implement additional account
customizations when new accounts are provisioned via the Control Tower Account Factory.
The CloudFormation templates and SCPs can be added to a CodeCommit repository and
will be automatically deployed to new accounts when they are created. This provides a
highly automated solution that does not require manual intervention to deploy resources
and SCPs to new accounts.
Question 36Choose 3
A DevOps engineer is building an application that uses an AWS Lambda function to query
an Amazon Aurora MySQL DB cluster. The Lambda function performs only read queries.
Amazon EventBridge events invoke the Lambda function.
As more events invoke the Lambda function each second, the database's latency
increases and the database's throughput decreases. The DevOps engineer needs to
improve the performance of the application.
Which combination of steps will meet these requirements? (Select THREE.)
Show answerHide answer
Correct answer: A, C, EUse Amazon RDS Proxy to create a proxy. Connect the proxy to the Aurora cluster
reader endpoint. Set a maximum connections percentage on the proxy.Implement the database connection opening outside the Lambda event handler code.Connect to the proxy endpoint from the Lambda function.
Question 37Choose 3
A company has an organization in AWS Organizations. The organization includes workload
accounts that contain enterprise applications. The company centrally manages users from
an operations account. No users can be created in the work load accounts. The company
recently added an operations team and must provide the operations team members with
administrator access to each workload account.
Which combination of actions will provide this access? (Choose three.)
Show answerHide answer
Correct answer: B, D, ECreate a SysAdmin role in each workload account. Attach the AdministratorAccess
policy to the role. Modify the trust relationship to allow the sts:AssumeRole action from the
operations account.In the operations account, create an IAM user for each operations team member.In the operations account, create an IAM user group that is named SysAdmins. Add an
IAM policy that allows the sts:AssumeRole action for the SysAdmin role in each workload
account. Add all operations team members to the group.
Question 38Choose 1
A production account has a requirement that any Amazon EC2 instance that has been
logged in to manually must be terminated within 24 hours. All applications in the production
account are using Auto Scaling groups with the Amazon CloudWatch Logs agent
configured.
How can this process be automated?
Show answerHide answer
Correct answer: DCreate a CloudWatch Logs subscription to an AWS Lambda function. Configure the
function to add a tag to the EC2 instance that produced the login event and mark the
instance to be decommissioned. Create an Amazon EventBridge rule to invoke a daily
Lambda function that terminates all instances with this tag.
Explanation
Explanation: "You can use subscriptions to get access to a real-time feed of log events
from CloudWatch Logs and have it delivered to other services such as an Amazon Kinesis stream, an Amazon Kinesis Data Firehose stream, or AWS Lambda for custom processing,
analysis, or loading to other systems. When log events are sent to the receiving service,
they are Base64 encoded and compressed with the gzip format."
Question 39Choose 1
A DevOps team uses AWS CodePipeline, AWS CodeBuild, and AWS CodeDeploy to
deploy an application. The application is a REST API that uses AWS Lambda functions and
Amazon API Gateway Recent deployments have introduced errors that have affected many
customers.
The DevOps team needs a solution that reverts to the most recent stable version of the
application when an error is detected. The solution must affect the fewest customers
possible.
Which solution Will meet these requirements With the MOST operational efficiency?
Show answerHide answer
Correct answer: BSet the deployment configuration in CodeDeploy to LambdaCanary10Percent10Minutes.
Configure automatic rollbacks on the deployment group Create an Amazon CloudWatch
alarm that detects HTTP Bad Gateway errors on API Gateway Configure the deployment
group toroll back when the number of alarms meets the alarm threshold
Question 40Choose 1
A software team is using AWS CodePipeline to automate its Java application release
pipeline The pipeline consists of a source stage, then a build stage, and then a deploy
stage. Each stage contains a single action that has a runOrder value of 1.
The team wants to integrate unit tests into the existing release pipeline. The team needs a
solution that deploys only the code changes that pass all unit tests.
Which solution will meet these requirements?
Show answerHide answer
Correct answer: BModify the build stage Add a test action that has a runOrder value of 2 Use AWS
CodeBuild as the action provider to run unit tests
Explanation
Explanation:
Modify the Build Stage to Add a Test Action with a RunOrder Value of 2:
The build stage in AWS CodePipeline can have multiple actions. By adding a test
action with a runOrder value of 2, the test action will execute after the initial build
action completes.
Use AWS CodeBuild as the Action Provider to Run Unit Tests:
AWS CodeBuild is a fully managed build service that compiles source code, runs
tests, and produces software packages.
Using CodeBuild to run unit tests ensures that the tests are executed in a
controlled environment and that only the code changes that pass the unit tests
proceed to the deploy stage.
By integrating the unit tests into the build stage and ensuring they run after the build
process, the pipeline guarantees that only code changes passing all unit tests are
deployed.
Full mock exam
Sit the DOP-C02 exam before exam day
Full-length mocks with the same number of questions and the same time limit as the real DOP-C02 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.