Courseiva

AWS Certified DevOps Engineer Professional DOP-C02 (DOP-C02) — Questions 451525

640 questions total · 9pages · All types, answers revealed

Page 6

Page 7 of 9

Page 8
451
MCQmedium

A DevOps team uses AWS CodePipeline to deploy a web application. Security scanning must be integrated into the pipeline to check for vulnerabilities before deployment to production. Which action should be taken?

A.Add an Amazon Inspector scan action as a test stage in the pipeline
B.Enable AWS GuardDuty in the account
C.Activate AWS Trusted Advisor for security checks
D.Use AWS Config rules to check for vulnerabilities
AnswerA

Amazon Inspector can scan for software vulnerabilities and is integrated with CodePipeline.

Why this answer

Amazon Inspector can be integrated as a test action in CodePipeline to scan for vulnerabilities. GuardDuty is a threat detection service, not a scanning tool for code or containers. Config evaluates resource configurations.

Trusted Advisor provides best practice checks, not vulnerability scanning.

452
MCQhard

During a deployment, a new application version on an ECS service starts failing health checks. The previous version is still running. The deployment is a rolling update with a 200% percent start. Which ECS feature should the engineer use to automatically revert to the previous version?

A.ECS deployment circuit breaker
B.ECS service auto recovery
C.ECS managed scaling
D.CloudWatch alarm actions
AnswerA

Circuit breaker automatically rolls back on deployment failure.

Why this answer

(ECS deployment circuit breaker) is correct because it automatically detects failed deployments (e.g., health check failures) and triggers a rollback to the previous version. With a 200% percent start rolling update, the new version starts before the old is stopped; if health checks fail, the circuit breaker initiates a rollback. Option B (ECS service auto recovery) recovers from underlying infrastructure failures, not deployment failures.

Option C (ECS managed scaling) adjusts desired count based on load, not deployment health. Option D (CloudWatch alarm actions) can trigger rollback events but is not an ECS built-in feature; it requires custom automation. Therefore, the correct ECS feature for automatic rollback is the deployment circuit breaker.

453
MCQeasy

A company wants to protect its S3 bucket data from accidental deletion or overwrite. Which feature should be enabled?

A.Enable cross-region replication
B.Apply a bucket policy that denies DeleteObject
C.Enable S3 Versioning
D.Enable MFA Delete
AnswerC

Preserves previous versions.

Why this answer

S3 Versioning is the primary feature that protects against accidental deletion and overwrite by preserving all versions of objects. When versioning is enabled, deleted objects are replaced with a delete marker and previous versions can be restored. MFA Delete (option D) is an additional security feature that requires multi-factor authentication for versioning operations, but versioning itself is the foundational protection.

Option A (cross-region replication) is used for geographic redundancy and compliance, not for protecting against accidental deletions. Option B (bucket policy denying DeleteObject) would prevent deletions but does not protect against overwrites (PutObject) and can be overly restrictive; also, it may not allow legitimate deletions if not carefully scoped. Therefore, enabling S3 Versioning is the correct and most straightforward solution.

454
Multi-Selectmedium

A company uses AWS Systems Manager to manage patching of EC2 instances. They want to ensure that instances in a specific Auto Scaling group are patched before being allowed to serve traffic. Which THREE steps should be part of the solution?

Select 3 answers
A.Create a new launch configuration with the patched AMI.
B.Update the Auto Scaling group to use the new launch configuration.
C.Deploy the patched version using AWS CodeDeploy.
D.Configure Amazon CloudWatch Events to trigger a Lambda function after patching.
E.Use an AWS Systems Manager Maintenance Window to apply patches to instances.
AnswersA, B, E

After patching, create a new AMI and launch configuration.

Why this answer

Options A, B, and E are correct. Option A creates a new launch configuration with the patched AMI, ensuring that new instances launched from it are patched. Option B updates the Auto Scaling group to use the new launch configuration, causing the group to replace existing instances with patched ones (via instance refresh or scale-in/out).

Option E uses an AWS Systems Manager Maintenance Window to apply patches to existing instances, which is necessary if you want to patch instances without replacing them entirely. Option C (CodeDeploy) is not appropriate for OS patching; it is used for application deployments. Option D (CloudWatch Events) could be used to automate the process but is not a required step for the core solution.

455
MCQeasy

A gaming company uses AWS Elastic Beanstalk to deploy a web application. The operations team needs to update environment configuration variables (e.g., database URL) without causing downtime. They want to change the value of an environment property. What is the CORRECT way to apply this change?

A.Update the environment properties in the Elastic Beanstalk console; the platform will perform a rolling update.
B.Terminate the environment and create a new one with the updated configuration.
C.Use an immutable update by deploying a new version with the changes.
D.Use AWS Lambda to directly modify the environment configuration without redeploying.
AnswerA

Elastic Beanstalk applies configuration changes via rolling updates without downtime.

Why this answer

Updating environment properties via the Elastic Beanstalk console or CLI triggers a rolling update of the environment instances, applying the new configuration without downtime. Option B (terminate and recreate) causes downtime. Option C (immutable update) is used for deploying new application versions, not for changing environment properties.

Option D (AWS Lambda) cannot directly modify Elastic Beanstalk environment configuration in a supported manner.

456
MCQeasy

A DevOps team is configuring CloudWatch alarms for their production environment. They want to receive notifications when the CPUUtilization metric of an EC2 instance exceeds 90% for three consecutive 5-minute periods. Which combination of settings should they use?

A.Period: 5 minutes; Evaluation periods: 3; Datapoints to alarm: 3
B.Period: 5 minutes; Evaluation periods: 3; Datapoints to alarm: 1
C.Period: 5 minutes; Evaluation periods: 1; Datapoints to alarm: 3
D.Period: 5 minutes; Evaluation periods: 5; Datapoints to alarm: 3
AnswerA

This configuration ensures three consecutive 5-minute periods exceed the threshold.

Why this answer

The evaluation period must be set to 3, and the datapoints to alarm must be 3 to require three consecutive periods. Option B is wrong because datapoints to alarm set to 1 would trigger on any single high reading. Option C is wrong because evaluation period 1 with datapoints 3 is impossible.

Option D is wrong because evaluation period 5 with datapoints 3 would require 3 out of 5, not necessarily consecutive.

457
MCQmedium

A company uses AWS Key Management Service (KMS) to encrypt data at rest in Amazon S3. The security team wants to ensure that only users with a specific attribute in their SAML assertion can decrypt the data. Which KMS key policy should be used?

A.Create an S3 bucket policy that denies kms:Decrypt unless the request includes a specific tag.
B.Modify the KMS key policy to include a condition that allows kms:Decrypt only if the SAML assertion contains the specific attribute.
C.Attach a resource-based policy to the S3 bucket that allows decryption only for users with the specific attribute.
D.Use an IAM policy that grants kms:Decrypt only if the user has the specific attribute.
AnswerB

KMS key policies can use conditions based on SAML attributes to control decryption.

Why this answer

KMS key policies can use the `kms:ViaService` or `kms:CallerPrincipal` conditions, but more importantly, they can reference SAML-based attributes using the `aws:PrincipalTag` or `saml:sub` conditions. By adding a condition in the KMS key policy that checks for a specific SAML assertion attribute (e.g., `saml:sub` or a custom SAML attribute mapped to an IAM role session tag), only users whose SAML assertion includes that attribute will be allowed to call `kms:Decrypt`. This directly enforces the security team's requirement at the key level, independent of S3 bucket policies or IAM policies.

Exam trap

The trap here is that candidates often confuse S3 bucket policies with KMS key policies, thinking they can control KMS decryption via S3 policies, when in reality KMS key policies are the only way to enforce conditions on the `kms:Decrypt` action at the key level.

How to eliminate wrong answers

Option A is wrong because S3 bucket policies cannot deny `kms:Decrypt`; KMS API calls are governed by KMS key policies and IAM policies, not S3 resource policies. Option C is wrong because S3 bucket policies control access to S3 operations (e.g., `s3:GetObject`), not KMS decryption permissions; they cannot enforce conditions on the KMS `Decrypt` action itself. Option D is wrong because IAM policies alone cannot enforce conditions based on SAML assertion attributes unless those attributes are first mapped to IAM session tags or roles; the requirement is to control decryption at the KMS key level, and a KMS key policy with a SAML condition is the direct and correct mechanism.

458
MCQmedium

A company runs a critical web application on EC2 instances behind an Application Load Balancer (ALB) with Auto Scaling. Users report intermittent 503 errors. CloudWatch metrics show that the ALB's 'RequestCount' is normal, but 'HTTPCode_ELB_5XX_Count' spikes. The 'TargetResponseTime' metric shows occasional high latency. Which troubleshooting step should the DevOps engineer take FIRST?

A.Enable and analyze the ALB access logs stored in S3, filtering for 503 errors and correlating with target response times.
B.Increase the desired capacity of the Auto Scaling group to handle more requests.
C.Disable connection draining on the target group to prevent slow-draining instances from causing errors.
D.Review AWS CloudTrail logs for any recent configuration changes to the ALB.
AnswerA

Access logs provide detailed per-request data including timestamp, target status, and response time, enabling correlation of errors with slow targets.

Why this answer

The correct first step is to enable and analyze ALB access logs (Option A). ALB access logs contain detailed information about each HTTP request, including the response status code (e.g., 503), target response time, and the specific target that handled the request. By filtering for 503 errors and correlating with high target response times, the engineer can identify whether the errors are caused by slow or failing targets.

Option B (increasing desired capacity) does not address the root cause and may not help if the issue stems from target health or configuration. Option C (disabling connection draining) can worsen the problem by abruptly terminating in-flight requests, increasing errors. Option D (reviewing CloudTrail logs) is not useful because CloudTrail captures API changes, not HTTP-level errors.

459
MCQhard

A key policy for a KMS customer managed key includes the above statement. An IAM role 'AdminRole' in account 123456789012 is allowed to decrypt. However, when the role attempts to decrypt data, it receives an access denied error. What is the MOST likely cause?

A.The action should be 'kms:Decrypt*'.
B.The resource should be the key ARN, not '*'.
C.The condition 'kms:GrantIsForAWSResource' is preventing direct API calls.
D.The principal ARN is incorrect.
AnswerC

This condition only allows decryption when the request comes from an AWS service, not from the IAM role directly.

Why this answer

The condition 'kms:GrantIsForAWSResource' restricts the permission to requests that come from AWS services that integrate with KMS (e.g., S3, Lambda) rather than direct API calls from the role. As a result, when the IAM role 'AdminRole' attempts to call kms:Decrypt directly, it receives an access denied error. Option C is correct.

Option A is incorrect because 'kms:Decrypt' is the correct action; wildcards are not needed. Option B is incorrect because the resource can be '*' in a key policy since the policy is attached to the key itself, scoping it automatically. Option D is incorrect because the principal ARN is correctly specified as the IAM role in the account.

460
Multi-Selectmedium

A company uses Amazon CloudWatch Synthetics canaries to monitor its web application endpoints. The canaries are failing intermittently with 'ClientError' status codes. Which TWO actions should the engineer take to diagnose the issue? (Choose two.)

