A company is migrating from its on-premises data center to AWS. The company currently
uses a custom on-premises CI/CD pipeline solution to build and package software.
The company wants its software packages and dependent public repositories to be
available in AWS CodeArtifact to facilitate the creation of application-specific pipelines.
Which combination of steps should the company take to update the CI/CD pipeline solution
and to configure CodeArtifact with the LEAST operational overhead? (Select TWO.)
Show answerHide answer
Correct answer: B, DCreate an AWS Identity and Access Management Roles Anywhere trust anchor Create
an 1AM role that allows CodeArtifact actions and that has a trust relationship on the trust
anchor. Update the on-premises CI/CD pipeline to assume the new 1AM role and to
publish the packages to CodeArtifact.For each public repository, create a CodeArtifact repository that is configured with an
external connection Configure the dependent repositories as upstream public repositories.
Explanation
Explanation:
Create an AWS Identity and Access Management Roles Anywhere trust anchor Create an
IAM role that allows CodeArtifact actions and that has a trust relationship on the trust
anchor. Update the on-premises CI/CD pipeline to assume the new IAM role and to publish
the packages to CodeArtifact:
Roles Anywhere allows on-premises servers to assume IAM roles, making it easier
to integrate on-premises environments with AWS services.
Steps:
Create a new Amazon S3 bucket. Generate a presigned URL that allows the PutObject
request. Update the on-premises CI/CD pipeline to use the presigned URL to publish the
packages from the on-premises location to the S3 bucket. Create an AWS Lambda function
that runs when packages are created in the bucket through a put command Configure the
Lambda function to publish the packages to CodeArtifact:
Using an S3 bucket as an intermediary, you can easily upload packages from onpremises
systems.
Steps:
Question 52Choose 1
A company hosts its staging website using an Amazon EC2 instance backed with Amazon
EBS storage. The company wants to recover quickly with minimal data losses in the event
of network connectivity issues or power failures on the EC2 instance.
Which solution will meet these requirements?
Show answerHide answer
Correct answer: CCreate an Amazon CloudWatch alarm for the StatusCheckFailed System metric and
select the EC2 action to recover the instance.
Question 53Choose 1
A DevOps learn has created a Custom Lambda rule in AWS Config. The rule monitors
Amazon Elastic Container Repository (Amazon ECR) policy statements for ecr:' actions.
When a noncompliant repository is detected, Amazon EventBridge uses Amazon Simple
Notification Service (Amazon SNS) to route the notification to a security team.
When the custom AWS Config rule is evaluated, the AWS Lambda function fails to run.
Which solution will resolve the issue?
Show answerHide answer
Correct answer: AModify the Lambda function's resource policy to grant AWS Config permission to invoke
the function.
Explanation
Explanation: Step 1: Understanding Lambda Permissions and AWS ConfigThe
custom AWS Config rule evaluates resources and invokes an AWS Lambda function when
a compliance check is triggered. For AWS Config to invoke the Lambda function, it requires
permission to do so.
Issue:The Lambda function fails to execute because AWS Config doesn't have
permission to invoke it.
Action:Modify the resource-based policy of the Lambda function to grant AWS
Config permission to invoke the Lambda function.
Why:Without this permission, AWS Config cannot trigger the Lambda function,
which is why the evaluation fails.
Question 54Choose 2
A company recently deployed its web application on AWS. The company is preparing for a
large-scale sales event and must ensure that the web application can scale to meet the
demand
The application's frontend infrastructure includes an Amazon CloudFront distribution that
has an Amazon S3 bucket as an origin. The backend infrastructure includes an Amazon
API Gateway API. several AWS Lambda functions, and an Amazon Aurora DB cluster
The company's DevOps engineer conducts a load test and identifies that the Lambda
functions can fulfill the peak number of requests However, the DevOps engineer notices
request latency during the initial burst of requests Most of the requests to the Lambda
functions produce queries to the database A large portion of the invocation time is used to
establish database connections
Which combination of steps will provide the application with the required scalability? (Select
TWO)
Show answerHide answer
Correct answer: B, EConfigure a higher provisioned concurrency for the Lambda functionsUse Amazon RDS Proxy to create a proxy for the Aurora database Update the Lambda
functions to use the proxy endpoints for database connections.
Explanation
Explanation:
The correct answer is B and E. Configuring a higher provisioned concurrency for the
Lambda functions will ensure that the functions are ready to respond to the initial burst of
requests without any cold start latency. Using Amazon RDS Proxy to create a proxy for the
Aurora database will enable the Lambda functions to reuse existing database connections
and reduce the overhead of establishing new ones. This will also improve the scalability
and availability of the database by managing the connection pool size and handling
failovers. Option A is incorrect because reserved concurrency only limits the number of
concurrent executions for a function, not pre-warms them. Option C is incorrect because
converting the DB cluster to an Aurora global database will not address the issue of
database connection latency, and may introduce additional costs and complexity. Option D
is incorrect because moving the code blocks that initialize database connections into the
function handlers will not improve the performance or scalability of the Lambda functions,
and may actually worsen the cold start latency.
Question 55Choose 1
A development team uses AWS CodeCommit, AWS CodePipeline, and AWS CodeBuild to
develop and deploy an application. Changes to the code are submitted by pull requests.
The development team reviews and merges the pull requests, and then the pipeline builds
and tests the application.
Over time, the number of pull requests has increased. The pipeline is frequently blocked
because of failing tests. To prevent this blockage, the development team wants to run the
unit and integration tests on each pull request before it is merged.
Which solution will meet these requirements?
Show answerHide answer
Correct answer: BCreate an Amazon EventBridge rule to match pullRequestCreated events from
CodeCommit Create a CodeBuild project to run the unit and integration tests. Configure the
CodeBuild project as a target of the EventBridge rule that includes a custom event payload with the CodeCommit repository and branch information from the event.
Question 56Choose 1
A DevOps engineer is building a multistage pipeline with AWS CodePipeline to build, verify,
stage, test, and deploy an application. A manual approval stage is required between the
test stage and the deploy stage. The development team uses a custom chat tool with
webhook support that requires near-real-time notifications.
How should the DevOps engineer configure status updates for pipeline activity and
approval requests to post to the chat tool?
Show answerHide answer
Correct answer: CCreate an Amazon EventBridge rule that filters on CodePipeline Pipeline Execution
State Change. Publish the events to an Amazon Simple Notification Service (Amazon SNS)
topic. Create an AWS Lambda function that sends event details to the chat webhook URL.
Subscribe the function to the SNS topic.
Question 57Choose 1
A company has many applications. Different teams in the company developed the
applications by using multiple languages and frameworks. The applications run on
premises and on different servers with different operating systems. Each team has its own
release protocol and process. The company wants to reduce the complexity of the release
and maintenance of these applications.
The company is migrating its technology stacks, including these applications, to AWS. The
company wants centralized control of source code, a consistent and automatic delivery
pipeline, and as few maintenance tasks as possible on the underlying infrastructure.
What should a DevOps engineer do to meet these requirements?
Show answerHide answer
Correct answer: DCreate one AWS CodeCommit repository for each of the applications. Use AWS
CodeBuild to build one Docker image for each application in Amazon Elastic Container
Registry (Amazon ECR). Use AWS CodeDeploy to deploy the applications to Amazon
Elastic Container Service (Amazon ECS) on infrastructure that AWS Fargate manages.
Explanation
Explanation: because of "as few maintenance tasks as possible on the underlying
infrastructure". Fargate does that better than "one centralized application server"
Question 58Choose 1
An IT team has built an AWS CloudFormation template so others in the company can
quickly and reliably deploy and terminate an application. The template creates an Amazon
EC2 instance with a user data script to install the application and an Amazon S3 bucket
that the application uses to serve static webpages while it is running.
All resources should be removed when the CloudFormation stack is deleted. However, the
team observes that CloudFormation reports an error during stack deletion, and the S3
bucket created by the stack is not deleted.
How can the team resolve the error in the MOST efficient manner to ensure that all
resources are deleted without errors?
Show answerHide answer
Correct answer: BAdd a custom resource with an AWS Lambda function with the DependsOn attribute
specifying the S3 bucket, and an IAM role. Write the Lambda function to delete all objects
from the bucket when RequestType is Delete.
Question 59Choose 1
A company runs a workload on Amazon EC2 instances. The company needs a control that
requires the use of Instance Metadata Service Version 2 (IMDSv2) on all EC2 instances in
the AWS account. If an EC2 instance does not prevent the use of Instance Metadata
Service Version 1 (IMDSv1), the EC2 instance must be terminated.
Which solution will meet these requirements?
Show answerHide answer
Correct answer: BCreate a permissions boundary that prevents the ec2:Runlnstance action if the
ec2:MetadataHttpTokens condition key is not set to a value of required. Attach the
permissions boundary to the IAM role that was used to launch the instance.
Explanation
Explanation:
To implement a control that requires the use of IMDSv2 on all EC2 instances in the
account, the DevOps engineer can use a permissions boundary. A permissions boundary
is a policy that defines the maximum permissions that an IAM entity can have. The DevOps
engineer can create a permissions boundary that prevents the ec2:RunInstance action if
the ec2:MetadataHttpTokens condition key is not set to a value of required. This condition
key enforces the use of IMDSv2 on EC2 instances. The DevOps engineer can attach the
permissions boundary to the IAM role that was used to launch the instance. This way, any
attempt to launch an EC2 instance without using IMDSv2 will be denied by the permissions
boundary.
Question 60Choose 3
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.)
Show answerHide answer
Correct answer: A, D, FUse batch writes to write multiple log events in a Single write operationTreat each log as a multi-measure recordConfigure the memory store retention period to be shorter than the magnetic store
retention period
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.