Select 2 answers
A.Modify the canary script to add more logging.
B.Review the canary's CloudWatch Logs for error details.
C.Inspect the Lambda function logs associated with the canary.
D.Examine CloudWatch metrics for the canary.
E.Check CloudTrail for CanaryRun API calls.
AnswersB, C

Canary logs contain detailed output of each step.

Why this answer

CloudWatch Synthetics canaries automatically log execution details, including errors, to CloudWatch Logs. Reviewing these logs provides specific error information, such as 'ClientError' details. Option C is correct because each canary runs as an AWS Lambda function, and the Lambda function's CloudWatch Logs contain runtime logs, including any exceptions or errors thrown during execution.

Option A is incorrect because while adding logging could be a long-term improvement, the question asks for diagnostic actions; the canary already logs to CloudWatch Logs, so modifying the script is not necessary for diagnosis. Option D is incorrect because CloudWatch metrics provide aggregate statistics (e.g., success/failure rates) but not detailed error codes or messages. Option E is incorrect because CloudTrail records API calls to create, start, or stop canaries, not the execution details of individual canary runs.

461
MCQhard

Which AWS service is a fully managed source control service?

A.AWS CodeCommit
B.AWS CodeBuild
C.AWS CodeDeploy
D.AWS CodePipeline
E.AWS CloudFormation
F.Amazon EventBridge
AnswerA

AWS CodeCommit matches the description of a fully managed source control service.

Why this answer

AWS CodeCommit is a fully managed source control service that hosts Git repositories. It eliminates the need to manage your own source control system. AWS CodeBuild is a build service that compiles code, CodeDeploy automates deployments, CodePipeline orchestrates release pipelines, CloudFormation provides infrastructure as code, and EventBridge is a serverless event bus.

Exam trap

Some candidates confuse CodeCommit with CodeBuild or CodePipeline. Remember that CodeCommit specifically handles version control and source code management, not building or deployment.

462
Multi-Selecthard

A company is designing a secure CI/CD pipeline using AWS CodePipeline, CodeBuild, and CodeDeploy. The pipeline must deploy to an EC2 Auto Scaling group across multiple AWS accounts. The security requirements include: (1) no hardcoded credentials, (2) least privilege for cross-account access, (3) encrypted artifacts. Which THREE steps should the DevOps engineer implement? (Choose THREE.)

Select 3 answers
A.Use a customer-managed KMS key with a cross-account key policy to encrypt artifacts.
B.Store database credentials in AWS Secrets Manager and retrieve them in CodeBuild using the secrets manager action.
C.Store database credentials in AWS Systems Manager Parameter Store and retrieve them in CodeBuild.
D.Use AWS CodeCommit as the source repository with pull request approval rules.
E.Configure CodePipeline to assume an IAM role in the target account using a trust policy.
AnswersA, B, E

KMS cross-account key policies allow encryption across accounts.

Why this answer

Using a customer-managed KMS key with a cross-account key policy allows encrypting artifacts in CodePipeline's artifact store, ensuring that only authorized accounts can decrypt them, meeting the requirement for encrypted artifacts and least privilege. Option B is correct because storing database credentials in AWS Secrets Manager and retrieving them in CodeBuild using the secrets manager action avoids hardcoded credentials and provides secure, rotating credentials. Option E is correct because configuring CodePipeline to assume an IAM role in the target account using a trust policy enables cross-account deployment with least privilege, as the pipeline assumes a role with only necessary permissions.

Option C is incorrect because while SSM Parameter Store can store credentials, Secrets Manager is specifically designed for secrets management with automatic rotation and is more appropriate for database credentials. Option D is incorrect because CodeCommit with pull request approval rules is a source control practice, not directly addressing the security requirements of no hardcoded credentials, least privilege cross-account access, or encrypted artifacts.

463
Multi-Selecthard

A company uses DynamoDB global tables for a multi-region application. They notice that write conflicts are occurring. Which TWO strategies can reduce write conflicts?

Select 2 answers
A.Reduce read capacity units to limit concurrent reads
B.Enable DynamoDB Streams with last writer wins
C.Use conditional writes in the application code
D.Increase write capacity units on the table
E.Implement application-level conflict resolution
AnswersC, E

Prevents overwriting if condition fails.

Why this answer

Conditional writes prevent overwriting data unless a specified condition is met, thereby reducing write conflicts by ensuring that updates are only applied when the data is in a known state. Application-level conflict resolution allows the application to handle conflicts when they occur, using custom logic to merge or resolve differences, which reduces the impact of conflicts on the database. Option D (increasing write capacity) does not reduce conflicts; it only increases throughput capacity.

Option A (reducing read capacity) is unrelated to write conflicts. Option B (DynamoDB Streams with last writer wins) is the default behavior and does not reduce conflicts; it may cause data loss.

464
MCQhard

A company runs a microservices architecture on Amazon ECS with Fargate. The operations team wants to collect custom application metrics (e.g., request latency per service) and visualize them in CloudWatch dashboards. The team also needs to set CloudWatch alarms based on these metrics. Which solution requires the LEAST amount of code changes and operational overhead?

A.Use the CloudWatch Embedded Metric Format to emit custom metrics as JSON log entries.
B.Deploy a StatsD daemon as a sidecar container and configure the application to send metrics to StatsD, then forward to CloudWatch.
C.Modify the application code to use the AWS SDK to call PutMetricData API directly.
D.Install the CloudWatch Agent on each Fargate task as a sidecar container to collect custom metrics.
AnswerA

EMF allows emitting metrics via logs with minimal code changes.

Why this answer

The CloudWatch Embedded Metric Format allows applications to emit metrics as structured JSON logs, which CloudWatch automatically extracts into metrics and logs. This requires minimal code changes (just log format). Option B is wrong because publishing to CloudWatch via PutMetricData requires the AWS SDK and more code changes.

Option C is wrong because CloudWatch Agent on Fargate is not supported (requires EC2). Option D is wrong because using a sidecar container for StatsD adds complexity and overhead.

465
MCQhard

Refer to the exhibit. An IAM policy is attached to a user. The user requests an object from the 'example-bucket' bucket, specifically from the 'confidential' folder, over HTTP (not HTTPS). The source IP is within the 10.0.0.0/24 range. What will be the result of this request?

A.Denied, because the user does not have s3:GetObject permission on the confidential folder.
B.Allowed, because the Deny statement only applies to HTTPS.
C.Allowed, because the source IP is within the allowed range.
D.Denied, because the request uses HTTP and the Deny statement blocks it.
AnswerD

The Deny applies when SecureTransport is false (HTTP).

Why this answer

The Deny statement with SecureTransport false applies to all s3 actions on the confidential folder. Even though the source IP is allowed, the Deny for HTTP access will override the Allow. The request will be denied.

466
MCQmedium

A company uses AWS Systems Manager to patch EC2 instances. After a patch window, several instances are unreachable. The engineer checks the SSM Agent logs and finds no errors. What should the engineer do next to diagnose the issue?

A.Restart the SSM Agent on the affected instances.
B.Verify that the patch baseline is associated with the instances.
C.Review the IAM role attached to the instances for sufficient permissions.
D.Check if the instances have outbound internet connectivity to the SSM endpoints.
AnswerD

SSM requires outbound connectivity; lack of connectivity prevents communication.

Why this answer

The SSM Agent requires outbound internet connectivity to the Systems Manager endpoints (or AWS PrivateLink if configured) to communicate with the service. If the patch window or a security group change blocks this connectivity, instances become unreachable despite the agent logs showing no errors. Option A is wrong because restarting the agent does not help if the issue is network connectivity.

Option B is wrong because the patch baseline association defines which patches to apply, not connectivity. Option C is wrong because IAM permissions are likely correct since the agent logs show no errors; the issue is network-related, not permissions.

467
MCQmedium

A company uses AWS CodePipeline to deploy a web application. The deployment includes an EC2 instance running behind an Application Load Balancer. The security team requires that all data in transit to the application be encrypted. Which configuration best meets this requirement without breaking the deployment?

A.Configure CodePipeline to use an encrypted artifact bucket.
B.Enable AWS WAF on the ALB to enforce HTTPS.
C.Create an HTTPS listener on the ALB with a certificate from AWS Certificate Manager and redirect HTTP to HTTPS.
D.Place a CloudFront distribution in front of the ALB and configure it to require HTTPS.
AnswerC

HTTPS listener with ACM certificate provides encryption in transit.

Why this answer

The Application Load Balancer supports SSL/TLS termination using certificates from AWS Certificate Manager, enabling HTTPS encryption. Option A is wrong because CodePipeline does not encrypt traffic at the ALB level. Option B is wrong because AWS WAF is a web application firewall, not for encryption.

Option D is wrong because CloudFront can handle HTTPS, but adding it changes the architecture unnecessarily and may break the pipeline if not properly configured.

468
Multi-Selectmedium

A company uses Amazon CloudWatch Logs to store application logs. The DevOps team wants to search across multiple log groups for a specific error pattern. Which TWO options can be used to achieve this? (Choose TWO.)

Select 2 answers
A.Use CloudWatch Logs Insights to run queries across multiple log groups.
B.Export the logs to Amazon S3 and use Amazon Athena to query the logs.
C.Install the CloudWatch Logs agent on an EC2 instance and tail the logs.
D.Create a Lambda function that reads logs from each log group and searches for the pattern.
E.Use Amazon Kinesis Data Analytics to process the log streams.
AnswersA, B

CloudWatch Logs Insights can query multiple log groups simultaneously.

Why this answer

CloudWatch Logs Insights is purpose-built for querying log data across multiple log groups. It uses a query language to search, filter, and aggregate log events, making it ideal for identifying error patterns across different sources. This option is correct because it directly supports cross-log-group queries without additional data movement or infrastructure.

Exam trap

The trap here is that candidates may think Lambda or Kinesis are suitable for ad-hoc log searching, but they are designed for real-time processing or custom workflows, not for efficient cross-log-group querying like CloudWatch Logs Insights or Athena.

469
MCQhard

A company runs a containerized web application on Amazon ECS with AWS Fargate. The application is critical and requires high availability. The DevOps team has set up an Amazon CloudWatch alarm that triggers an auto scaling action when the average CPU utilization exceeds 75% for 5 minutes. However, during a recent traffic spike, the application became slow and some requests timed out, even though the CloudWatch alarm did not fire. The team checked the ECS service auto scaling configuration and found that the target tracking scaling policy based on average CPU utilization is set with a target value of 75%. The ECS service is configured with a minimum of 2 tasks and a maximum of 10 tasks. Upon investigation, they noticed that the CPU utilization metric for the service remained below 75% during the spike, but the memory utilization was high (over 90%). The application logs show that the tasks were running out of memory, causing garbage collection pauses and slow responses. Which course of action should the DevOps engineer take to prevent this issue in the future?

A.Add a second target tracking scaling policy based on average memory utilization with a target value of 75%.
B.Decrease the CPU target value to 50% to trigger scaling earlier.
C.Increase the minimum number of tasks from 2 to 5 to provide more capacity upfront.
D.Increase the task memory limit in the task definition to 8 GB.
AnswerA

Memory-based scaling will add tasks when memory is high, preventing memory exhaustion.

Why this answer

The issue is memory pressure, not CPU. Adding a target tracking scaling policy based on average memory utilization with a target value of 75% will cause the ECS service to automatically scale out when memory utilization exceeds the target, preventing performance degradation due to high memory usage. Option B (decreasing CPU target to 50%) is incorrect because CPU utilization was not the bottleneck.

Option C (increasing minimum tasks to 5) provides static capacity but does not dynamically respond to memory spikes, leading to wasted resources or insufficient scaling. Option D (increasing task memory limit) is a static change that may help temporarily but does not provide dynamic scaling; auto scaling based on memory is the recommended approach.

470
MCQeasy

Refer to the exhibit. A KMS key policy is configured as shown. What does this policy allow?

A.The role to decrypt any KMS key.
B.The role to decrypt via any AWS service.
C.The role to decrypt data encrypted by S3 in us-east-1.
D.Any IAM role to decrypt using this key.
AnswerC

The condition kms:ViaService limits decrypt to requests from S3 in us-east-1.

Why this answer

The KMS key policy includes a condition that restricts the kms:Decrypt permission to requests that originate from S3 in the us-east-1 region. Therefore, the specified role (CrossAccountRole) can only decrypt data that was encrypted by S3 in us-east-1. Option C correctly describes this behavior.

471
MCQeasy

A development team is using AWS CodeCommit as the source for a CI/CD pipeline. They want to automatically run unit tests when a pull request is created, but only for changes to the 'src' directory. Which approach should they use?

A.Use an AWS Lambda function that polls CodeCommit for new pull requests and invokes CodeBuild when changes in 'src' directory are detected.
B.Create an AWS CodeBuild project with a source provider of CodeCommit and configure 'WEBHOOK' events with a filter for pull requests and path filter for 'src/**'.
C.Set up an Amazon EventBridge rule that matches CodeCommit pull request events and invoke CodeBuild. Add a condition in the CodeBuild buildspec to check if changes are in 'src' directory.
D.Configure an AWS CodePipeline with a Source stage for CodeCommit and a Test stage for CodeBuild. Use a manual approval step to trigger on pull requests.
AnswerB

CodeBuild webhooks can trigger on pull request events with path filters.

Why this answer

AWS CodeBuild supports webhook events directly from CodeCommit, allowing you to trigger builds automatically when pull requests are created. By configuring a webhook with a filter for pull request events and a path filter for 'src/**', you ensure that only changes to the 'src' directory trigger the unit tests, meeting the requirement precisely without additional infrastructure.

Exam trap

The trap here is that candidates often overcomplicate the solution by choosing EventBridge or Lambda, missing that CodeBuild webhooks natively support path filtering for pull request events, which is the simplest and most efficient method.

How to eliminate wrong answers

Option A is wrong because polling CodeCommit with a Lambda function is inefficient, introduces unnecessary complexity and latency, and does not leverage native event-driven integration; CodeBuild webhooks provide a simpler, real-time solution. Option C is wrong because while EventBridge can capture CodeCommit pull request events, it requires an additional condition in the buildspec to check the 'src' directory, which adds unnecessary complexity and does not use CodeBuild's native path filtering, making it less efficient and more error-prone. Option D is wrong because CodePipeline with a manual approval step is not designed to trigger automatically on pull request creation; it requires manual intervention and does not provide the path-based filtering needed to restrict execution to changes in the 'src' directory.

472
MCQmedium

A DevOps team uses AWS CodeDeploy to deploy an application to an Auto Scaling group. The deployment fails with an error 'The overall deployment failed because too many individual instances failed deployment'. The team checks the instance logs and finds that the 'BeforeInstall' lifecycle event script returned a non-zero exit code. What is the BEST approach to resolve this?

A.Set the 'ignoreScriptFailure' option to true in the AppSpec file and redeploy.
B.Manually run the script on an instance and then resume the deployment.
C.Fix the script error in the revision and redeploy.
D.Change the deployment configuration to 'AllAtOnce' to speed up deployment.
AnswerC

Correcting the script ensures the deployment succeeds.

Why this answer

The deployment failed due to a script error in the BeforeInstall lifecycle event. The root cause is the script itself, so fixing the script error in the revision and redeploying addresses the issue permanently. Option A is wrong because setting 'ignoreScriptFailure' to true would mask the error and could lead to application issues.

Option B is wrong because manually running the script on an instance does not fix the underlying issue in the revision, and the deployment will fail again. Option D is wrong because changing the deployment configuration to 'AllAtOnce' does not fix the script error and may cause more instances to fail simultaneously.

473
MCQhard

Refer to the exhibit. A user outside the 192.0.2.0/24 IP range attempts to get an object from example-bucket. What will happen?

A.The request is allowed because the Allow statement matches
B.The request is allowed because there is no explicit Deny for GetObject
C.The request is denied because the policy is malformed
D.The request is denied because the Deny statement applies
AnswerD

Explicit Deny blocks the request.

Why this answer

The Deny statement explicitly denies all S3 actions if the IP is not in the allowed range. Since the user is outside, the Deny applies, overriding the Allow. Option A is wrong because the Deny blocks access.

Option B is wrong because the Deny is explicit. Option C is wrong because the policy is not malformed.

474
Multi-Selectmedium

Which TWO actions should a DevOps engineer take to implement a GitFlow branching strategy for infrastructure as code using AWS CodeCommit and CodePipeline? (Choose two.)

Select 2 answers
A.Disable automatic triggers on the master branch to prevent accidental deployments.
B.Use CodeBuild to run unit tests on feature branches before merging.
C.Use a single pipeline that handles all branches.
D.Create separate pipelines for develop and master branches.
E.Configure CodePipeline to trigger on pull request creation.
AnswersB, D

Validates code before merge.

Why this answer

Options B and D are correct. Option B: CodeBuild can run unit tests on feature branches before merging, ensuring code quality. Option D: Separate pipelines for develop and master branches allow different deployment behaviors (e.g., non-prod vs. prod).

Option A is wrong because disabling automatic triggers on the master branch would prevent automated deployments when changes are merged, which is contrary to GitFlow where master deployments are desired. Option C is wrong because a single pipeline for all branches reduces flexibility and can cause unintended deployments. Option E is wrong because CodePipeline does not natively support pull request triggers; use CodeBuild or other services for that.

475
MCQhard

A company uses AWS CloudFormation to manage infrastructure. The development team wants to promote changes from a development environment to a production environment using change sets. They need to ensure that the production stack is not updated if there are any changes to the stack's IAM policies. Which approach should the team use?

A.Enable drift detection on the production stack and compare with the development stack.
B.Create a ChangeSet from the updated template, review the changes for IAM modifications, and execute only if no IAM changes are present.
C.Use AWS CloudFormation StackSets to deploy to multiple accounts and use stack instance filters.
D.Use a custom resource in the template that checks for IAM changes and fails the update.
AnswerB

ChangeSets provide a preview of all changes, including IAM resource modifications.

Why this answer

AWS CloudFormation change sets allow you to review the proposed changes to a stack before executing them. By creating a change set from the updated template, the team can inspect the list of changes and specifically look for any modifications to IAM resources (e.g., AWS::IAM::Role, AWS::IAM::Policy). If the change set contains IAM-related changes, they can choose not to execute it, thereby preventing unintended updates to the production stack's IAM policies.

Exam trap

The trap here is that candidates may confuse drift detection (which is reactive) with change sets (which are proactive), or they may think that StackSets or custom resources are needed for multi-environment promotion, when in fact change sets provide a simple, native mechanism for reviewing and selectively applying updates.

How to eliminate wrong answers

Option A is wrong because drift detection compares the current state of a stack with its expected template configuration, but it does not prevent updates; it only reports differences after they occur. Option C is wrong because AWS CloudFormation StackSets are designed for deploying identical templates across multiple accounts and regions, not for reviewing or blocking changes based on IAM modifications in a single production stack. Option D is wrong because a custom resource that checks for IAM changes and fails the update would require complex custom logic and would not leverage the built-in change set review capability; it also risks breaking the update process entirely rather than providing a controlled review step.

476
MCQhard

A company has a VPC with public and private subnets. An EC2 instance in the private subnet needs to download patches from the internet but must not be directly accessible from the internet. Which configuration allows this?

A.Set up a VPN connection to the company's on-premises network and route traffic through it.
B.Deploy a NAT gateway in a public subnet and route the private subnet's traffic through it.
C.Deploy a bastion host in the public subnet and configure the instance to use it.
D.Attach an internet gateway to the VPC and add a route to the private subnet route table.
AnswerB

NAT gateway enables outbound internet traffic while blocking inbound.

Why this answer

A NAT gateway deployed in a public subnet allows instances in private subnets to initiate outbound traffic to the internet while preventing inbound connections from the internet. This matches the requirement for downloading patches without direct accessibility. Option B is correct.

Option A is incorrect because a VPN connection provides access to an on-premises network, not general internet access. Option C is incorrect because a bastion host provides SSH/RDP access to instances, not outbound internet connectivity for patch downloads. Option D is incorrect because attaching an internet gateway and adding a route to the private subnet route table would make the instances directly accessible from the internet, violating the requirement.

477
MCQeasy

A company uses Amazon Route 53 for DNS. They want to ensure that if their primary website endpoint fails, traffic is automatically routed to a secondary endpoint in a different Region. Which routing policy should be used?

A.Latency routing
B.Simple routing
C.Failover routing
D.Weighted routing
AnswerC

Failover routing performs automatic failover based on health checks.

Why this answer

Failover routing policy allows you to configure an active-passive failover setup.

478
MCQeasy

Given the above IAM policy, which action is permitted?

A.Invoke the Lambda function MyFunction in us-east-1 account 123456789012
B.Read objects from an S3 bucket
C.Create a Lambda function
D.Start an EC2 instance
AnswerA

The policy allows lambda:InvokeFunction on that specific ARN.

Why this answer

The policy explicitly allows the lambda:InvokeFunction action on the specified function ARN. Option A is correct. It does not allow other Lambda actions (B), S3 actions (C), or EC2 actions (D).

479
MCQmedium

A team uses AWS CloudFormation to manage infrastructure. They have a stack that creates an Amazon RDS instance. During an update, the stack fails with 'CREATE_FAILED' for the DB instance resource, and the error message indicates 'The DB instance already exists.' What is the most likely cause?

A.An RDS instance with the same identifier already exists in the account and region.
B.The stack update is trying to replace the DB instance without a proper UpdateReplace policy.
C.The stack has a DeletionPolicy of Retain on the RDS instance.
D.The RDS instance has deletion protection enabled.
AnswerA

DB instance identifiers must be unique per region; if one exists, creation fails.

Why this answer

The error 'The DB instance already exists' indicates that CloudFormation is attempting to create a new RDS instance with a DB instance identifier that is already in use within the same AWS account and region. Since DB instance identifiers must be unique per account and region, the creation fails. This typically occurs when a stack update triggers a resource replacement (e.g., due to a property change that requires recreation) and the old instance was not deleted or its identifier is still reserved.

Exam trap

The trap here is that candidates often confuse 'DeletionPolicy' or 'deletion protection' with the root cause, but the error is specifically about a duplicate identifier during creation, not about deletion or retention policies.

How to eliminate wrong answers

Option B is wrong because CloudFormation does not have an 'UpdateReplace policy'; instead, it uses replacement behaviors based on the resource's 'RequiresRecreation' property, and the error here is about a duplicate identifier, not a missing policy. Option C is wrong because a 'DeletionPolicy' of 'Retain' would cause the old RDS instance to persist after stack deletion, but during an update replacement, CloudFormation creates the new instance before deleting the old one, leading to a duplicate identifier conflict — however, the error message specifically says 'already exists,' which is the direct cause, not the DeletionPolicy itself. Option D is wrong because deletion protection prevents the instance from being deleted via the AWS API, but it does not prevent CloudFormation from attempting to create a new instance with the same identifier; the error is about creation, not deletion.

480
Multi-Selecteasy

A DevOps team needs to implement a solution to automatically remediate an S3 bucket that becomes publicly accessible. Which TWO services should they use together?

Select 2 answers
A.AWS CloudTrail
B.AWS Config
C.AWS Lambda
D.AWS Systems Manager Automation
E.Amazon GuardDuty
AnswersB, D

Config can evaluate bucket policies and trigger remediation.

Why this answer

AWS Config can monitor S3 bucket configurations using a managed rule such as s3-bucket-public-read-prohibited. When a violation is detected, Config can automatically invoke an AWS Systems Manager Automation document as a remediation action. Systems Manager Automation runs a pre-defined workflow (e.g., applying a bucket policy that blocks public access) to correct the issue.

This combination provides automated, event-driven remediation without manual intervention, making AWS Config and AWS Systems Manager Automation the correct pair.

Exam trap

AWS often tests the misconception that AWS Lambda is the primary service for custom remediation. However, AWS Config natively integrates with AWS Systems Manager Automation for automatic remediation of non-compliant resources, reducing the need for custom Lambda functions. Lambda is not listed as a correct answer in this scenario.

481
MCQhard

A DevOps engineer is configuring a centralized logging solution using Amazon CloudWatch Logs. They need to ensure that logs from multiple AWS accounts are aggregated into a single CloudWatch Logs account. Which approach meets this requirement?

A.Use Amazon Kinesis Data Firehose in each account to stream logs to a central Amazon S3 bucket, then use Amazon Athena to query.
B.Create a subscription filter in each account that delivers log events to a CloudWatch Logs destination in the central account.
C.Set up a cross-account destination using an Amazon Kinesis Data Streams stream in the central account and configure each account to send logs to that stream.
D.Configure each application to use the PutLogEvents API to send logs directly to the central account's log group.
AnswerB

Cross-account subscription filters allow real-time log aggregation from multiple accounts to a central account.

Why this answer

CloudWatch Logs supports cross-account subscription filters that can deliver log events to a CloudWatch Logs destination in a central account. The destination is a logical resource that points to a Kinesis Data Stream or Lambda function in the central account, and the source account creates a subscription filter that sends matching log events to that destination. This allows centralized aggregation without requiring each account to manage separate streaming infrastructure.

Exam trap

The trap here is that candidates confuse the CloudWatch Logs destination (which is a cross-account subscription mechanism) with directly writing to a Kinesis stream or using PutLogEvents across accounts, both of which are not supported for cross-account log aggregation.

How to eliminate wrong answers

Option A is wrong because Amazon Kinesis Data Firehose cannot directly stream logs from CloudWatch Logs in multiple accounts to a central S3 bucket without additional cross-account permissions and intermediate services; it also introduces unnecessary complexity and latency for real-time log aggregation. Option C is wrong because while a cross-account Kinesis Data Streams destination can be used, the correct implementation requires creating a CloudWatch Logs destination in the central account that points to the Kinesis stream, not configuring each account to send logs directly to the stream via PutRecord. Option D is wrong because the PutLogEvents API requires the log group and log stream to exist in the same account as the API call; cross-account PutLogEvents is not supported, and applications cannot send logs directly to a central account's log group.

482
Matchingmedium

Match each AWS service health or performance concept to its meaning.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Maximum limits on resources per account

Shows events and changes affecting your AWS resources

Monitors a metric and performs actions based on thresholds

Provides recommendations for cost, performance, security, and fault tolerance

Recommends optimal AWS compute resources for workloads

Why these pairings

The correct matches are: Amazon CloudWatch monitors resources in real-time; AWS Trusted Advisor optimizes cost, security, and performance; AWS Health Dashboard provides personalized health alerts. Common confusions involve swapping monitoring (CloudWatch) with auditing (CloudTrail) and recommendations (Trusted Advisor) with monitoring.

483
Multi-Selecthard

Which THREE of the following are valid methods to enforce encryption at rest for Amazon EBS volumes? (Choose three.)

Select 3 answers
A.Enable EBS encryption by default in the account.
B.Use the AWS CLI to encrypt an existing volume in place.
C.Encrypt the volume when creating it through the AWS Management Console.
D.Attach the volume to an EC2 instance and use OS-level encryption.
E.Create an unencrypted snapshot of the volume, copy it with encryption, and create a new volume from the encrypted snapshot.
AnswersA, C, E

This automatically encrypts all new EBS volumes.

Why this answer

Enabling EBS encryption by default at the account level ensures all new volumes are encrypted. You can also encrypt volumes when creating them via the console or CLI. You cannot encrypt an existing volume directly; you must create a snapshot, copy it with encryption, and create a new volume.

Attaching a volume does not encrypt it.

484
Multi-Selectmedium

A DevOps team is using AWS CodeBuild to run unit tests and package a Java application. They want to cache the Maven local repository (~/.m2) between builds to improve build times. Which TWO steps are necessary to enable caching in CodeBuild? (Select TWO.)

Select 2 answers
A.Set the MAVEN_OPTS environment variable to use a custom repository path.
B.Configure the buildspec to upload the Maven repository as a build artifact.
C.Enable 'Local cache' mode in the CodeBuild project.
D.Add a 'cache' section in the buildspec file specifying the paths to cache.
E.Create an S3 bucket to store the cache.
AnswersD, E

The buildspec cache section tells CodeBuild which files to cache.

Why this answer

To enable caching for the Maven local repository in AWS CodeBuild, two steps are required: (1) Add a `cache` section in the buildspec file specifying the paths to cache (e.g., ~/.m2) — this is option D. (2) Create an S3 bucket to store the cache and configure the CodeBuild project to use that bucket for caching — this is option E. Option A (setting MAVEN_OPTS) is not necessary because the default Maven repository path is already ~/.m2. Option B (uploading as a build artifact) is for saving output artifacts, not for caching.

Option C ('Local cache' mode) is a different feature used for Docker layer caching, not for Maven dependencies. Therefore, options D and E are correct.

485
Multi-Selectmedium

A company is using AWS KMS to encrypt data in Amazon S3. The security team wants to ensure that the KMS key can only be used from within the company's VPC. What should be done? (Choose TWO.)

Select 2 answers
A.Attach a security group to the KMS key.
B.Modify the KMS key policy to include a condition that requires the kms:ViaService to be from the VPC endpoint.
C.Configure the S3 bucket policy to allow only requests from the VPC.
D.Create a service control policy (SCP) that denies KMS operations from outside the VPC.
E.Create a VPC endpoint for AWS KMS.
AnswersB, E

This condition restricts use of the key to requests coming through the VPC endpoint.

Why this answer

Options B and E are correct. To restrict KMS key usage to within the VPC, you first create a VPC endpoint for AWS KMS (Option E) to allow private connectivity. Then, you modify the KMS key policy to include a condition that requires the request to originate from that VPC endpoint, using the kms:ViaService condition key (Option B).

Option A is wrong because security groups do not apply to KMS keys; they are used for EC2 instances and network interfaces. Option C is wrong because S3 bucket policies cannot restrict which KMS key is used for encryption; they can only restrict S3 actions. Option D is wrong because service control policies (SCPs) apply at the organizational level and cannot restrict KMS key usage to a specific VPC; key policies are the correct mechanism.

486
Multi-Selecthard

Which THREE strategies can improve the resilience of an Amazon RDS for PostgreSQL database?

Select 3 answers
A.Disable automated backups to save costs
B.Enable automated backups with a retention period
C.Create read replicas in another Availability Zone
D.Use a single-AZ instance to reduce complexity
E.Enable Multi-AZ deployment
AnswersB, C, E

Allows point-in-time recovery.

Why this answer

Multi-AZ deployment (E) provides automatic failover to a standby instance in a different Availability Zone, enhancing availability. Automated backups with a retention period (B) enable point-in-time recovery, reducing data loss. Read replicas in another Availability Zone (C) offload read traffic and can be promoted to a standalone instance during a disaster.

Option A is wrong because disabling backups removes recovery capability, sacrificing resilience. Option D is wrong because a single-AZ instance has no failover and is less resilient.

487
MCQeasy

A company uses AWS OpsWorks for configuration management. The operations team needs to apply a configuration change to all instances in a layer without downtime. Which approach should they use?

A.Use a custom Chef recipe and run it on the layer using OpsWorks 'Run Command'.
B.Use an Auto Scaling lifecycle hook to apply the change during instance launch.
C.Clone the layer and update the clone with the new configuration, then switch traffic.
D.SSH into each instance and manually apply the change.
AnswerA

OpsWorks supports running recipes on existing instances.

Why this answer

The correct approach is to use a custom Chef recipe and run it on the layer using OpsWorks 'Run Command'. This allows applying configuration changes to all instances in the layer without downtime, as OpsWorks executes the recipe on each instance without requiring instance recreation. Option B is incorrect because Auto Scaling lifecycle hooks are used to execute actions during instance launch or termination, not for runtime configuration updates.

Option C is incorrect because cloning a layer creates a new layer and does not apply changes to existing instances; switching traffic would involve additional steps and potential downtime. Option D is incorrect because manually SSHing into each instance is error-prone, not scalable, and violates best practices for configuration management.

488
Multi-Selecthard

A DevOps team is designing a solution to encrypt data at rest for an Amazon RDS for MySQL database. Which TWO actions should the team take? (Choose TWO.)

Select 2 answers
A.Enable encryption after creating the RDS instance by modifying the instance
B.Enable SSL/TLS for the RDS instance
C.Use AWS KMS to create a customer managed key and assign it to the RDS instance
D.Enable encryption at rest when creating the RDS DB instance
E.Store the database files in an encrypted S3 bucket
AnswersC, D

You can use AWS KMS to create a customer managed key and assign it to the RDS instance during creation to encrypt data at rest.

Why this answer

To encrypt data at rest for Amazon RDS for MySQL, encryption must be enabled when creating the DB instance (Option D) and a customer managed key from AWS KMS can be used (Option C). Option A is incorrect because you cannot enable encryption on an existing unencrypted RDS instance; it must be done at creation time. Option B is incorrect because SSL/TLS encrypts data in transit, not at rest.

Option E is incorrect because storing database files in an encrypted S3 bucket does not encrypt the RDS instance; RDS encryption is managed by AWS KMS and is enabled at the instance level.

489
MCQmedium

A security audit reveals that an S3 bucket contains objects that are not encrypted. The bucket is configured with default encryption using SSE-S3. What is the most likely reason that objects are unencrypted?

A.The objects were uploaded with server-side encryption using AWS KMS
B.The bucket policy denies SSE-S3 encryption
C.The objects were uploaded before default encryption was enabled
D.The objects were uploaded with SSE-C
AnswerC

Default encryption does not encrypt existing objects.

Why this answer

Default encryption applies only to newly uploaded objects that do not have encryption settings. If objects were uploaded before default encryption was enabled, or if the PUT request explicitly specified no encryption, they may remain unencrypted. Option A is wrong because SSE-S3 does not require KMS.

Option B is wrong because default encryption applies to new objects. Option D is wrong because SSE-C is not relevant.

490
MCQeasy

A company has an Amazon RDS for MySQL database that stores sensitive data. The security team requires encryption at rest and in transit. Which combination of options meets these requirements?

A.Use AWS Certificate Manager to issue a certificate for the RDS instance
B.Place the RDS instance in a private subnet and use VPC peering
C.Enable encryption at rest on the RDS instance and enforce SSL connections
D.Use AWS KMS to encrypt the database before inserting data and decrypt on read
AnswerC

RDS encryption provides at-rest encryption; SSL provides in-transit encryption.

Why this answer

Encryption at rest for Amazon RDS is enabled by turning on RDS encryption when creating the instance. Encryption in transit is achieved by enforcing SSL/TLS connections for client connections to the database. Option C correctly combines both: enabling RDS encryption for at-rest security and enforcing SSL for in-transit security.

Option A (AWS Certificate Manager) provides certificates but does not directly encrypt the RDS instance. Option B (private subnet with VPC peering) addresses network isolation, not encryption. Option D (client-side encryption with KMS) encrypts data before insertion but does not use RDS encryption and is not a standard RDS feature.

491
Multi-Selectmedium

Which TWO actions can be taken to secure an Amazon S3 bucket that contains confidential data? (Choose TWO.)

Select 2 answers
A.Enable S3 Default Encryption.
B.Enable S3 Transfer Acceleration.
C.Enable S3 Cross-Region Replication.
D.Enable S3 Versioning.
E.Enable S3 Block Public Access.
AnswersA, E

Encrypts data at rest.

Why this answer

Correct options: A and E. Option A: S3 Default Encryption ensures data is encrypted at rest automatically, a key security measure. Option E: S3 Block Public Access prevents public exposure of the bucket and its objects, a key security measure.

Option B (Transfer Acceleration) is for speed, not security. Option C (Cross-Region Replication) is for disaster recovery, not security. Option D (Versioning) helps with recovery from accidental deletions/overwrites, but does not directly secure data from unauthorized access.

492
MCQeasy

A DevOps team is using AWS CloudFormation to manage a multi-tier application. They want to ensure that when an update to the stack causes a resource replacement, the replacement occurs only after the new resource is fully created and tested. Which CloudFormation feature should they use?

A.UpdatePolicy attribute with AutoScalingRollingUpdate
B.CreationPolicy attribute
C.DeletionPolicy attribute set to Retain
D.DependsOn attribute to specify creation order
AnswerB

Incorrect. The `CreationPolicy` attribute does not have a `CreateBeforeDestroy` property. It is used to wait for a signal from the resource after creation, not to control the order of replacement during updates.

Why this answer

The CreationPolicy attribute can be added to a resource to ensure that CloudFormation waits for a specified number of success signals before considering the resource created. When a stack update causes a resource replacement, CloudFormation creates the new resource, waits for the creation signals (if a CreationPolicy is defined), and only then deletes the old resource. This ensures the new resource is fully operational and tested before replacement.

The other options are incorrect: UpdatePolicy with AutoScalingRollingUpdate is for updating instances in an Auto Scaling group without full replacement; DeletionPolicy Retain keeps the old resource but does not manage creation; DependsOn controls creation order but does not wait for testing signals.

Exam trap

Candidates often confuse the UpdatePolicy (used for rolling updates in Auto Scaling) with CreationPolicy (used to wait for resource creation signals). The trap is to think that only Auto Scaling resources can be tested during replacement; many resources support CreationPolicy for signal-based testing during replacement.

How to eliminate wrong answers

Option A is wrong because `UpdatePolicy` with `AutoScalingRollingUpdate` is specific to Auto Scaling groups and controls how instances are updated during rolling updates, not how resource replacements are sequenced for arbitrary resources. Option C is wrong because `DeletionPolicy` set to `Retain` only preserves a resource when the stack is deleted, not during an update replacement; it does not control creation order or testing. Option D is wrong because `DependsOn` only specifies the creation order of resources during initial stack creation, not the replacement behavior during updates; it cannot enforce that a new resource is created and tested before the old one is removed.

493
MCQhard

A DevOps engineer is tasked with centralizing logs from multiple AWS accounts into a single Amazon OpenSearch Service domain. The engineer sets up Amazon Kinesis Data Firehose to deliver logs from each account to the OpenSearch domain. However, some accounts show failed deliveries in the Firehose console. Which configuration is MOST likely causing the failures?

A.The IAM role assumed by Firehose in each account does not have permissions to write to the cross-account OpenSearch domain
B.The source accounts do not have a CloudWatch Logs subscription filter to send logs to Firehose
C.The Kinesis Data Streams used as the Firehose source is not encrypted
D.The OpenSearch domain's access policy does not allow access from the S3 bucket used by Firehose
AnswerA

Firehose needs an IAM role with sts:AssumeRole and es:HttpPut permissions for the destination OpenSearch domain.

Why this answer

The most likely cause of failed deliveries is that the IAM role assumed by Kinesis Data Firehose in each source account lacks the necessary permissions to write to the cross-account Amazon OpenSearch Service domain. Firehose uses a service-linked or custom IAM role to perform actions such as `es:ESHttpPut` and `es:ESHttpPost` against the OpenSearch domain endpoint. Without explicit cross-account trust and resource-based policy allowing the Firehose role's ARN, the delivery will fail with an authorization error.

Exam trap

The trap here is that candidates often assume the failure is due to missing CloudWatch subscription filters or S3 bucket permissions, but the real issue is the missing cross-account IAM trust between the Firehose role and the OpenSearch domain's access policy.

How to eliminate wrong answers

Option B is wrong because CloudWatch Logs subscription filters are used to stream log data to Firehose, but the question states that logs are being delivered from multiple accounts; the failure is at the Firehose-to-OpenSearch stage, not at the ingestion stage. Option C is wrong because Kinesis Data Streams encryption (whether server-side or client-side) does not affect Firehose's ability to write to OpenSearch; Firehose can read encrypted streams as long as it has the proper KMS permissions. Option D is wrong because Firehose writes directly to the OpenSearch domain via HTTP/HTTPS, not through an S3 bucket; the OpenSearch domain's access policy must grant access to the Firehose IAM role or the source account's principal, not to an S3 bucket.

494
MCQmedium

Refer to the exhibit. A security engineer finds this CloudTrail log entry. What is the most likely security concern?

A.The bucket is now publicly accessible
B.The bucket policy grants the root user full access
C.The root user performed an action that should have been done by an IAM user
D.The bucket policy allows only authenticated users to read objects
AnswerA

Public access granted to all objects.

Why this answer

The CloudTrail log entry shows a PutBucketPolicy action that sets a bucket policy with principal '*', granting public read access to all objects in the bucket. This is a security concern because the bucket becomes publicly accessible, allowing anyone on the internet to read objects. Option A is correct because the bucket policy makes the bucket publicly accessible.

Option B is incorrect because the bucket policy does not grant the root user full access; it grants public access. Option C is incorrect because the action is performed by an IAM user (the user field shows 'arn:aws:iam::123456789012:user/admin'), not the root user. Option D is incorrect because the policy allows all principals (public) to read objects, not just authenticated users.

495
Multi-Selecthard

A company uses AWS Organizations to manage multiple accounts. The DevOps team needs to monitor for any IAM user creation across all accounts in the organization. Which THREE steps should be taken to implement this centralized monitoring?

Select 3 answers
A.Create a CloudWatch Logs metric filter on the organization's CloudTrail log group for 'CreateUser' events.
B.Enable CloudTrail in the management account with an organization trail that applies to all accounts.
C.Configure an S3 bucket to receive CloudTrail logs from all accounts and enable S3 event notifications for object creation.
D.Use AWS Config rules to detect IAM user creation across accounts.
E.Set a CloudWatch alarm on the metric to send notifications via SNS.
AnswersA, B, E

A metric filter counts occurrences of the 'CreateUser' event in the CloudTrail logs.

Why this answer

Options A, B, and E are correct. Option B: Enabling CloudTrail in the management account with an organization trail captures all API activity across accounts. Option A: Creating a CloudWatch Logs metric filter on the organization's CloudTrail log group for 'CreateUser' events captures the specific event.

Option E: Setting a CloudWatch alarm on the metric sends notifications via SNS. Option C is wrong because configuring an S3 bucket with event notifications does not directly enable centralized monitoring and alerting for IAM user creation. Option D is wrong because AWS Config rules are used for resource configuration compliance, not for real-time API call monitoring like IAM user creation.

496
MCQmedium

A company is using AWS CodeBuild as part of its CI/CD pipeline. The build projects need to access a private Amazon ECR repository to pull Docker images. What is the MOST secure way to grant CodeBuild access to ECR?

A.Configure a VPC endpoint for ECR and allow CodeBuild to connect through it.
B.Store ECR credentials in AWS Systems Manager Parameter Store and retrieve them in the buildspec.
C.Create a service role for CodeBuild with an IAM policy that grants ECR pull access.
D.Use the AWS CLI to retrieve an ECR authorization token and pass it to Docker.
AnswerC

CodeBuild assumes the service role to access ECR.

Why this answer

CodeBuild can assume an IAM service role with a policy that grants pull access to the ECR repository. This is the most secure approach because it avoids static credentials and leverages AWS identity and access management. Option A is wrong: a VPC endpoint provides private network connectivity to ECR but does not grant access; IAM permissions are still required.

Option B is wrong: storing ECR credentials in Parameter Store introduces static credentials that must be managed and rotated, making it less secure than using an IAM role. Option D is wrong: using the AWS CLI to retrieve an authorization token requires managing temporary credentials and is more complex; the service role approach is simpler and more secure.

497
MCQhard

An organization uses AWS Key Management Service (KMS) with customer-managed keys. The security policy requires automatic key rotation every year. A DevOps engineer notices that the key material is not rotating as expected. What is the most likely cause?

A.The key was created by importing key material; automatic rotation is not supported for imported keys.
B.The key must be re-imported annually to enable rotation.
C.The key is not enabled for rotation due to a billing limit.
D.The key is in a 'Pending Deletion' state and cannot be rotated.
AnswerA

Imported keys cannot be rotated automatically.

Why this answer

Automatic key rotation is not supported for imported key material. Option B is wrong because KMS does not charge extra for automatic rotation. Option C is wrong because KMS does not require re-importing for rotation; it's simply not available.

Option D is wrong because the key state does not prevent rotation.

498
MCQmedium

A company stores sensitive customer data in an S3 bucket. The security team requires that all data be encrypted at rest using customer-managed KMS keys. Additionally, any attempt to upload an unencrypted object must be denied. Which S3 bucket policy should be used?

A.Deny s3:PutObject unless the request includes s3:x-amz-server-side-encryption: true
B.Allow s3:PutObject with condition s3:x-amz-server-side-encryption: AES256
C.Allow s3:PutObject with condition kms:EncryptionContext: department:finance
D.Deny s3:PutObject unless the request includes s3:x-amz-server-side-encryption: aws:kms
AnswerD

Ensures KMS encryption and denies unencrypted uploads.

Why this answer

The condition 's3:x-amz-server-side-encryption':'aws:kms' in a Deny statement ensures that only requests with SSE-KMS encryption are allowed, blocking unencrypted uploads or uploads with other encryption types. Option A is wrong because 'true' is not a valid encryption type; the correct value is 'aws:kms'. Option B is wrong because it allows SSE-S3 (AES256), not KMS encryption.

Option C is wrong because it checks a KMS encryption context rather than the encryption header, and it does not deny unencrypted uploads.

499
Matchingmedium

Match each AWS automation or configuration management tool to its description.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Operational hub for managing AWS resources at scale

Configuration management service using Chef and Puppet

PaaS for deploying and scaling web applications

Infrastructure as Code using templates

Create and manage approved IT service catalogs

Why these pairings

AWS CloudFormation is for IaC, OpsWorks for configuration management, Elastic Beanstalk for PaaS, and CodeDeploy for automated deployments. Distractors swap definitions.

500
MCQhard

A company runs a containerized application on Amazon ECS with Fargate launch type. The application experiences intermittent failures when the ECS service scheduler attempts to place tasks during a deployment. The DevOps engineer notices that tasks fail to start due to insufficient IP addresses in the VPC subnets. What is the MOST resilient solution to prevent this issue?

A.Create an ECS service-linked role with permissions to allocate IPs.
B.Increase the desired task count in the ECS service to pre-warm IP addresses.
C.Use VPC endpoints for ECS to reduce IP usage.
D.Configure the ECS service to use multiple subnets with larger CIDR blocks across multiple Availability Zones.
AnswerD

More subnets and larger CIDRs increase available IPs and resilience.

Why this answer

Using a larger CIDR block for subnets provides more IP addresses, and using multiple subnets across Availability Zones increases availability and capacity. Option A is wrong because increasing desired count does not solve IP shortage. Option B is wrong because ECS service-linked role does not affect IP allocation.

Option C is wrong because VPC endpoints do not provide IP addresses for tasks.

501
Multi-Selectmedium

A company is deploying a new microservice on AWS Lambda. The DevOps team needs to monitor the function for errors and performance issues. Which TWO steps should the team take to set up effective monitoring?

Select 2 answers
A.Enable VPC Flow Logs to monitor network traffic to the function
B.Enable AWS Config rules to evaluate the function configuration
C.Enable active tracing with AWS X-Ray to trace requests through the function
D.Enable CloudWatch Logs for the Lambda function to capture application logs
E.Install the CloudWatch Agent on the Lambda execution environment
AnswersC, D

X-Ray provides end-to-end tracing for Lambda.

Why this answer

AWS X-Ray provides end-to-end tracing for requests, allowing you to identify performance bottlenecks and errors in Lambda functions. Option D is correct because Lambda automatically sends logs to CloudWatch Logs, which capture application output, errors, and custom logging. Option A is incorrect: VPC Flow Logs monitor network traffic at the VPC level, not Lambda function internals.

Option B is incorrect: AWS Config evaluates resource configurations for compliance, not for function monitoring. Option E is incorrect: The CloudWatch Agent is for EC2 or on-premises servers; Lambda already integrates with CloudWatch Logs natively.

502
MCQmedium

Refer to the exhibit. A DevOps engineer set up a CloudWatch alarm for a Lambda function. The alarm fires when the error count metric exceeds 10 in 5 minutes. The engineer receives an alarm notification, but when checking the Lambda logs, only 3 errors are found in that 5-minute window. What is the MOST likely reason for the discrepancy?

A.The metric filter is not processing logs in real time, causing a delay.
B.The metric filter is counting errors from other log groups or sources that use the same metric name.
C.The metric filter pattern is incorrect and is matching non-error entries.
D.The Lambda function is generating more errors than shown in the logs.
AnswerB

If multiple sources publish to the same metric, the alarm sums them.

Why this answer

The metric filter might be capturing errors from other log groups that share the same metric name (ErrorCount). If multiple Lambda functions or other services publish to the same metric, the alarm could be summing across all of them. Option A is wrong because CloudWatch Logs metric filters are near real-time.

Option C is wrong because Lambda errors are counted correctly. Option D is wrong because the metric filter is correctly defined.

503
MCQmedium

A DevOps engineer is designing a CI/CD pipeline for a microservices application. The pipeline must scan container images for vulnerabilities before deploying to Amazon ECS. Which service should the engineer use to perform the vulnerability scan?

A.AWS WAF
B.Amazon ECR image scanning
C.AWS Config
D.Amazon GuardDuty
AnswerB

ECR supports vulnerability scanning for container images.

Why this answer

Amazon ECR can scan images for vulnerabilities. Option A is wrong because AWS WAF is a web application firewall. Option C is wrong because AWS Config is for compliance and resource inventory.

Option D is wrong because Amazon GuardDuty is a threat detection service for workloads.

504
MCQeasy

A company runs a containerized application on Amazon ECS with Fargate. The application needs to store session state. Which service provides the MOST resilient and scalable solution?

A.Amazon ElastiCache for Redis
B.Amazon EFS
C.Ephemeral storage on the container instance
D.Amazon S3
AnswerA

In-memory, low latency, supports replication and failover.

Why this answer

Amazon ElastiCache for Redis provides a highly available, scalable, and low-latency in-memory data store ideal for session state management in a containerized environment. It supports replication and automatic failover, ensuring resilience. Option B (Amazon EFS) is a file storage service with higher latency and not designed for sub-millisecond session retrieval.

Option C (ephemeral storage on the container instance) is not durable; data is lost when the container stops or fails. Option D (Amazon S3) is object storage with higher latency and not optimized for frequent read/write operations required for session state.

505
Multi-Selecthard

A company uses AWS KMS to encrypt data at rest in S3. The security team wants to ensure that KMS keys are rotated automatically every year. Which THREE steps should be taken?

Select 3 answers
A.Create a CloudWatch Events rule to notify the security team before the rotation date.
B.Configure an S3 bucket policy to enforce key rotation.
C.Enable automatic key rotation on the KMS key.
D.Ensure the key policy allows the kms:RotateKeyOnDemand action.
E.Create a new KMS key every year and update the application to use the new key.
AnswersA, C, E

Correct: CloudWatch Events can notify the security team before the scheduled rotation date, ensuring awareness.

Why this answer

Amazon CloudWatch Events can be configured to send a notification (e.g., via SNS or email) to the security team before the scheduled annual key rotation date, ensuring awareness of the rotation. Option B is incorrect because S3 bucket policies cannot enforce KMS key rotation; key rotation is a property of the KMS key itself. Option C is correct because enabling automatic key rotation on a symmetric KMS key causes AWS KMS to rotate the backing key annually, meeting the requirement for automated rotation.

Option D is incorrect because there is no `kms:RotateKeyOnDemand` action; automatic rotation does not require a specific key policy action, and manual rotation uses `ScheduleKeyDeletion` or creating new keys. Option E is correct because creating a new KMS key each year and updating the application to use the new key is a valid manual approach to ensure annual key rotation, fulfilling the security team's requirement to rotate keys every year.

506
MCQhard

A company runs a containerized application on Amazon EKS. The DevOps engineer needs to collect application metrics and make them available in Amazon CloudWatch. Which solution should be used?

A.Use AWS X-Ray daemon to collect metrics and send them to CloudWatch.
B.Install the Amazon CloudWatch agent as a DaemonSet on the EKS cluster.
C.Deploy the AWS Distro for OpenTelemetry collector on the EKS cluster.
D.Enable Amazon CloudWatch Container Insights using the AWS Management Console.
AnswerB

The CloudWatch agent can collect metrics and publish to CloudWatch.

Why this answer

The CloudWatch agent installed as a DaemonSet on the EKS cluster can collect container and application metrics and send them to CloudWatch. Option B is correct. Option A is incorrect because AWS X-Ray is for tracing, not metrics.

Option C is incorrect because AWS Distro for OpenTelemetry can also collect metrics but requires additional setup; the CloudWatch agent is the recommended approach. Option D is incorrect because enabling Container Insights via the console alone does not automatically collect application metrics; it requires the CloudWatch agent or a sidecar.

507
Multi-Selectmedium

A company runs a critical application on Amazon ECS with Fargate. The DevOps team wants to set up a metric to track the number of tasks running. Which TWO steps are required to achieve this? (Choose TWO.)

Select 2 answers
A.Create a CloudWatch alarm on the 'RunningTaskCount' metric.
B.Install the CloudWatch agent on the task containers.
C.Enable Container Insights for the ECS cluster.
D.Configure a CloudWatch Logs subscription filter to count tasks.
E.Create a service auto scaling target for the ECS service.
AnswersA, C

Alarm can notify on threshold.

Why this answer

Options A and C are correct. Container Insights must be enabled for the ECS cluster (C) to generate the 'RunningTaskCount' metric. Then a CloudWatch alarm can be created on that metric (A) to track the number of tasks.

Option B is incorrect because the CloudWatch agent is not needed for Fargate; metrics are provided via Container Insights. Option D is incorrect because CloudWatch Logs subscription filters are used for filtering log events, not for generating metrics. Option E is incorrect because a service auto scaling target is used for scaling, not for monitoring task count.

508
MCQeasy

A company wants to ensure its Amazon RDS DB instance is highly available with automatic failover in case of an AZ failure. Which configuration should they use?

A.Multi-AZ deployment
B.Amazon RDS Proxy
C.Single-AZ with automated backups
D.Read replicas in multiple AZs
AnswerA

Multi-AZ provides automatic failover for high availability.

Why this answer

Multi-AZ deployment provides automatic failover to a standby instance in another AZ.

509
Multi-Selecthard

A company runs a web application on EC2 instances behind an Application Load Balancer. The application is experiencing intermittent 503 errors. The DevOps team suspects that the target group's health check settings may be causing healthy instances to be marked as unhealthy. Which THREE configurations should the team review?

Select 3 answers
A.Stickiness setting
B.Health check interval
C.Healthy threshold count
D.Health check path
E.Cross-zone load balancing setting
AnswersB, C, D

Too short an interval may cause false negatives.

Why this answer

Options B, C, and D are correct. The health check interval, healthy threshold count, and health check path are all target group settings that determine if an instance is considered healthy. A misconfigured interval may cause premature failures, an incorrect threshold can mark instances unhealthy too quickly, and a wrong path may return non-2xx/3xx responses, leading to 503 errors.

Stickiness (A) and cross-zone load balancing (E) do not affect health check decisions.

510
MCQmedium

A company runs a web application on EC2 instances behind an ALB. To improve resilience, they want to automatically re-register failed instances. Which solution meets this requirement?

A.Set up a CloudWatch alarm to terminate the instance and notify an operator to re-register it.
B.Enable EC2 instance recovery and configure ALB health checks to deregister unhealthy instances.
C.Configure Auto Scaling to launch a new instance on instance failure.
D.Use Route 53 health checks to detect failure and update DNS to remove the instance.
AnswerB

EC2 instance recovery replaces the instance and ALB health checks will automatically re-register it once healthy.

Why this answer

Enabling EC2 instance recovery automatically restarts the instance on a new healthy host if the underlying hardware fails, while ALB health checks detect application-level failures and deregister unhealthy instances from the target group. This combination ensures failed instances are automatically replaced in the load balancer's rotation without manual intervention, meeting the resilience requirement.

Exam trap

The trap here is that candidates confuse EC2 instance recovery (which restarts the instance on a new host) with Auto Scaling's ability to replace instances, but the question specifically asks for re-registering the failed instance, not launching a new one.

How to eliminate wrong answers

Option A is wrong because terminating the instance and notifying an operator to re-register it introduces manual steps and does not automate re-registration; it also lacks automatic recovery. Option C is wrong because Auto Scaling launches a new instance only when the instance is terminated or fails a health check, but it does not automatically re-register the existing failed instance; it replaces it, which may not be desired if the instance can be recovered. Option D is wrong because Route 53 health checks remove the instance from DNS routing, but they do not re-register the instance with the ALB target group; they only affect DNS-level traffic distribution, not the ALB's target group membership.

511
MCQmedium

A DevOps engineer notices that an Amazon RDS for MySQL instance's CPU is consistently high during business hours. The engineer wants to identify the specific queries causing the high CPU. Which combination of services should be used to capture and analyze the queries? (Choose the best answer.)

A.Enable RDS Performance Insights and analyze the top SQL queries
B.Enable RDS Enhanced Monitoring and view metrics in CloudWatch
C.Enable AWS X-Ray tracing on the application and database
D.Enable RDS audit logs and stream them to Amazon CloudWatch Logs
AnswerA

Performance Insights identifies the top queries by CPU usage.

Why this answer

RDS Performance Insights provides a database performance tuning feature that visualizes database load and identifies the specific SQL queries causing high CPU. It captures query-level metrics such as wait events, SQL digest, and host/user information, allowing the DevOps engineer to pinpoint the exact queries responsible for the CPU spike during business hours.

Exam trap

The trap here is that candidates often confuse Enhanced Monitoring (OS-level metrics) with Performance Insights (query-level analysis), or assume audit logs or X-Ray can provide SQL-level performance data, when in fact they serve different purposes (compliance and tracing, respectively).

How to eliminate wrong answers

Option B is wrong because Enhanced Monitoring provides OS-level metrics (e.g., CPU, memory, disk I/O) but does not capture or identify individual SQL queries; it cannot show which specific queries are causing high CPU. Option C is wrong because AWS X-Ray traces application requests and can trace calls to the database, but it does not capture the actual SQL queries executed on the RDS instance; it is designed for distributed tracing, not query-level analysis. Option D is wrong because RDS audit logs record database activities (e.g., logins, schema changes) for compliance, not query performance metrics; streaming them to CloudWatch Logs does not provide the query-level CPU impact analysis needed to identify high-CPU queries.

512
Multi-Selecthard

A company uses AWS CloudFormation to manage infrastructure. They have a stack that includes a VPC, subnets, and EC2 instances. They want to update the AMI ID of an EC2 instance without causing downtime. Which TWO approaches meet this requirement?

Select 2 answers
A.Use CloudFormation stack update with 'UpdatePolicy' set to 'AutoScalingRollingUpdate' and 'MinInstancesInService' set to 0.
B.Delete the stack and recreate it with the new AMI.
C.Use a CloudFormation update with a rolling update policy on the Auto Scaling group.
D.Create a custom resource backed by a Lambda function that updates the instance using AWS Systems Manager.
E.Deploy the instances across multiple Availability Zones and update each zone separately.
AnswersC, D

Rolling updates replace instances gradually.

Why this answer

CloudFormation's Auto Scaling group rolling update policy allows you to update the launch configuration or template (which includes the AMI ID) in a controlled, rolling fashion. By setting 'MinInstancesInService' to a value greater than 0, you ensure that a minimum number of instances remain in service during the update, preventing downtime. This approach replaces instances incrementally, so the application continues to serve traffic throughout the process.

Exam trap

The trap here is that candidates often confuse the 'AutoScalingRollingUpdate' policy with a generic EC2 instance update, not realizing it only applies to Auto Scaling groups, and they may incorrectly assume that setting 'MinInstancesInService' to 0 is acceptable for zero-downtime updates.

513
MCQmedium

During a deployment using AWS CodeDeploy, the deployment fails with the error 'The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available, or some instances in your deployment group are experiencing problems.' The deployment group is configured with a minimum healthy instances of 75%. What could be the cause?

A.The deployment configuration timeout is too short.
B.The CodeDeploy service role does not have sufficient permissions.
C.The instances are not running the CodeDeploy agent.
D.More than 25% of the instances failed the deployment.
AnswerD

The minimum healthy instances threshold was breached.

Why this answer

The error message explicitly states that too many individual instances failed deployment and too few healthy instances are available. With a minimum healthy instances setting of 75%, the deployment fails when more than 25% of the instances in the deployment group fail their deployment. This is a built-in safety mechanism in AWS CodeDeploy to prevent cascading failures and ensure application availability.

Exam trap

The trap here is that candidates may confuse the 'minimum healthy instances' threshold with other deployment configuration settings like timeout values or agent health, when in fact the error message directly indicates that the threshold of 75% healthy instances was breached because more than 25% of instances failed.

How to eliminate wrong answers

Option A is wrong because a timeout that is too short would cause individual instance deployment failures, but the error message specifically points to the aggregate failure threshold being exceeded, not a timeout issue. Option B is wrong because insufficient permissions in the CodeDeploy service role would cause a different error, such as 'AccessDenied' or 'Unable to access the S3 bucket', not the specific healthy-instances threshold error. Option C is wrong because if instances were not running the CodeDeploy agent, they would appear as 'Unknown' or 'Not registered' in the deployment group, and the error would be about missing agents, not about too many failed instances relative to healthy ones.

514
MCQeasy

A company runs a critical web application on AWS. The application is deployed on EC2 instances behind an Application Load Balancer (ALB). The instances are in an Auto Scaling group across multiple Availability Zones. The company uses Amazon Route 53 for DNS with a failover routing policy. Recently, the operations team noticed that during a regional outage, the failover did not trigger as expected, and users experienced downtime. The health checks in Route 53 are configured to check the ALB endpoint. The ALB's health checks are configured to check the instances. What is the MOST likely reason the failover did not work?

A.The ALB remained healthy during the regional outage, so Route 53 did not fail over.
B.The failover routing policy requires manual intervention to switch traffic.
C.Route 53 health checks were not configured for the instance IP addresses.
D.Route 53 cannot failover to a different region when the primary endpoint is still reachable.
AnswerA

The ALB might be in a different AZ that was not affected.

Why this answer

Route 53 health checks are configured to check the ALB endpoint. During a regional outage, if the ALB itself remains healthy (e.g., the outage only affected the instances but not the ALB), the health check passes, so Route 53 does not trigger failover. This leads to users experiencing downtime because the instances behind the ALB are unhealthy, but Route 53 still directs traffic to the primary region.

Option B is incorrect because failover with Route 53 is automatic when a health check fails; no manual intervention is required. Option C is incorrect because Route 53 health checks do not need to check instance IPs; checking the ALB is sufficient for failover as long as the ALB's health reflects instance health, but in this case it doesn't. Option D is incorrect because Route 53 can failover to a different region when the primary endpoint becomes unhealthy, but the condition for failover (health check failure) was not met.

515
MCQeasy

A developer is writing an AWS CloudFormation template to create an Amazon S3 bucket. The bucket name must be unique across all AWS accounts. Which property should the developer use to ensure the name is unique?

A.Use the DeletionPolicy attribute to retain the bucket.
B.Set the BucketName property to a unique value using a parameter.
C.Use the UpdateReplacePolicy attribute to control replacement.
D.Omit the BucketName property so CloudFormation generates a unique name.
AnswerD

CloudFormation auto-generates a unique name when BucketName is not specified.

Why this answer

Omit the BucketName property so CloudFormation generates a unique name. Amazon S3 bucket names must be globally unique across all AWS accounts. If you specify a custom BucketName, you must ensure its uniqueness yourself, which is error-prone.

By omitting BucketName, CloudFormation automatically generates a unique name that includes a random suffix, guaranteeing global uniqueness. Option A (DeletionPolicy) controls what happens when the stack is deleted, not naming. Option B (setting BucketName to a unique value via parameter) still requires manual uniqueness and is not a property that ensures uniqueness automatically.

Option C (UpdateReplacePolicy) controls replacement behavior on updates, not naming. Therefore, omitting BucketName is the simplest way to ensure a unique name.

516
MCQeasy

A startup is using AWS CloudFormation to manage their infrastructure. They have a stack that creates an Amazon S3 bucket and an Amazon DynamoDB table. The stack was created successfully, but when they try to update the stack to add a new S3 bucket, the update fails with the error 'CREATE_FAILED - S3 bucket already exists'. The new bucket name is unique and does not exist. The template uses the same AWS::S3::Bucket resource type. What is the most likely cause?

A.The IAM user does not have permission to create S3 buckets.
B.The S3 bucket name was previously used and is still in the process of being deleted (bucket name not yet released).
C.The stack is in a different region than where the bucket is being created.
D.The CloudFormation template uses the wrong resource type for the bucket.
AnswerB

S3 bucket names are globally unique and not immediately released after deletion.

Why this answer

The error 'CREATE_FAILED - S3 bucket already exists' despite using a unique bucket name indicates that the bucket name was previously used and is still in a deletion state. S3 bucket names are globally unique and cannot be reused immediately after deletion; there is a waiting period for the name to be released. Option B is correct because the bucket name is not yet available.

Option A is incorrect because the IAM user likely has sufficient permissions if the bucket creation fails only during update. Option C is incorrect because the region would not cause this specific error. Option D is incorrect because the resource type is appropriate.

517
Multi-Selecthard

A company is running a microservices application on Amazon ECS with AWS Fargate. The operations team wants to collect and visualize metrics such as CPU, memory, and network utilization at the task level. Which TWO services should the team use to achieve this? (Choose TWO.)

Select 2 answers
A.Amazon Managed Service for Prometheus
B.Amazon CloudWatch Logs
C.Amazon CloudWatch
D.AWS X-Ray
E.Amazon CloudWatch Container Insights
AnswersC, E

CloudWatch stores and visualizes metrics via dashboards.

Why this answer

(Amazon CloudWatch) and Option E (Amazon CloudWatch Container Insights) are correct. Container Insights collects metrics from ECS tasks running on Fargate, and CloudWatch stores and visualizes them via dashboards. Option A (Amazon Managed Service for Prometheus) is a monitoring service but not the standard integrated solution for ECS Fargate metrics; Container Insights is the recommended approach.

Option B (Amazon CloudWatch Logs) is for logs, not metrics. Option D (AWS X-Ray) is for tracing.

518
MCQmedium

A company's production EC2 instance running a web application becomes unresponsive. The operations team checks CloudWatch metrics and sees a CPU Utilization spike to 100% for the last 10 minutes. What is the MOST efficient first step to restore service?

A.Check the instance's system logs in CloudWatch Logs to identify the root cause
B.Create an AMI of the instance and launch a new instance from that AMI
C.Reboot the EC2 instance from the AWS Management Console or CLI
D.Terminate the instance and launch a new one from the latest AMI
AnswerC

Rebooting is fast and often resolves transient issues like high CPU.

Why this answer

Rebooting the EC2 instance is the most efficient first step to restore service when the instance is unresponsive due to a CPU spike. A reboot can quickly resolve transient software issues or resource exhaustion without data loss. Option A (checking CloudWatch Logs) delays recovery—investigation should come after restoration.

Option B (creating an AMI and launching a new instance) is time-consuming and unnecessary for initial recovery. Option D (terminating and launching a new instance) risks data loss and is more drastic than rebooting.

519
MCQmedium

A development team is implementing a CI/CD pipeline using AWS CodePipeline. The pipeline has a Source stage connected to an Amazon S3 bucket, a Build stage using AWS CodeBuild, and a Deploy stage that deploys to an Amazon ECS cluster. The team notices that the pipeline fails intermittently during the Build stage with a 'BUILD_CONTAINER_UNABLE_TO_PULL_IMAGE' error. What is the most likely cause?

A.The CodeBuild project is in a different AWS Region than the CodePipeline pipeline.
B.The CodeBuild project is configured to run in a VPC without a NAT gateway, and the build image is pulled from a public registry.
C.The S3 bucket where the source code is stored has a bucket policy denying access to the CodeBuild service role.
D.The CodeBuild project does not have enough memory or vCPU allocated.
AnswerB

Without a NAT gateway, the build container cannot access the public internet to pull the image.

Why this answer

The 'BUILD_CONTAINER_UNABLE_TO_PULL_IMAGE' error in AWS CodeBuild indicates that the build environment cannot pull the specified Docker image from its registry. When a CodeBuild project is configured to run in a VPC without a NAT gateway, it lacks outbound internet access, which is required to pull images from public registries like Docker Hub or Amazon ECR public. This is the most likely cause because the error is intermittent (e.g., if the image is cached locally sometimes) and directly relates to network connectivity.

Exam trap

The trap here is that candidates often confuse VPC networking errors with permission or resource errors, overlooking that CodeBuild in a VPC without a NAT gateway blocks outbound traffic to public registries, which is a subtle but critical detail for the 'BUILD_CONTAINER_UNABLE_TO_PULL_IMAGE' error.

How to eliminate wrong answers

Option A is wrong because CodePipeline and CodeBuild can operate across different AWS Regions without causing a 'BUILD_CONTAINER_UNABLE_TO_PULL_IMAGE' error; the pipeline simply references the CodeBuild project by ARN, and cross-region pulls are handled by the build environment's network configuration, not the pipeline's region. Option C is wrong because an S3 bucket policy denying access to the CodeBuild service role would cause a 'SOURCE_STAGE' or 'DOWNLOAD_SOURCE' error, not a build container pull error, as the source artifact is fetched before the build stage begins. Option D is wrong because insufficient memory or vCPU would result in a 'BUILD_CONTAINER_MEMORY_LIMIT_EXCEEDED' or 'BUILD_TIMEOUT' error, not a container image pull failure.

520
MCQmedium

A company's incident response process requires that all changes to production resources are automatically paused when a P1 incident is declared. Which AWS service can be used to enforce this by preventing modifications to CloudFormation stacks?

A.AWS Systems Manager Change Manager
B.AWS CloudFormation StackSets with a service control policy (SCP)
C.AWS Config rules with remediation
D.AWS CloudTrail with Insights
AnswerB

A SCP can deny UpdateStack operations during an incident.

Why this answer

AWS CloudFormation StackSets with a service control policy (SCP) can prevent updates to CloudFormation stacks across accounts in an organization. Option A is incorrect because AWS Systems Manager Change Manager provides a change management workflow but does not automatically pause changes. Option C is incorrect because AWS Config rules evaluate compliance and can trigger automatic remediation but do not prevent changes from being made.

Option D is incorrect because AWS CloudTrail with Insights is used for auditing and detecting unusual API activity, not for preventing modifications.

521
MCQhard

A DevOps engineer observes the CloudWatch alarm output shown in the exhibit. The alarm is in ALARM state for instance i-0abcd1234efgh5678. The engineer checks the EC2 console and sees that the instance's CPU utilization is currently 10%. What is the MOST likely explanation?

A.The alarm is misconfigured with wrong metric
B.The threshold was set too low
C.The alarm has not yet evaluated enough low datapoints to change state
D.The CPUUtilization metric is not being emitted
AnswerC

Alarm remains ALARM until it evaluates consecutive OK datapoints.

Why this answer

The alarm is configured with EvaluationPeriods=1, meaning it requires only one high datapoint to trigger ALARM. The CPU spiked to 100% at 09:55, causing the alarm to enter ALARM state. Even though CPU utilization has since dropped to 10%, the alarm remains in ALARM until it evaluates a sufficient number of low datapoints to transition to OK.

Since only one high datapoint was needed to trigger, only one low datapoint is needed to return to OK, but the alarm may not have evaluated the latest low datapoint yet, or the alarm's state transition period may not have elapsed. Option A is wrong because the metric exists and is being emitted. Option B is wrong because the threshold is set to 90%, which is appropriate.

Option D is wrong because the CPUUtilization metric is being emitted, as evidenced by the spike.

522
Multi-Selecthard

A security team wants to automatically detect and remediate S3 buckets that are publicly accessible across multiple AWS accounts. Which solution is MOST efficient and scalable? (Choose THREE.)

Select 3 answers
A.Use AWS Trusted Advisor to check for open S3 buckets and send alerts.
B.Apply a service control policy (SCP) to deny s3:PutBucketAcl that makes buckets public.
C.Manually review each account's S3 bucket permissions weekly.
D.Use AWS Config with a managed rule to detect publicly accessible S3 buckets.
E.Use Amazon CloudWatch Events to trigger a Lambda function that remediates non-compliant buckets.
AnswersB, D, E

SCPs can prevent actions that make buckets public.

Why this answer

Options B, D, and E are correct. An SCP can centrally deny s3:PutBucketAcl actions that make buckets public, preventing public access across all accounts (B). AWS Config with the managed rule 's3-bucket-public-read-prohibited' can detect publicly accessible buckets across accounts when using an aggregator (D).

CloudWatch Events (now Amazon EventBridge) can trigger a Lambda function to automatically remediate non-compliant buckets, such as applying a bucket policy or ACL change (E). Option A (Trusted Advisor) is per-account and only alerts, not remediates; Option C (manual review) is not scalable for multiple accounts.

523
Multi-Selectmedium

A DevOps engineer is designing a monitoring solution for a multi-account AWS environment using AWS Organizations. The solution must collect logs from all accounts into a centralized Amazon S3 bucket for analysis. Which THREE steps are required to set up this centralized logging?

Select 3 answers
A.Enable VPC Flow Logs for all VPCs in every account and send them to the centralized bucket
B.Create an S3 bucket in the central logging account with bucket policies allowing cross-account writes
C.Enable AWS CloudTrail in each account and configure it to deliver logs to the centralized S3 bucket
D.Set up Amazon Kinesis Data Streams in the central account to ingest logs from all accounts
E.Configure Amazon CloudWatch Logs subscription filters to stream logs from each account to the centralized S3 bucket via Kinesis Data Firehose
AnswersB, C, E

The bucket must allow other accounts to write logs.

Why this answer

Options B, C, and E are correct. To set up centralized logging across multiple AWS accounts using AWS Organizations: B) Create an S3 bucket in the central logging account with a bucket policy that allows cross-account writes from other accounts. C) Enable AWS CloudTrail in each account and configure it to deliver logs to the centralized S3 bucket.

This captures API activity. E) Configure Amazon CloudWatch Logs subscription filters in each account to stream logs (e.g., from applications or services) to the centralized S3 bucket via Kinesis Data Firehose. Option A (VPC Flow Logs) is not required for all accounts—it can be selectively enabled.

Option D (Kinesis Data Streams) is not necessary; logs can be delivered directly to S3 via Firehose or CloudTrail.

524
MCQhard

A company uses an NLB to distribute traffic to a fleet of EC2 instances in a single Availability Zone. During a recent AWS outage in that zone, the application became completely unavailable. The company wants to achieve high availability without rearchitecting the application. Which change is MOST appropriate?

A.Use a larger instance type and enable detailed CloudWatch monitoring
B.Replace the NLB with an Application Load Balancer and enable cross-zone load balancing
C.Create an Auto Scaling group with a scheduled scaling policy to add instances during peak hours
D.Launch EC2 instances in a second Availability Zone and register them with the NLB target group
AnswerD

Distributes traffic across zones, providing high availability.

Why this answer

Registering EC2 instances in a second Availability Zone with the NLB target group allows NLB to route traffic to healthy instances across zones, providing high availability during a zone outage. Option A is incorrect because using a larger instance type and enabling detailed CloudWatch monitoring does not add redundancy across zones. Option B is incorrect because replacing NLB with an ALB still requires multi-AZ configuration to achieve high availability; cross-zone load balancing is already available on NLB.

Option C is incorrect because scheduled scaling does not protect against zone failures; it only adjusts capacity predictably.

525
MCQhard

A company uses RDS Multi-AZ with a read replica. During a failover test, the application experiences a 30-second write outage. The application uses a single DB endpoint. How can the outage be minimized?

A.Increase the instance class to improve failover performance.
B.Use RDS Proxy to handle database connections and failover.
C.Use a Route 53 weighted record with health checks to point to both instances.
D.Configure the application to use the read replica endpoint for writes.
AnswerB

RDS Proxy reduces failover impact by pooling connections and rerouting quickly.

Why this answer

RDS Proxy helps minimize write outages during failover by managing database connections efficiently. It maintains connection pools and automatically routes connections to the new primary after failover, reducing the outage window from seconds to sub-second. Option A (increasing instance class) does not affect failover time because failover duration is dominated by DNS propagation and database recovery, not instance size.

Option C (Route 53 weighted record with health checks) is not suitable because Multi-AZ failover already handles DNS updates automatically, and using a weighted record with health checks would require additional complexity and still involve DNS propagation delays. Option D (using read replica endpoint for writes) is invalid because read replicas do not accept write operations; they are read-only.

Page 6

Page 7 of 9

Page 8

All pages