Courseiva

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

1083 questions total · 15pages · All types, answers revealed

Page 12

Page 13 of 15

Page 14
901
MCQeasy

A DevOps engineer receives an alert that an EC2 instance's CPU utilization has been above 90% for the last 30 minutes. The engineer needs to investigate the root cause. Which AWS service should the engineer use to get OS-level process details and identify which process is consuming the CPU?

A.AWS Config
B.AWS CloudTrail
C.AWS Systems Manager Run Command
D.Amazon CloudWatch
AnswerC

AWS Systems Manager Run Command is part of AWS Systems Manager and lets you remotely and securely execute shell commands or PowerShell scripts on EC2 instances (and on-premises machines) via the SSM Agent. You can run a command like `ps aux` or `Get-Process` to enumerate running processes, capture output, and store it in S3 or CloudWatch Logs. Because the SSM Agent runs inside the instance as a guest process, it has direct access to OS-level state, making it the appropriate service for collecting process-level data. It also supports rate control and error handling for fleet-wide execution.

Why this answer

AWS Systems Manager Run Command allows you to run commands (e.g., 'top', 'ps') remotely on EC2 instances to obtain OS-level process details and identify which process is consuming CPU. Option A is wrong because AWS Config records configuration changes, not OS-level processes. Option B is wrong because AWS CloudTrail logs API calls, not system-level metrics.

Option D is wrong because Amazon CloudWatch provides aggregated CPU utilization metrics but cannot provide process-level details.

902
MCQmedium

A company runs a serverless application using AWS Lambda functions that process messages from an Amazon SQS queue. The function scales up to handle high traffic but sometimes experiences throttling errors (HTTP 429) from Lambda. The company wants to improve the resilience of the application by reducing throttling. The SQS queue is configured as a Lambda event source with a batch size of 10. The Lambda function has a reserved concurrency of 100. Which combination of actions will best reduce throttling? (Choose the single best answer.)

A.Change the SQS queue to use a FIFO queue to guarantee exactly-once processing.
B.Increase the SQS batch size to 50 to process more messages per invocation.
C.Use a dead-letter queue (DLQ) for unprocessed messages and set up a CloudWatch alarm to trigger a second Lambda function to reprocess them.
D.Increase the Lambda function's reserved concurrency to 500.
AnswerD

Raising the Lambda function's reserved concurrency to 500 is correct because it directly increases the maximum number of simultaneous executions, allowing the SQS event source mapping to scale out beyond the previous limit and process more messages in parallel. With a higher concurrency ceiling, incoming SQS messages are consumed faster, preventing the burst of throttling attempts that occur when the function is already running at its current cap. This aligns with Lambda's SQS scaling model, where the number of active pollers grows with the message volume until the reserved concurrency is exhausted.

Why this answer

Throttling errors (HTTP 429) occur when Lambda function invocations exceed the account-level concurrency limit or the function's reserved concurrency. By increasing the reserved concurrency from 100 to 500, the function can handle more concurrent invocations, reducing the likelihood of throttling when traffic spikes. This directly addresses the scaling bottleneck without changing the event source or message processing pattern.

Exam trap

The trap here is that candidates often confuse throttling with message processing failures and choose a dead-letter queue or batch size change, but the core issue is insufficient concurrency allocation, which only reserved concurrency adjustment can fix.

How to eliminate wrong answers

Option A is wrong because changing to a FIFO queue does not affect concurrency or throttling; FIFO queues guarantee exactly-once processing and message ordering but do not increase the invocation capacity of Lambda. Option B is wrong because increasing the batch size to 50 may reduce the number of invocations but does not prevent throttling if the reserved concurrency is still too low; it could even cause timeouts or processing delays if messages accumulate. Option C is wrong because a dead-letter queue and a second Lambda function handle failed messages after throttling occurs, but they do not prevent the initial throttling errors; they add complexity without addressing the root cause of insufficient concurrency.

903
MCQmedium

A CloudFormation template includes the following resource: MySecurityGroup: Type: AWS::EC2::SecurityGroup Properties: GroupDescription: My security group SecurityGroupIngress: - IpProtocol: tcp FromPort: 443 ToPort: 443 CidrIp: 0.0.0.0/0 MyInstance: Type: AWS::EC2::Instance Properties: ImageId: ami-0abcdef1234567890 InstanceType: t2.micro SecurityGroupIds: !Ref MySecurityGroup The stack creation fails with the error shown. What is the cause?

A.The SecurityGroupIds property must be a list, but !Ref returns a single value.
B.The SecurityGroupIds property must be a list of security group names, not IDs.
C.The security group ingress rule is invalid because it allows all traffic.
D.The ImageId is missing, so the security group validation fails first.
AnswerA

The `SecurityGroupIds` property of an EC2 instance is typed as a list of security group IDs. When you use `!Ref` on a security group resource, CloudFormation resolves it to the security group's physical ID as a single string, not an array. Because the property requires a `List<AWS::EC2::SecurityGroup::Id>`, passing a bare `!Ref` causes a type-validation failure. To fix it, you must wrap the reference in a list literal, e.g., `SecurityGroupIds: [!Ref MySecurityGroup]`, or use `Fn::Split` if composing from a string.

Why this answer

The error occurs because the `SecurityGroupIds` property expects a list of security group IDs, but the `!Ref` intrinsic function returns a single security group ID (a string), not a list. In CloudFormation, `!Ref` for a security group returns its ID as a scalar value, so wrapping it in a list (e.g., `[!Ref MySecurityGroup]`) is required to satisfy the `List<String>` type constraint.

Exam trap

The trap here is that candidates assume `!Ref` automatically returns a list when the property expects one, but CloudFormation does not coerce scalar values into lists; you must explicitly provide a list literal.

How to eliminate wrong answers

Option A is correct because `SecurityGroupIds` requires a list, and `!Ref` returns a single value. Option B is wrong because `SecurityGroupIds` expects security group IDs, not names; the `SecurityGroups` property (deprecated) expects names, but `SecurityGroupIds` explicitly requires IDs. Option C is wrong because the ingress rule allowing TCP 443 from 0.0.0.0/0 is valid; it permits HTTPS traffic from anywhere, which is a common and allowed configuration.

Option D is wrong because the `ImageId` is provided (ami-0abcdef1234567890), and even if it were missing, CloudFormation would fail with a different error (e.g., 'ImageId is required'), not a security group validation error.

904
MCQmedium

A DevOps engineer is troubleshooting an issue where an EC2 instance cannot access an S3 bucket. The instance has an IAM role attached with a policy that allows s3:GetObject. The S3 bucket policy explicitly denies access to the instance's role. What is the result?

A.Access is denied only if the bucket is encrypted
B.Access is allowed only if the instance is in the same region
C.Access is allowed because the IAM role allows it
D.Access is denied because the bucket policy explicitly denies
AnswerD

The bucket policy contains an explicit deny statement for the principal or action being attempted, and AWS IAM policy evaluation gives explicit deny statements absolute precedence over any allow statements from identity-based policies, resource-based policies, or permission boundaries. Even though the IAM role allows the s3:GetObject call, the explicit deny in the bucket policy forces the final decision to AccessDenied. This precedence is a deterministic, non-configurable part of AWS's authorization engine.

Why this answer

An explicit deny in any policy overrides any allow. The bucket policy deny takes precedence over the IAM role allow, so access is denied. Evaluation logic is that an explicit deny prevents access.

905
MCQhard

A DevOps engineer is troubleshooting an AWS CloudFormation stack that failed to create. The error message indicates that a resource 'AWS::Lambda::Function' timed out while being created. The Lambda function code is packaged as a ZIP file in Amazon S3. What is the most likely cause?

A.The Lambda function has a very short timeout (e.g., 3 seconds) configured in the function properties.
B.The Lambda function's execution role does not have permission to download the ZIP file from S3.
C.The Lambda deployment package is very large, causing the S3 download to exceed the resource creation timeout.
D.The CloudFormation service role does not have permissions to create Lambda functions.
AnswerC

If the ZIP file is exceptionally large (approaching Lambda's 50 MB compressed limit), the time CloudFormation takes to download it from S3 and create the Lambda resource can exceed the stack resource creation timeout. This manifests as a 'Resource creation timed out' error in the stack event, even though the function is valid. In contrast, a small package deploys quickly regardless of the Lambda function's configured timeout or role permissions.

Why this answer

AWS CloudFormation has a default timeout for creating resources, and if the Lambda deployment package is very large, downloading it from S3 can exceed that timeout. Option A is incorrect because the Lambda function's timeout setting (e.g., 3 seconds) applies to function execution, not to the creation process; the creation timeout is controlled by CloudFormation. Option B is incorrect because if the execution role lacks permissions to download the ZIP file, it would result in an access denied error, not a timeout.

Option D is incorrect because the CloudFormation service role permissions affect stack operations broadly, but they do not directly cause a resource-specific timeout; the timeout here is due to package size.

906
Multi-Selectmedium

A company is designing a resilient architecture for a web application that uses Amazon RDS for MySQL. The application must be able to withstand the loss of an entire AWS Region. Which TWO actions should the company take?

Select 2 answers
A.Use RDS Proxy to pool database connections.
B.Configure automated backups to be copied to another Region.
C.Enable Multi-AZ deployment for the RDS instance.
D.Create a Cross-Region Read Replica.
E.Enable deletion protection on the RDS instance.
AnswersB, D

Allows recovery from backups in another Region.

Why this answer

To withstand the loss of an entire AWS Region, the company must have a disaster recovery strategy that includes cross-region data replication. Option B is correct because copying automated backups to another Region ensures that a recoverable copy of the database exists in a different geographic area, allowing restoration in a separate Region if the primary Region fails. Option D is correct because a Cross-Region Read Replica provides a live, asynchronously replicated copy of the database in another Region, which can be promoted to a standalone primary instance during a regional outage, minimizing recovery time.

Exam trap

The trap here is that candidates often confuse Multi-AZ (which provides high availability within a Region) with cross-region disaster recovery, leading them to incorrectly select Multi-AZ as a solution for regional failure.

907
Multi-Selectmedium

A company uses AWS CodePipeline with multiple stages. The pipeline includes a Beta stage that deploys to a test environment and a Prod stage. The team wants to require manual approval before the Prod stage. Which TWO actions should be taken to implement this? (Choose TWO.)

Select 2 answers
A.Ensure that the IAM user or role performing the approval has codepipeline:PutApprovalResult permissions.
B.Use CloudWatch Events to trigger a Lambda function that requires manual sign-off.
C.Set the Prod stage to only run on manual invocation.
D.Add a manual approval action in the pipeline stage between Beta and Prod.
E.Configure a CodeCommit approval rule template to require approval before merging.
AnswersA, D

The approver needs permissions to submit the approval result.

Why this answer

The IAM user or role that performs the manual approval action in CodePipeline must have the `codepipeline:PutApprovalResult` permission. This permission allows the user to submit the approval or rejection result to the pipeline, which is required to advance the pipeline to the Prod stage. Without this permission, the approval action cannot be completed, and the pipeline will remain stuck.

Exam trap

The trap here is that candidates often confuse manual approval actions with other approval mechanisms like CodeCommit approval rules or Lambda-based automation, but CodePipeline's manual approval is a distinct action type that requires explicit IAM permissions and a human-in-the-loop step.

908
MCQhard

Refer to the exhibit. A developer runs the AWS CLI command to start a build in AWS CodeBuild. The build project 'my-project' uses an S3 bucket as the source. What is the MOST likely cause of the error?

A.The CodeBuild service role does not have s3:GetObject permission on the source bucket.
B.The S3 bucket name is misspelled in the build project configuration.
C.The developer's IAM user does not have s3:GetObject permission.
D.The S3 bucket is in a different region than the CodeBuild project.
AnswerA

The CodeBuild service role is the IAM role that the build service assumes at runtime to perform actions on your behalf, including fetching source code from Amazon S3. If the role's attached policy lacks an s3:GetObject action on the source bucket, the build start fails with an AccessDenied error that names the role. This is the correct diagnosis because CodeBuild's access to source objects is governed entirely by the service role, not by the caller's user-level S3 permissions.

Why this answer

The error occurs because CodeBuild needs to download the source code from the S3 bucket during the build. The CodeBuild service role, not the developer's IAM user, makes the s3:GetObject API call to retrieve the source object. Without this permission on the service role, the build fails with an access denied error.

Exam trap

The trap here is that candidates confuse the developer's IAM permissions with the CodeBuild service role's permissions, assuming the developer's credentials are used for all actions, when in fact CodeBuild uses its own role for resource access.

How to eliminate wrong answers

Option B is wrong because a misspelled bucket name would cause a 'NoSuchBucket' error, not an access denied error. Option C is wrong because the developer's IAM user only needs permission to start the build (codebuild:StartBuild), not to read the source directly; the service role handles S3 access. Option D is wrong because CodeBuild can access S3 buckets in any region as long as the bucket policy and service role permissions allow cross-region access; there is no regional restriction for S3 sources in CodeBuild.

909
MCQeasy

A DevOps engineer is tasked with setting up monitoring for a serverless application that uses AWS Lambda, Amazon API Gateway, and Amazon DynamoDB. The engineer needs to create a centralized dashboard that displays the number of Lambda invocations, API Gateway request counts, and DynamoDB consumed read/write capacity units. The dashboard should be accessible to the operations team without requiring AWS Management Console login. The engineer also wants to set up email alerts when the DynamoDB consumed capacity exceeds 80% of the provisioned capacity. Which solution meets these requirements with the LEAST operational overhead?

A.Use Amazon QuickSight to connect to CloudWatch metrics and create a dashboard with email alerts.
B.Use CloudWatch Logs Insights to query the logs of each service and create a dashboard from the results.
C.Create a CloudWatch dashboard and share it using Amazon Cognito to grant access to the operations team.
D.Create a CloudWatch dashboard with the relevant metrics and set CloudWatch alarms on DynamoDB consumed capacity. Share the dashboard as a public read-only dashboard.
AnswerD

This is the correct solution because CloudWatch natively supports creating dashboards that display multiple operational metrics, and alarms on DynamoDB consumed capacity can be configured to trigger SNS notifications (e.g., email) when thresholds are exceeded. The dashboard can be shared as a public read-only dashboard using the CloudWatch console's 'Share' feature, which generates a URL that grants view-only access without requiring IAM credentials or Cognito. This directly addresses both the need for at-a-glance monitoring and threshold-based alerting on DynamoDB capacity, making it the most operationally sound and low-overhead option.

Why this answer

CloudWatch Dashboards can be shared publicly as a read-only dashboard without requiring AWS credentials. The metrics for Lambda, API Gateway, and DynamoDB are automatically available in CloudWatch, and no additional setup is needed. Alarms can be set on DynamoDB's ConsumedReadCapacityUnits and ConsumedWriteCapacityUnits metrics to trigger email alerts via SNS.

Option A (QuickSight) is incorrect because it requires additional setup and cost, and is not the simplest approach for this use case. Option B (CloudWatch Logs Insights) is incorrect because it is designed for querying log data, not for creating a metrics dashboard; it would not directly display the required metrics. Option C is incorrect because sharing a CloudWatch dashboard does not require Amazon Cognito; dashboards can be shared via a public URL without additional authentication mechanisms.

910
MCQmedium

An S3 bucket has the above bucket policy. What is the effect of this policy?

A.It allows anonymous access to the bucket over HTTPS
B.It denies all access to the bucket regardless of protocol
C.It denies access to the bucket if the request is not sent over HTTPS
D.It allows access only from specific IP addresses
AnswerC

This statement uses 'Deny' with the condition 'aws:SecureTransport': 'false', meaning that any time S3 sees a request to this bucket that did not use TLS/SSL, the condition is satisfied and the explicit deny applies, causing the request to be rejected. HTTPS requests have SecureTransport set to true, so they are not affected by this particular statement and may be allowed or denied based on other applicable policies. This is a standard pattern to enforce HTTPS-only access to S3 buckets.

Why this answer

The bucket policy denies all S3 actions when the request is not sent over HTTPS (i.e., when aws:SecureTransport is false). Therefore, the policy enforces HTTPS for all access to the bucket. Option C correctly states this effect.

Option A is incorrect because the policy does not allow anonymous access; it only denies non-HTTPS requests. Option B is incorrect because the policy does not deny all access; it only denies requests that are not HTTPS. Option D is incorrect because the policy does not reference IP addresses.

911
MCQmedium

Refer to the exhibit. A DevOps engineer created an IAM role 'MyLambdaRole' for a Lambda function. The Lambda function needs to write logs to CloudWatch Logs. However, the function is not able to create log streams. What is the most likely missing configuration?

A.The role name is not prefixed with 'AWSLambda'.
B.The role does not have an inline or managed policy that grants permissions for CloudWatch Logs.
C.The role ARN is incorrectly formatted.
D.The trust policy does not allow Lambda to assume the role.
AnswerB

The correct issue is that this Lambda execution role lacks any inline or managed policy granting the required CloudWatch Logs permissions. Without a policy allowing logs:CreateLogGroup, logs:CreateLogStream, and logs:PutLogEvents, Lambda cannot write execution logs to CloudWatch, even though the trust policy is valid. This will cause runtime failures or missing log output, and is a common misconfiguration.

Why this answer

The IAM role must have an inline or managed policy that grants permissions for CloudWatch Logs actions such as logs:CreateLogStream and logs:PutLogEvents. Option A is incorrect because the role name does not need a prefix; the trust policy is what matters. Option C is incorrect because the role ARN format does not affect log stream creation.

Option D is incorrect because the trust policy allowing Lambda to assume the role is separate from the permissions to write logs; the question states the function is not able to create log streams, which indicates a permissions issue within the role's policies.

912
MCQhard

A company uses AWS CodePipeline to deploy a web application to an Auto Scaling group. The security team requires that all artifacts in the pipeline be encrypted at rest. The pipeline uses an S3 bucket as the artifact store. Which combination of actions should the DevOps engineer take to meet this requirement with minimal operational overhead?

A.Use AWS Certificate Manager to encrypt the artifacts.
B.Enable S3 default encryption with SSE-S3 on the artifact bucket.
C.Use an AWS Lambda function to encrypt artifacts after each pipeline stage.
D.Create a customer-managed KMS key and configure the pipeline to use it for artifact encryption.
AnswerB

Enabling S3 default encryption with SSE-S3 on the CodePipeline artifact bucket automatically encrypts every object with 256-bit AES keys managed by Amazon S3. This is the simplest native approach: once enabled, you need no key management, no pipeline role changes, and no application code modifications. CodePipeline writes artifacts as normal S3 PUTs, so the bucket-level default encryption covers all stages and runs with zero overhead.

Why this answer

Enabling S3 default encryption with SSE-S3 on the artifact bucket is the simplest way to encrypt all objects at rest with minimal operational overhead. SSES3 uses S3-managed keys, requiring no additional key management or permissions. Option A is wrong because AWS Certificate Manager provides TLS certificates, not encryption for S3 objects.

Option C is wrong because using a Lambda function to encrypt artifacts after each stage adds unnecessary complexity and does not automatically encrypt all artifacts, especially existing ones. Option D is wrong because creating a customer-managed KMS key introduces additional overhead for key management and permissions, which is not minimal.

913
MCQmedium

A company has a multi-account AWS environment using AWS Organizations. The security team wants to enforce that all unused IAM users are automatically identified and removed after 90 days of inactivity. What is the MOST effective solution?

A.Use the IAM credential report to review last activity dates and manually delete users.
B.Enable CloudTrail Insights to detect inactive users and send alerts.
C.Use an AWS Config rule to detect IAM users and trigger a Lambda function to delete them after 90 days.
D.Use IAM Access Analyzer to generate findings for unused access and automate user removal with a Lambda function.
AnswerD

IAM Access Analyzer's ‘Unused access' findings are purpose-built for this exact scenario: it continuously analyzes IAM roles, users, and access keys, and when a resource has not been used for a configurable period (e.g., 90 days), it generates a detailed finding containing the resource ARN, the last-accessed timestamp, and the action. You can configure Amazon EventBridge to capture these findings as they are emitted and invoke an AWS Lambda function that automatically deletes or disables the IAM user, providing a fully automated, scalable, and auditable lifecycle policy. Access Analyzer relies on IAM's internal service-last-accessed data, which includes console logins, API calls, and programmatic access, making it more comprehensive than the credential report. This approach also supports multiple accounts when combined with AWS Organizations delegated administration, enabling centralized unused-access management.

Why this answer

The most effective solution is using IAM Access Analyzer (Option D) because it continuously monitors and generates findings for unused IAM roles and users, and those findings can be used to trigger automated remediation via AWS Lambda, integrating with AWS Organizations to manage multi-account environments. Option A is incorrect because the IAM credential report only provides a point-in-time snapshot and requires manual review, which is not scalable. Option B is incorrect because CloudTrail Insights detects unusual API activity but does not specifically identify inactive IAM users by their last activity; it requires custom analysis to determine inactivity.

Option C is incorrect because although an AWS Config rule can detect IAM users, Config rules are not designed to evaluate inactivity based on last login or API calls; they would require custom logic and periodic evaluations, and the suggested approach of directly deleting users via Lambda after 90 days is risky without confirmation of inactivity. IAM Access Analyzer provides specific findings about unused access, which is exactly what is needed to automate the identification and removal of unused IAM users after 90 days of inactivity.

914
MCQeasy

A DevOps engineer wants to ensure that all EC2 instances launched in an AWS account automatically have a specific set of tags applied for cost allocation. Which AWS service should they use to enforce this?

A.AWS Service Catalog
B.AWS Config
C.Amazon EC2 Auto Scaling
D.AWS CloudFormation
AnswerB

AWS Config is the correct choice because it provides a continuous, account-wide compliance evaluation of resource configurations. You can use the managed AWS Config rule 'required-tags' (or a custom Lambda-backed rule) to check that every EC2 instance has the mandatory tags, and the rule can be paired with an auto-remediation action, such as an SSM Automation document, to automatically add missing tags. Since AWS Config records every EC2 instance as a configuration item and re-evaluates on configuration changes, it can both detect and enforce tag compliance for all existing and newly launched instances, regardless of how they were created.

Why this answer

AWS Config is correct because it can enforce tagging rules through managed rules like `required-tags` or custom AWS Config rules using AWS Lambda. When an EC2 instance is launched without the required tags, AWS Config can evaluate the resource against the rule and trigger remediation actions (e.g., via AWS Systems Manager Automation) to automatically apply the tags or flag non-compliance. This ensures consistent cost allocation tagging across all instances without manual intervention.

Exam trap

The trap here is that candidates confuse AWS Config's evaluation and remediation capabilities with the tagging features of EC2 Auto Scaling or CloudFormation, mistakenly thinking those services can enforce tags on all instances account-wide, when they only apply to resources they directly manage.

How to eliminate wrong answers

Option A is wrong because AWS Service Catalog is used to create and manage a catalog of approved IT services (e.g., pre-configured EC2 instances), but it does not enforce tagging on instances launched outside its portfolio or retroactively. Option C is wrong because Amazon EC2 Auto Scaling can apply tags to instances it launches via launch templates or configurations, but it cannot enforce tags on instances launched directly via the EC2 console, API, or other services. Option D is wrong because AWS CloudFormation can apply tags to resources it creates, but it cannot enforce tagging on resources created outside of a CloudFormation stack, such as manually launched EC2 instances.

915
MCQeasy

A company uses AWS CloudFormation to manage infrastructure. The DevOps team wants to deploy a stack across multiple accounts using AWS CodePipeline. Which approach is BEST for automating cross-account deployments?

A.Use AWS CloudFormation StackSets to deploy the stack across accounts.
B.Create a separate pipeline in each account and trigger them manually.
C.Use a single pipeline in the management account with IAM roles that assume cross-account roles.
D.Use an S3 bucket with cross-account access and Lambda to invoke CloudFormation.
AnswerC

A single pipeline in the management account leverages CodePipeline's native cross-account support by assuming an IAM role in the target account for the deployment action. The pipeline uses KMS customer-managed keys to encrypt artifacts, and each target account's role restricts the pipeline to deploy only the intended stack. This centralizes visibility and approval while keeping every account's permissions scoped, making it the recommended pattern for multi-account infrastructure delivery.

Why this answer

AWS CodePipeline can assume an IAM role in the target account (via a cross-account role) to perform CloudFormation deployments. This allows a single pipeline in the management account to automate deployments across multiple accounts without manual triggers or separate pipelines, adhering to the principle of least privilege and centralized control.

Exam trap

The trap here is that candidates often confuse AWS CloudFormation StackSets (Option A) as the best automation tool for CI/CD pipelines, but StackSets lack the sequential orchestration, approval gates, and source stage integration that CodePipeline provides for cross-account deployments.

How to eliminate wrong answers

Option A is wrong because AWS CloudFormation StackSets are designed for deploying identical stacks across multiple accounts and regions from a single admin account, but they lack native integration with CodePipeline for step-by-step CI/CD orchestration, approval gates, and source stage triggers. Option B is wrong because creating separate pipelines in each account and triggering them manually defeats the purpose of automation and introduces operational overhead and inconsistency. Option D is wrong because using an S3 bucket with cross-account access and Lambda to invoke CloudFormation is an overly complex, brittle approach that bypasses CodePipeline's built-in cross-account role assumption mechanism, increasing maintenance burden and security risk.

916
Multi-Selecteasy

A company is using AWS CloudTrail to log API activity in their AWS account. They want to ensure that any modification to CloudTrail configuration itself is logged and that the logs are immutable. Which combination of actions should they take? (Choose TWO.)

Select 2 answers
A.Enable S3 Object Lock on the destination S3 bucket in governance mode.
B.Enable log file validation to guarantee integrity of log files.
C.Disable log file validation to reduce overhead.
D.Store CloudTrail logs in a CloudWatch Logs log group with a retention policy.
E.Enable CloudTrail Insights to detect configuration changes.
AnswersA, B

Enabling S3 Object Lock on the destination S3 bucket is the correct way to make CloudTrail logs immutable. In governance mode, you can set a retention period and object lock protects objects from being deleted or overwritten by any user—including the AWS account root user—unless they have the `s3:BypassGovernanceRetention` permission. This ensures that the audit log remains intact for the duration of the retention period, satisfying compliance mandates that require unauditable log preservation.

Why this answer

Enabling S3 Object Lock in governance mode on the destination S3 bucket prevents any user, including the root user, from overwriting or deleting CloudTrail log objects during the retention period, ensuring immutability. Option B is correct because enabling log file validation creates a digest file that uses SHA-256 hashing to verify that log files have not been modified, deleted, or tampered with after delivery, providing integrity assurance.

Exam trap

The trap here is that candidates often confuse CloudTrail Insights (which detects configuration changes) with the actual mechanisms for ensuring log immutability and integrity, leading them to select option E instead of the correct combination of S3 Object Lock and log file validation.

917
MCQmedium

A company uses a third-party backup solution to back up its EC2 instances daily. The backups are stored in an S3 bucket with default settings. The company wants to ensure that backups are protected from accidental deletion and are available for at least one year. Which combination of S3 features should the DevOps engineer implement?

A.Enable MFA Delete and set a lifecycle policy to transition to S3 Glacier after 30 days.
B.Enable versioning and set a lifecycle policy to expire noncurrent versions after 365 days.
C.Enable cross-Region replication to a bucket with versioning enabled.
D.Enable S3 Object Lock with Governance mode and a retention period of 365 days, and set a lifecycle policy to transition to S3 Glacier Deep Archive after 30 days.
AnswerD

S3 Object Lock with Governance mode applies a Write-Once-Read-Many (WORM) policy that guarantees the backup objects cannot be modified or deleted by any ordinary user—even an account administrator with full S3 access—until the 365-day retention period expires. Governance mode does allow users with the s3:BypassGovernanceRetention permission to override the lock if needed, but a typical backup scenario doesn't grant that to regular IAM roles, so the data remains immutable for the entire year. Pairing this with a lifecycle rule that transitions the objects to S3 Glacier Deep Archive after 30 days satisfies both the need for protection and cost efficiency: the transition preserves Object Lock metadata and the object stays protected through the transition, after which Storage Costs drop to the lowest tier while retention still applies for the remaining 335 days.

Why this answer

S3 Object Lock with Governance mode prevents objects from being deleted or overwritten by any user (including the root user) for the specified retention period of 365 days, meeting the one-year availability requirement. The lifecycle policy to transition to S3 Glacier Deep Archive after 30 days reduces storage costs while still keeping the data accessible for retrieval within 12 hours, which is acceptable for backup retention. This combination ensures immutability and cost-effective long-term storage.

Exam trap

The trap here is that candidates often confuse versioning with immutability, assuming that versioning alone prevents deletion, but versioning only creates multiple versions and does not prevent the current version from being deleted (it becomes a delete marker), whereas S3 Object Lock provides true immutability by preventing any deletion or overwrite during the retention period.

How to eliminate wrong answers

Option A is wrong because MFA Delete only protects against accidental deletion of objects and versioning suspension, but it does not enforce a minimum retention period or prevent overwrites, so backups could still be deleted after the MFA-authenticated action. Option B is wrong because versioning with expiration of noncurrent versions after 365 days does not prevent deletion of the current version; a user could delete the current version (which becomes a delete marker), and the noncurrent versions would expire after 365 days, but the data could be lost before that if the delete marker is not handled. Option C is wrong because cross-Region replication to a bucket with versioning enabled provides redundancy but does not protect against accidental deletion in the source bucket; if an object is deleted in the source, the replication delete marker is replicated, and the destination bucket may also lose the object unless additional safeguards like S3 Object Lock are used.

918
MCQmedium

Refer to the exhibit. An IAM policy is attached to an EC2 instance role. The application on the instance is unable to send logs to CloudWatch Logs. The log group 'MyAppLogs' exists in the same account and region. What is the most likely reason for the failure?

A.The resource ARN is incorrect; it should include the log stream name.
B.The log group does not exist in the specified region.
C.The policy does not allow the logs:PutLogEvents action.
D.The policy is missing permissions to create log streams.
AnswerD

This is the correct cause. When an application writes log events to CloudWatch Logs, it must have an existing log stream; if the stream does not exist, the client (such as the AWS SDK or CloudWatch agent) first calls logs:CreateLogStream. The IAM policy grants only logs:PutLogEvents, so the implicit or explicit CreateLogStream call is denied, causing the overall write operation to fail. To resolve it, the policy must additionally allow logs:CreateLogStream, and possibly logs:DescribeLogStreams, on the same log group and stream resources.

Why this answer

The policy only allows the logs:PutLogEvents action, but the application also needs permissions to create log streams (logs:CreateLogStream) and possibly describe them (logs:DescribeLogStreams). Since the log group exists, the first log delivery attempt requires creating a log stream, which is not allowed by the policy. Therefore, the most likely reason is that the policy is missing permissions to create log streams, making option D correct.

919
MCQeasy

A developer wants to grant an EC2 instance read-only access to a specific S3 bucket. Which AWS mechanism should they use to securely provide credentials to the instance?

A.Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables in the AMI.
B.Create an IAM role with the required permissions and attach it to the EC2 instance as an instance profile.
C.Store AWS access keys in the EC2 user data script.
D.Retrieve the credentials from AWS Systems Manager Parameter Store using a custom script.
AnswerB

An IAM role attached as an instance profile is the AWS-recommended mechanism because the EC2 instance automatically assumes the role through the instance metadata service (IMDS), receiving temporary credentials from AWS STS that are valid for a limited duration and refreshed automatically by the SDK or CLI. This eliminates the need to store or manage long-lived access keys while letting you scope the role with a narrowly defined read-only policy, such as allowing only s3:GetObject or ec2:DescribeActions. The instance profile acts as the container for the role, and the per-instance trust policy ensures only instances with that profile can use the role, giving centralized control, easy revocation, and cross-account access when needed.

Why this answer

IAM roles with instance profiles provide temporary, automatically rotated credentials to EC2 instances via the AWS STS service. This eliminates the need to hardcode or store long-term access keys on the instance, adhering to the principle of least privilege and improving security posture.

Exam trap

The trap here is that candidates may think storing credentials in user data or an AMI is acceptable for automation, but the exam emphasizes that any static, long-term credentials on an instance are insecure and violate AWS best practices, whereas IAM roles provide secure, temporary, and automatically rotated credentials.

How to eliminate wrong answers

Option A is wrong because embedding AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in an AMI creates static, long-term credentials that are difficult to rotate, can be exposed if the AMI is shared or copied, and violate security best practices. Option C is wrong because storing access keys in EC2 user data is insecure—user data is visible to anyone with access to the instance metadata (e.g., via http://169.254.169.254/latest/user-data) and keys are not automatically rotated. Option D is wrong because while Systems Manager Parameter Store can store credentials, it requires the instance to have an IAM role or static keys to retrieve them, and it does not natively provide automatic credential rotation or direct integration with EC2's credential provider chain; a custom script adds complexity and potential security gaps.

920
MCQmedium

A company is using AWS CloudFormation to deploy infrastructure. An engineer needs to ensure that any changes to the production stack are reviewed and approved before they are applied. The engineer also wants to prevent unauthorized changes. Which solution should the engineer implement?

A.Use CloudFormation StackSets to manage the production stack across multiple accounts.
B.Use CloudFormation Change Sets and require manual approval to execute the change set.
C.Use AWS Service Catalog to create a product for the stack and require approval for any portfolio changes.
D.Use AWS CodePipeline to deploy the stack and require manual approval at the deploy stage.
AnswerB

Change Sets allow you to review proposed changes before applying them.

Why this answer

CloudFormation Change Sets allow you to preview how proposed changes to a stack will impact running resources before you apply them. By requiring manual approval to execute the change set, the engineer ensures that all modifications are reviewed and approved, preventing unauthorized changes. This directly meets the requirement for a review-and-approval workflow without introducing unnecessary complexity.

Exam trap

The trap here is that candidates often confuse the purpose of StackSets (multi-account deployment) or CodePipeline (CI/CD pipeline) with the need for a simple change review mechanism, overlooking the direct and built-in capability of CloudFormation Change Sets to preview and require approval before applying changes.

How to eliminate wrong answers

Option A is wrong because CloudFormation StackSets are designed to deploy stacks across multiple accounts and regions, not to enforce a review-and-approval workflow for changes to a single production stack. Option C is wrong because AWS Service Catalog products and portfolio changes control the provisioning of pre-defined templates, not the approval of changes to an already-deployed stack; it does not provide a change review mechanism for existing stacks. Option D is wrong because while CodePipeline can include a manual approval stage, it is a CI/CD orchestration tool that adds unnecessary overhead and complexity for a simple change review requirement; CloudFormation Change Sets provide a more direct and lightweight solution.

921
Multi-Selectmedium

A company uses AWS CodeCommit as a source repository and AWS CodeBuild for building artifacts. The DevOps team wants to ensure that all commits to the main branch trigger a build. Which steps should be taken? (Choose THREE.)

Select 3 answers
A.Configure the CodeBuild project to use the CodeCommit repository as the source and specify the main branch
B.Configure a webhook in the CodeCommit repository to notify CodeBuild
C.Create a CloudWatch Events rule that listens for CodeCommit repository state changes on the main branch
D.Set the CodeBuild project's trigger to use the CloudWatch Events rule
E.Use AWS CodeDeploy to trigger the build on commits
AnswersA, C, D

The CodeBuild project must be explicitly configured to use the CodeCommit repository as its source and to specify the main branch as the source version. This ensures the build fetches the latest code from that branch whenever a build is initiated, whether manually or via an event. Without this configuration, CodeBuild would have no source to use, so this is a prerequisite that makes the other correct answers functional.

Why this answer

Configuring the CodeBuild project to use the CodeCommit repository as the source and specifying the main branch ensures that CodeBuild knows which repository and branch to monitor for changes. This is the foundational step that links the source code to the build project, enabling automated builds when commits are pushed to the main branch.

Exam trap

The trap here is that candidates confuse CodeCommit's lack of native webhook support with other Git providers, leading them to select Option B, or they mistakenly think CodeDeploy can trigger builds instead of deployments.

922
Multi-Selecthard

A DevOps engineer is investigating a performance issue with an Amazon RDS for MySQL instance. The engineer has enabled Performance Insights and CloudWatch Enhanced Monitoring. Which THREE metrics should the engineer examine to identify whether the issue is due to a resource bottleneck? (Choose THREE.)

Select 3 answers
A.ReadLatency from CloudWatch.
B.FreeableMemory from Enhanced Monitoring.
C.CPUUtilization from Enhanced Monitoring.
D.ReadIOPS from Enhanced Monitoring.
E.DatabaseConnections from Enhanced Monitoring.
AnswersB, C, D

FreeableMemory from Enhanced Monitoring directly reflects memory availability from the DB instance OS perspective. When this value remains consistently low, the database may be forced to use swap or evict cache, causing increased read latency and degraded throughput. It is a correct metric because memory pressure is a common root cause of performance degradation, and Enhanced Monitoring reports this OS-level counter with per-second granularity.

Why this answer

The correct metrics to examine for resource bottlenecks are FreeableMemory (memory), CPUUtilization (CPU), and ReadIOPS (disk I/O) from Enhanced Monitoring. These directly indicate whether the instance is constrained by memory, CPU, or disk throughput. ReadLatency (A) is a database performance metric rather than a resource metric, and DatabaseConnections (E) is a connection count metric, not a resource bottleneck indicator.

923
MCQhard

An organization uses AWS CloudFormation StackSets to deploy resources across multiple accounts. They notice that a stack instance in one account is in a 'FAILED' status because of a permissions issue. After fixing the permissions, what is the most efficient way to retry the stack instance operation?

A.Manually create the stack in the failed account using the same template.
B.Use the 'Update stack instances' operation for the failed target account.
C.Update the entire stack set to retry all stack instances.
D.Delete the stack instance from the stack set and add it again.
AnswerB

The 'Update stack instances' operation is the correct remediation because it targets only the specific stack instance that failed inside the target account/region. CloudFormation StackSets treats a failed stack instance as an operation that can be retried without affecting other stack instances or the stack set definition. This operation re-invokes the deployment logic for that single instance, allowing transient issues such as permission timeouts or resource contention to resolve while preserving the centralized management model.

Why this answer

StackSets allow you to update stack instances individually; you can retry the specific failed instance without affecting others. Option A is wrong because updating the entire stack set would affect all accounts, which is inefficient. Option C is wrong because deleting and recreating the stack instance is disruptive.

Option D is wrong because manual stack creation outside StackSets defeats the purpose.

924
Multi-Selectmedium

A DevOps engineer is troubleshooting a failed CodePipeline execution. The pipeline has a source stage from CodeCommit, a build stage using CodeBuild, and a deploy stage using CodeDeploy. The build stage succeeds, but the deploy stage fails with 'No deployments found for the specified deployment group.' Which TWO actions should the engineer take to resolve this?

Select 2 answers
A.Update the IAM role for CodePipeline to allow it to list deployment groups.
B.Confirm that the CodeDeploy deployment group exists in the same AWS Region as the pipeline.
C.Check the CodeBuild build logs for errors.
D.Verify that the deploy stage in CodePipeline is configured with the correct deployment group name.
E.Ensure the CodeCommit repository has a valid commit.
AnswersB, D

CodePipeline and CodeDeploy are regional services. When a pipeline deploys to a CodeDeploy deployment group, the pipeline's deploy action resolves that group by name within the same AWS Region where the pipeline is running. If the deployment group exists only in a different region, the action cannot find it and fails with a 'deployment group not found' error. This is a common cause, especially when copying pipeline templates across regions without recreating the deployment stack. You must either create the deployment group in the same region as the pipeline or configure a cross-region action with a corresponding artifact bucket in the target region.

Why this answer

CodePipeline and CodeDeploy must operate in the same AWS Region. If the deployment group is in a different Region, CodePipeline cannot find it, resulting in the 'No deployments found' error. This is a common cross-Region misconfiguration that prevents the deploy stage from locating the specified deployment group.

Exam trap

The trap here is that candidates often assume the error is due to IAM permissions (Option A) or source issues (Option E), when the real cause is a Region mismatch or a misconfigured deployment group name in the pipeline definition.

925
Multi-Selectmedium

A company is experiencing a DDoS attack on their web application hosted on Amazon EC2 behind an Application Load Balancer (ALB). The attack is causing high CPU utilization on the instances. The security team needs to mitigate the attack with minimal disruption to legitimate users. Which TWO actions should the team take? (Choose two.)

Select 2 answers
A.Configure AWS WAF rate-based rules to block excessive requests from specific IP addresses.
B.Enable AWS Shield Advanced on the ALB for additional DDoS protection.
C.Enable VPC Flow Logs to analyze traffic patterns and identify the source of the attack.
D.Scale up the EC2 instances by increasing their instance size.
E.Place an Amazon CloudFront distribution in front of the ALB to cache content.
AnswersA, C

AWS WAF rate-based rules track the number of requests from each client IP over a rolling evaluation window (typically 5 minutes) and, when a configured threshold is exceeded, automatically block that IP for a specified duration. This provides immediate, in-place mitigation on the existing ALB without DNS changes, making it the fastest L7 DDoS countermeasure. You can tune the rate limit and scope (e.g., by URI or session) to allow legitimate bursts while dropping attack traffic.

Why this answer

AWS WAF rate-based rules are designed to automatically block IP addresses that exceed a specified request rate, which directly mitigates DDoS attacks by limiting excessive traffic from specific sources. This approach minimizes disruption to legitimate users because it only blocks IPs that exceed the threshold, preserving access for normal traffic patterns.

Exam trap

The trap here is that candidates often confuse AWS Shield Advanced as a direct mitigation for application-layer DDoS attacks, when it primarily protects against infrastructure-layer attacks (e.g., SYN floods) and requires WAF for application-layer control.

926
Multi-Selectmedium

An organization uses AWS CodePipeline to deploy a static website to Amazon S3. The pipeline has a source stage (CodeCommit), a build stage (CodeBuild that minifies assets), and a deploy stage (S3 deployment). The team wants to add a stage for running security vulnerability scans on the code. Which TWO options are viable?

Select 2 answers
A.Add a custom action in the pipeline that invokes a third-party scanning service via AWS Lambda.
B.Enable AWS Shield Advanced to scan for vulnerabilities.
C.Use Amazon Inspector to scan the source code.
D.Add an S3 event notification to trigger a Lambda function that scans the S3 bucket.
E.Modify the buildspec in the build stage to include commands that run security scanning tools.
AnswersA, E

CodePipeline’s custom-action framework lets you define a stage gate backed by a Lambda function that calls your third-party scanner; the Lambda uses the job worker API (e.g., PutJobSuccessResult/PutJobFailureResult) to report the scan outcome, failing the stage if vulnerabilities are found. This approach is ideal when the scanning vendor doesn't have a built-in action provider and you need the scan to happen at a specific point in the pipeline before deployment.

Why this answer

AWS CodePipeline supports custom actions that can invoke external services via AWS Lambda. By creating a custom action, the team can integrate a third-party security scanning service directly into the pipeline, allowing the scan to run as a distinct stage between build and deploy. This approach ensures that the pipeline fails if vulnerabilities are detected, preventing insecure code from reaching the S3 bucket.

Exam trap

The trap here is that candidates may confuse Amazon Inspector (which scans runtime environments) with a source code scanner, or assume that Shield Advanced provides vulnerability scanning, when in fact it only mitigates DDoS attacks.

927
Multi-Selectmedium

Which TWO AWS services can be used to monitor and detect unauthorized access to AWS resources? (Choose two.)

Select 2 answers
A.AWS Shield
B.Amazon GuardDuty
C.Amazon Inspector
D.AWS CloudTrail
E.AWS Config
AnswersB, D

Amazon GuardDuty is a continuous threat detection service that ingests and analyzes AWS CloudTrail management and data events, VPC Flow Logs, and DNS query logs. Using machine learning, anomaly detection, and integrated threat intelligence, it identifies reconnaissance, credential compromise, crypto-mining, and other unauthorized behavior. GuardDuty generates prioritized findings in the console and can trigger automated responses via Amazon EventBridge. Because it actively correlates across logs, it directly fulfills the 'monitor and detect unauthorized access' requirement.

Why this answer

Amazon GuardDuty is a threat detection service that continuously monitors for malicious or unauthorized behavior by analyzing VPC Flow Logs, DNS logs, and AWS CloudTrail management and data events. It uses machine learning and integrated threat intelligence to detect anomalies such as unusual API calls, crypto-mining activity, or compromised credentials, making it a correct choice for detecting unauthorized access.

Exam trap

The trap here is that candidates often confuse AWS Config (which tracks configuration changes) with a security monitoring service, but Config does not analyze logs or detect unauthorized access; it only records resource state changes and evaluates compliance rules.

928
MCQeasy

A company is using AWS CodeCommit for source control and wants to automatically trigger a build in AWS CodeBuild whenever a pull request is created against the main branch. Which AWS service should be used to connect CodeCommit events to CodeBuild?

A.AWS CodePipeline
B.Amazon EventBridge
C.AWS Lambda
D.Amazon Simple Notification Service (SNS)
AnswerB

Amazon EventBridge is the native event-delivery service for AWS and CodeCommit automatically publishes repository events—such as referenceCreated, referenceUpdated, and referenceDeleted—as event objects to the default EventBridge bus. You can define a rule with an event pattern matching the specific CodeCommit repository and event type, then set the rule's target to a CodeBuild project, which EventBridge invokes directly and asynchronously. This is the simplest and most direct integration because no intermediate processing or custom code is required, and you can even configure an input transformer to pass the commit ID as the sourceVersion to the CodeBuild build so the build uses the exact revision that triggered it.

Why this answer

Amazon EventBridge is the correct choice because it can capture CodeCommit repository events (such as pull request creation) via a default event bus and route them to targets like CodeBuild. This allows you to define a rule that matches the 'codecommit: PullRequestCreated' event and triggers a CodeBuild project directly, without needing an intermediary pipeline or compute service.

Exam trap

The trap here is that candidates often choose AWS CodePipeline because they assume a full CI/CD pipeline is required for any build trigger, but EventBridge provides a simpler, event-driven integration that directly connects CodeCommit events to CodeBuild without pipeline overhead.

How to eliminate wrong answers

Option A is wrong because AWS CodePipeline is a CI/CD orchestration service that can poll CodeCommit for changes or be triggered by EventBridge, but it is not the direct service to connect CodeCommit events to CodeBuild for a single pull request trigger; it adds unnecessary complexity and cost. Option C is wrong because AWS Lambda can be used as a custom target to invoke CodeBuild, but it requires writing and maintaining custom code to parse the event and call the CodeBuild API, whereas EventBridge provides a native, serverless integration without code. Option D is wrong because Amazon SNS is a pub/sub messaging service that can receive events from EventBridge and fan out to subscribers, but it cannot directly trigger CodeBuild; you would still need an additional service (like Lambda or a webhook) to invoke the build.

929
MCQhard

A company uses AWS CloudFormation StackSets to deploy a VPC across multiple AWS accounts in AWS Organizations. The StackSet is created with self-managed permissions. The deployment fails in some accounts with the error: 'Insufficient IAM permissions to create resources'. What is the most likely cause of this failure?

A.The StackSet does not support deploying to more than one account
B.The execution IAM role is not created in the target accounts
C.The administrator account does not have a service-linked role for StackSets
D.The target accounts have reached their resource service quotas
AnswerB

Self-managed permissions require an execution role in each target account.

Why this answer

With self-managed permissions in AWS CloudFormation StackSets, the administrator account does not automatically create the necessary IAM roles in target accounts. The execution IAM role must be manually created in each target account to grant StackSets the permissions required to create resources. The error 'Insufficient IAM permissions to create resources' directly indicates that this execution role is missing or lacks the required policies.

Exam trap

The trap here is that candidates often confuse self-managed and service-managed permissions, assuming that StackSets automatically handle IAM roles in target accounts, when in fact self-managed requires manual role creation in each target account.

How to eliminate wrong answers

Option A is wrong because StackSets are specifically designed to deploy stacks across multiple accounts and regions, so deploying to more than one account is a core feature, not a limitation. Option C is wrong because service-linked roles are not required for StackSets with self-managed permissions; they are used with service-managed permissions when StackSets integrates with AWS Organizations. Option D is wrong because resource service quotas would produce a different error message (e.g., 'Resource limit exceeded'), not an IAM permissions error.

930
Multi-Selecteasy

A DevOps engineer needs to receive notifications when an EC2 instance's status check fails. Which TWO services should the engineer use? (Choose TWO.)

Select 2 answers
A.AWS Lambda
B.Amazon Simple Notification Service (SNS)
C.AWS CloudTrail
D.AWS Config
E.Amazon CloudWatch Alarm
AnswersB, E

Amazon Simple Notification Service (SNS) is a fully managed pub/sub messaging service that delivers messages to subscribers such as email, SMS, Lambda, or HTTP endpoints. When a CloudWatch alarm transitions to the ALARM state for the StatusCheckFailed metric, it publishes a message to an SNS topic, which then fans out the notification to all subscribed endpoints. This makes SNS the essential delivery mechanism for alerting the DevOps engineer promptly without requiring polling or custom integration code, and it integrates seamlessly with CloudWatch Alarms.

Why this answer

Amazon CloudWatch Alarms (Option E) can monitor EC2 instance status checks (both system and instance checks) and trigger an action when the alarm state changes to ALARM. Amazon SNS (Option B) is the service that delivers the notification by publishing messages to subscribers (e.g., email, SMS, HTTP endpoints) when the CloudWatch alarm triggers. Together, they provide a complete monitoring and notification pipeline for status check failures.

Exam trap

The trap here is that candidates often select AWS Lambda or AWS Config because they associate them with automation or compliance, but the question explicitly asks for services to 'receive notifications' when a status check fails, which requires a notification delivery service (SNS) and a monitoring service (CloudWatch Alarm), not compute or configuration tracking.

931
Multi-Selectmedium

A company runs a production database on Amazon RDS for MySQL. The database experiences a sudden spike in connections, causing the application to time out. The DevOps team needs to diagnose the issue quickly. Which combination of actions should be taken? (Choose two.)

Select 2 answers
A.Check CloudWatch metrics for DatabaseConnections and CPUUtilization.
B.Immediately scale up the RDS instance to handle the load.
C.Analyze VPC Flow Logs to identify the source IPs of connections.
D.Use the RDS console to view the number of active connections per user.
E.Enable Performance Insights and review the top SQL statements.
AnswersA, E

This is the correct first step because CloudWatch provides two directly relevant metrics for an RDS for MySQL instance: DatabaseConnections shows the number of client sessions currently established, and CPUUtilization reflects aggregate CPU consumption. If DatabaseConnections spikes while CPUUtilization remains normal, the problem is connection exhaustion or a connection leak; if CPUUtilization also rises, it likely indicates heavy query load. These metrics give you a high-level, time-aligned picture of whether the symptom is connection-bound or compute-bound, which drives the next diagnostic step (e.g., enabling Performance Insights).

Why this answer

CloudWatch metrics such as DatabaseConnections and CPUUtilization provide real-time monitoring to quickly identify anomalies. Option E is correct because Performance Insights reveals the top SQL statements consuming resources, helping pinpoint the root cause of the connection spike. Option B is incorrect because scaling up is a reactive mitigation, not a diagnostic action.

Option C is incorrect because VPC Flow Logs capture network-level traffic but do not show database connection counts or details. Option D is incorrect because the RDS console displays aggregate connection metrics, not per-user connection details.

932
MCQeasy

A company wants to centrally manage user access to multiple AWS accounts using federated identity. Which AWS service should be used to create a single sign-on (SSO) solution?

A.AWS IAM Identity Center (AWS SSO)
B.AWS Organizations
C.AWS Directory Service for Microsoft Active Directory
D.Amazon Cognito
AnswerA

AWS IAM Identity Center (formerly AWS SSO) is the correct service because it is purpose-built to centrally manage workforce user access and single sign-on across multiple AWS accounts, business applications, and SAML 2.0-enabled apps. It lets you define permission sets that map users or groups to IAM roles in different accounts, and it integrates with identity providers like Active Directory or Okta. This directly addresses the requirement to centrally manage user access to multiple AWS accounts with SSO.

Why this answer

AWS IAM Identity Center (formerly AWS SSO) is the correct service because it is purpose-built to centrally manage user access and permissions across multiple AWS accounts and applications from a single place. It allows you to create or connect your existing identity source (e.g., Active Directory, Okta, Azure AD) and then define fine-grained permission sets that map users or groups to specific roles in each account, enabling a true single sign-on (SSO) experience without needing to create IAM users in every account.

Exam trap

The trap here is that candidates often confuse AWS Organizations (which manages accounts and policies) with IAM Identity Center (which manages user identities and SSO), or they think that Directory Service alone provides SSO across accounts, when in fact it only provides the directory backend and requires an additional federation service like IAM Identity Center to bridge authentication to multiple AWS accounts.

How to eliminate wrong answers

Option B (AWS Organizations) is wrong because it provides centralized governance and policy management for multiple AWS accounts (e.g., via Service Control Policies), but it does not handle user authentication or SSO; it is a prerequisite for using IAM Identity Center but not the SSO solution itself. Option C (AWS Directory Service for Microsoft Active Directory) is wrong because it is a managed Microsoft AD directory service that can serve as an identity source, but it does not natively provide the multi-account permission management or SSO portal; you would still need IAM Identity Center to federate access across accounts. Option D (Amazon Cognito) is wrong because it is designed for customer-facing identity and access management for web and mobile applications, not for managing workforce access to AWS accounts or providing SSO across multiple AWS accounts.

933
MCQmedium

A development team uses AWS CodeCommit for source control and AWS CodePipeline for CI/CD. The pipeline has a Source stage that polls the repository for changes. Recently, developers have noticed that the pipeline does not always trigger when code is pushed to the main branch. What is the most likely cause?

A.The number of pushes to the repository has exceeded the CodePipeline poll rate limit.
B.The repository does not have a webhook configured to notify CodePipeline of changes.
C.The IAM role used by CodePipeline does not have permission to read from CodeCommit.
D.CloudWatch Events is not enabled for the repository.
AnswerA

CodePipeline polls CodeCommit for changes at a fixed interval (e.g., every 5 minutes) when no webhook is configured. If the repository receives numerous pushes in a short period, the polling calls to CodeCommit's API may be throttled by their respective rate limits, causing a poll to fail silently. Even if the poll succeeds, changes are aggregated, so a single push may not generate a distinct execution if superseded by later commits. This throttling—not any missing configuration—results in no pipeline trigger being created.

Why this answer

CodePipeline uses a polling mechanism to check for changes in CodeCommit repositories. When the number of pushes exceeds the default poll rate limit (typically one request per 15 seconds), the pipeline may miss some changes, leading to inconsistent triggering. This is a known limitation of polling-based detection, especially in high-velocity development environments.

Exam trap

The trap here is that candidates often assume webhooks are mandatory for CodePipeline to detect CodeCommit changes, but the default polling mechanism can still work—though it may miss changes under high push volume, leading to intermittent failures.

How to eliminate wrong answers

Option B is wrong because CodePipeline does not require a webhook for CodeCommit; it relies on polling by default, and the question states the pipeline polls the repository. Option C is wrong because if the IAM role lacked read permissions, the pipeline would fail consistently, not intermittently. Option D is wrong because CloudWatch Events is not required for CodePipeline to detect changes; the pipeline uses polling, not event-driven triggers, unless explicitly configured with a webhook or CloudWatch Events rule.

934
MCQmedium

A company uses AWS CodePipeline to deploy a Node.js application to AWS Elastic Beanstalk. The pipeline includes a build stage that runs 'npm install' and 'npm test'. The team notices that the build stage often fails due to network timeouts when downloading npm packages. Which action would MOST reliably resolve this issue?

A.Configure the CodeBuild project to use a VPC with a NAT gateway to the internet.
B.Use a custom Docker image that includes pre-installed npm packages.
C.Enable local dependency caching in the buildspec file.
D.Increase the build timeout to the maximum value.
AnswerA

By default, a CodeBuild project that is associated with your Amazon VPC runs in one of your private subnets and has no outbound internet connection unless your route table directs traffic through a NAT gateway. Without that route, `npm install` cannot reach the npm registry and fails with network timeouts. Placing the NAT gateway in a public subnet, updating the private route table to `0.0.0.0/0 -> nat-gateway-id`, and associating the CodeBuild project with that VPC gives the build deterministic, reliable egress to the internet while still allowing it to access any VPC-only resources.

Why this answer

The network timeouts occur because the CodeBuild project lacks outbound internet access to reach the npm registry. By configuring the CodeBuild project to use a VPC with a NAT gateway, you provide a stable, routable path to the internet via the NAT gateway's elastic IP, eliminating intermittent connectivity issues caused by relying on public endpoints through a non-VPC network path.

Exam trap

The trap here is that candidates often assume increasing timeouts or caching will fix intermittent network failures, but the real issue is a missing outbound internet path when CodeBuild is configured to run inside a VPC without a NAT gateway.

How to eliminate wrong answers

Option B is wrong because pre-installing npm packages in a custom Docker image does not address the root cause of network timeouts during the build; it only avoids downloading packages for the first build, but subsequent updates or missing dependencies would still require internet access. Option C is wrong because local dependency caching reduces download time for repeated dependencies but does not resolve network timeouts caused by lack of outbound internet connectivity; the timeout would still occur on the first cache miss or cache refresh. Option D is wrong because increasing the build timeout does not fix the underlying network connectivity issue; it merely allows the build to wait longer for a timeout that will still occur if the npm registry is unreachable.

935
MCQhard

A company uses AWS KMS to encrypt data in Amazon S3. The security team requires that all encryption keys be rotated automatically every 365 days. Which type of KMS key should be used?

A.AWS owned key
B.Custom key store backed by CloudHSM
C.Customer managed key (CMK)
D.AWS managed key (aws/s3)
AnswerC

Customer managed keys allow you to enable automatic rotation with a customizable period (default 365 days).

Why this answer

AWS managed keys (aws/s3) are automatically rotated every year (365 days). Customer managed keys allow you to set a custom rotation period (any length between 90 days and 10 years) but require enabling rotation. The key is that aws/s3 keys rotate automatically without any configuration.

However, the question says 'all encryption keys' and 'every 365 days' - both options can achieve that, but aws/s3 keys are automatically rotated, while customer managed keys need rotation enabled. The best practice is to use the most appropriate. But note: customer managed keys can be rotated automatically if you enable it.

The question might be ambiguous, but typical exam scenario: use customer managed keys for more control. However, the security team requires automatic rotation; both can do it. The nuance: customer managed keys have a rotation period that you can set, but the default is 365 days when you enable rotation.

So both work. But the question says 'which type' - likely they want customer managed because it allows you to control the policy. However, aws/s3 keys are automatically rotated and cannot be customized.

Since the requirement is 'every 365 days', which is the default for both, but aws/s3 keys are already rotated on that schedule. I think the answer is 'Customer managed key' because it's a key you own and have control over the rotation policy. Actually, aws/s3 keys are rotated annually, but you cannot view or manage them.

For compliance, you might need to control the key. So I'll go with customer managed key.

936
Multi-Selecthard

A company uses Amazon RDS for MySQL and wants to monitor slow queries to optimize performance. Which actions should the DevOps engineer take to capture and analyze slow query logs? (Choose THREE.)

Select 3 answers
A.Use AWS CloudTrail to capture SQL queries
B.Enable the slow query log parameter in the RDS DB parameter group
C.Enable RDS Performance Insights
D.Configure RDS to publish logs to Amazon CloudWatch Logs
E.Use CloudWatch Logs Insights to query and analyze the slow query logs
AnswersB, D, E

In the RDS DB parameter group for MySQL, set slow_query_log to 1 or ON and define long_query_time with the desired threshold (for example, 2 seconds) — these parameters control which queries are written to the slow query log. This log records the exact SQL text, query execution time, and timestamp for every query exceeding the threshold, giving you the raw data needed to calculate SLO metrics like the ratio of slow queries to total queries. Because slow_query_log is a dynamic parameter for MySQL in RDS, you can apply the change immediately without rebooting the database instance.

Why this answer

To capture and analyze slow query logs in Amazon RDS for MySQL, the DevOps engineer should enable the slow query log parameter in the DB parameter group (B), configure RDS to publish logs to Amazon CloudWatch Logs (D), and use CloudWatch Logs Insights to query and analyze the logs (E). Option A (CloudTrail) captures API activity, not SQL queries. Option C (Performance Insights) monitors database performance metrics but does not capture slow query logs.

937
Multi-Selecthard

A company's Security team wants to detect and alert on the creation of IAM users with console access. Which THREE services should be used?

Select 3 answers
A.AWS CloudTrail
B.Amazon CloudWatch Logs
C.AWS Config
D.Amazon GuardDuty
E.Amazon CloudWatch Alarms
AnswersA, B, E

AWS CloudTrail is the authoritative audit service that records management events as API calls, including the CreateUser action that IAM user creation invokes. By enabling CloudTrail, your security team gains a detailed, tamper-evident log of who created which IAM user, from which source IP, and with what permissions. This event data can then be delivered to Amazon CloudWatch Logs for further processing and alerting, making CloudTrail the essential first step in a real-time monitoring pipeline.

Why this answer

CloudTrail logs the CreateUser and CreateLoginProfile API calls. CloudWatch Logs can receive CloudTrail logs and create metric filters. CloudWatch Alarms can trigger on the metric.

Config can track resource changes but not as efficient for alerting on API calls. GuardDuty does not specifically focus on IAM user creation.

938
Multi-Selectmedium

A company uses AWS Config to evaluate resource compliance. They have a custom AWS Config rule that checks whether EC2 instances have a specific tag. The rule is triggered by configuration changes. The DevOps engineer notices that the rule evaluation results show 'NON_COMPLIANT' for some instances that actually have the tag. Which TWO could be causes? (Choose TWO.)

Select 2 answers
A.The rule's maximum execution frequency is set to 24 hours
B.The Lambda function that evaluates the rule has a logic error
C.The rule is not being triggered by CloudTrail events
D.The rule is configured to evaluate only for a specific resource type that does not include EC2
E.The AWS Config service role does not have permission to invoke the Lambda function
AnswersB, E

Correct. A logic error in the Lambda function can cause false NON_COMPLIANT results despite the tag being present.

Why this answer

A logic error in the Lambda function evaluating the custom rule can cause it to incorrectly mark compliant resources as NON_COMPLIANT, such as misinterpreting the tag key/value or case sensitivity. Option E is correct because if the AWS Config service role lacks permission to invoke the Lambda function, the evaluation fails. If the custom rule has a default compliance value of NON_COMPLIANT for evaluation failures, the resource will be marked NON_COMPLIANT even though the tag is present.

Exam trap

The trap is that candidates may focus on evaluation failures (like permission issues) causing 'Failed' status, but if the custom rule's default compliance is set to NON_COMPLIANT, a permission error results in NON_COMPLIANT. Also, resource type scoping errors lead to 'Not evaluated', not NON_COMPLIANT.

939
Multi-Selectmedium

A DevOps engineer is designing an AWS CloudFormation template to deploy a three-tier web application. The application must be highly available across multiple Availability Zones. The engineer needs to ensure that the database layer uses a Multi-AZ deployment. Which TWO options should the engineer implement to meet these requirements? (Choose TWO.)

Select 2 answers
A.Define a separate 'AWS::RDS::DBSubnetGroup' resource with subnets from at least two Availability Zones.
B.Deploy the database with multiple read replicas in different Availability Zones.
C.Select a database engine that supports Multi-AZ deployments.
D.Configure the database to use a DB subnet group with subnets in a single Availability Zone.
E.Set the 'MultiAZ' property of the 'AWS::RDS::DBInstance' resource to 'true'.
AnswersC, E

Multi-AZ availability is not universally available across all RDS database engines; for example, Microsoft SQL Server supports Multi-AZ only on Enterprise or Standard editions (and not on Express/Web), while Oracle requires Enterprise Edition. If an engine/edition lacks Multi-AZ support, setting MultiAZ=true in CloudFormation will fail validation or be ignored. Therefore, confirming engine support is a necessary prerequisite before enabling Multi-AZ in the template.

Why this answer

Not all AWS RDS database engines support Multi-AZ deployments; for example, Amazon Aurora uses a different high-availability mechanism (cluster volume) and does not use the standard Multi-AZ feature. The engineer must verify that the chosen engine (e.g., MySQL, PostgreSQL, Oracle, SQL Server) explicitly supports Multi-AZ to enable synchronous standby replication across Availability Zones. Option E is correct because setting the 'MultiAZ' property to 'true' on the 'AWS::RDS::DBInstance' resource directly instructs CloudFormation to provision a primary DB instance in one AZ and a standby in another AZ, with automatic failover.

Exam trap

The trap here is that candidates often assume any database engine can be made Multi-AZ by simply setting the flag, but the exam tests the knowledge that engines like Aurora have a different architecture and require a cluster-based approach, not the standard MultiAZ property.

940
Multi-Selecteasy

A company uses AWS OpsWorks for Chef to manage its configuration. The company is planning to migrate to AWS Systems Manager. Which AWS Systems Manager capabilities can replace OpsWorks Chef functionalities? (Choose THREE.)

Select 3 answers
A.Patch Manager
B.Session Manager
C.Run Command
D.State Manager
E.Inventory
AnswersA, D, E

Patch Manager is correct because it automates the process of patching managed nodes with security updates and other types of updates, directly replacing OpsWorks Chef's ability to manage package updates and system patches via cookbooks. It provides a centralized, policy-based approach to patch compliance without requiring custom Chef recipes.

Why this answer

Patch Manager is correct because it automates the process of patching managed nodes with security updates and other types of updates, directly replacing OpsWorks Chef's ability to manage package updates and system patches via cookbooks. It provides a centralized, policy-based approach to patch compliance without requiring custom Chef recipes.

Exam trap

The trap here is that candidates often confuse Run Command (ad-hoc execution) with State Manager (persistent desired state), leading them to select Run Command instead of State Manager for replacing Chef's continuous configuration enforcement.

941
MCQeasy

A company uses AWS CodeBuild to run unit tests and package a Java application. The build environment needs to have a specific version of Java installed that is not available in the standard build images. The team wants to minimize build time. How should the engineer configure the build environment?

A.Use AWS Lambda to run the tests and package the application.
B.Use a standard build image and include a pre-build command to install the required Java version.
C.Use a custom build image that already includes the required Java version, stored in Amazon ECR.
D.Use the pre-build phase to download and install Java from an S3 bucket.
AnswerC

A custom build image with the required Java version already installed, stored in Amazon ECR, is the correct architecture because CodeBuild can be configured to pull that image at build time. Baking the JDK, build tool, and dependency caches into Docker layers means the runtime is available immediately, eliminating per-build installation overhead and making versioning deterministic. This approach is the intended pattern for non-standard language versions.

Why this answer

Using a custom build image stored in Amazon ECR allows the team to pre-install the exact Java version required, eliminating the need for runtime installation. This minimizes build time by avoiding the overhead of downloading and installing software during every build, while still providing a consistent, reproducible environment.

Exam trap

The trap here is that candidates may think installing software during the build (options B or D) is acceptable, but the question explicitly requires minimizing build time, making a pre-built custom image the only optimal choice.

How to eliminate wrong answers

Option A is wrong because AWS Lambda is a serverless compute service designed for short-running, event-driven functions, not for running unit tests and packaging a Java application that may require a full build environment and longer execution times. Option B is wrong because installing a specific Java version via a pre-build command adds significant time to every build, contradicting the goal to minimize build time. Option D is wrong because downloading and installing Java from an S3 bucket during the pre-build phase also introduces unnecessary runtime overhead and latency, increasing build duration compared to using a pre-built custom image.

942
MCQeasy

A DevOps engineer wants to receive an alert when the total number of error logs in an application exceeds 100 within a 5-minute period. The application writes logs to CloudWatch Logs. How can this be achieved?

A.Create a CloudWatch dashboard with a line chart for error count and manually monitor it.
B.Use CloudWatch Logs Insights to run a query every 5 minutes and trigger an alert based on the result.
C.Create a CloudWatch Logs subscription filter to send matching logs to a Lambda function, which counts errors and sends an alert.
D.Create a metric filter on the log group for 'ERROR', then create a CloudWatch alarm on the resulting metric with a threshold of 100.
AnswerD

A metric filter on the CloudWatch Logs group can count occurrences of the pattern 'ERROR', creating a custom metric. A CloudWatch alarm on that metric with a threshold of 100 and a 5-minute period will trigger when the error count exceeds 100.

Why this answer

A metric filter on the CloudWatch Logs group can count occurrences of the pattern 'ERROR', creating a custom metric. A CloudWatch alarm on that metric with a threshold of 100 and a 5-minute period will trigger when the error count exceeds 100. Option A is incorrect because dashboards are for visualization, not automated alerts.

Option B is incorrect because CloudWatch Logs Insights is for ad-hoc queries, not continuous real-time alerting. Option C is incorrect because subscription filters send logs to destinations like Lambda, but the Lambda would need custom logic to count and alert, which is not as direct as a metric filter. The metric filter with alarm is the simplest native solution.

943
MCQmedium

A company uses AWS CloudFormation to manage infrastructure. They have a stack that creates an Amazon RDS instance. The stack creation fails with the error: 'The following resource(s) failed to create: [DBInstance]'. The CloudFormation template includes a parameter for the DB instance class. Which troubleshooting step should be taken FIRST?

A.Increase the stack creation timeout to allow more time for the database to be created.
B.Check the CloudFormation stack events for a detailed status message from the DBInstance resource.
C.Verify that the VPC has at least two public subnets in different Availability Zones.
D.Use the Amazon RDS console to check if a DB instance with the same identifier already exists.
AnswerB

Checking the CloudFormation stack events is the most direct and authoritative diagnostic step because every resource action logs a status reason that mirrors the exact API error returned by the RDS service. For a DBInstance failure, the event's status message will contain the precise reason—such as an invalid DB instance class, insufficient subnet coverage, or a parameter group mismatch—saving you from guesswork. The events tab also shows the sequence of resource creation, so you can determine whether the failure is isolated to the database or caused by a dependency like a VPC or subnet group that failed earlier.

Why this answer

The first step when a CloudFormation stack creation fails is to check the stack events in the CloudFormation console or via the AWS CLI. Each resource creation attempt generates a status message that includes a detailed reason for the failure, such as insufficient capacity, incorrect parameter values, or network configuration issues. For an RDS DBInstance, the event message will provide the specific error (e.g., 'DB instance class not supported in this Availability Zone'), enabling targeted troubleshooting without guesswork.

Exam trap

The trap here is that candidates jump to common RDS prerequisites (like VPC subnets or duplicate identifiers) without first consulting the CloudFormation stack events, which provide the precise failure reason and are the standard diagnostic tool for any stack creation failure.

How to eliminate wrong answers

Option A is wrong because increasing the stack creation timeout does not address the root cause of a failure; it only extends the wait period, and RDS instance creation typically completes within the default timeout unless there is a resource constraint or misconfiguration. Option C is wrong because RDS instances in a VPC require at least two subnets (public or private) in different Availability Zones only if you are creating a Multi-AZ deployment or a DB subnet group; the error message does not indicate a subnet issue, and this is not the first troubleshooting step. Option D is wrong while checking for a duplicate DB instance identifier is a valid possibility, the CloudFormation stack events will explicitly report a 'DBInstanceAlreadyExists' error if that is the cause, making it redundant to check the RDS console first; the events provide the definitive diagnosis.

944
MCQhard

A company has a CI/CD pipeline that deploys to Amazon ECS using AWS CodePipeline. The pipeline includes a manual approval step before deployment to production. The security team requires that all approvals be logged in AWS CloudTrail and that the approver's identity be verified. Which action should the DevOps engineer take to meet these requirements?

A.Ensure that the manual approval action is configured as a CodePipeline approval action; CloudTrail will log the 'Approval' event with the IAM user ARN.
B.Create a custom CloudTrail trail specifically for CodePipeline API calls.
C.Enable CloudTrail Insights to detect unusual approval activity.
D.Configure the approval action to send a notification to an Amazon SNS topic, and log the SNS delivery to CloudWatch Logs.
AnswerA

CodePipeline's manual approval action generates a PutApprovalResult API call when an approver clicks to approve or reject. CloudTrail automatically captures that call, and the event includes the IAM principal ARN (user or role), the timestamp, source IP, and session context. This satisfies the audit requirement without any additional configuration.

Why this answer

CodePipeline's manual approval action inherently generates an 'Approval' event in CloudTrail when an approver approves or rejects the action. This event includes the IAM user ARN of the approver, satisfying both the logging and identity verification requirements without additional configuration.

Exam trap

The trap here is that candidates may think they need to create a custom CloudTrail trail or enable Insights to meet logging requirements, but CloudTrail already logs all CodePipeline API calls by default, including manual approval actions with the approver's identity.

How to eliminate wrong answers

Option B is wrong because creating a separate CloudTrail trail for CodePipeline API calls is unnecessary; CloudTrail is already enabled by default for all AWS services, including CodePipeline, and logs all management events, including approval actions. Option C is wrong because CloudTrail Insights is designed to detect unusual API activity patterns (e.g., anomalous call volumes), not to log or verify individual approval events or identities. Option D is wrong because sending a notification to an SNS topic and logging delivery to CloudWatch Logs does not capture the approver's IAM identity in CloudTrail; it only logs the SNS delivery event, not the approval action itself.

945
Multi-Selectmedium

A company uses AWS CloudFormation to manage infrastructure. They have a stack that creates an Amazon RDS DB instance and an EC2 instance that connects to it. The DB instance has a deletion policy of 'Retain'. The stack fails to delete because the DB instance is retained and still exists. Which TWO actions would allow the stack to be deleted successfully? (Select TWO.)

Select 2 answers
A.Use the AWS CLI to force delete the stack with the --force option.
B.Manually delete the DB instance using the RDS console.
C.Disable termination protection on the EC2 instance.
D.Change the deletion policy of the DB instance to 'Delete' and then update the stack before deleting.
E.Modify the DB instance to allow deletion by setting DeletionProtection to false.
AnswersB, D

Manually deleting the RDS DB instance from the RDS console removes the physical database object from the account, circumventing CloudFormation's inability to delete it automatically. This is a valid operational workaround when the stack is stuck in DELETE_FAILED because the DB instance is protected by RDS deletion protection or has a DeletionPolicy of Retain. Once the resource is gone, a subsequent stack delete operation will succeed because CloudFormation no longer attempts to delete that DB instance.

Why this answer

Manually deleting the retained DB instance removes the resource that is blocking the stack deletion. CloudFormation cannot delete a stack that contains a resource with a 'Retain' deletion policy until that resource is manually removed, as the stack expects the resource to no longer exist for the deletion to complete.

Exam trap

The trap here is that candidates often confuse 'Retain' deletion policy with 'DeletionProtection' or assume that termination protection on EC2 instances is relevant, when in fact the core issue is that the retained resource must be either manually removed or its policy changed to allow CloudFormation to delete it.

946
MCQmedium

A company uses AWS CodeDeploy with a blue/green deployment strategy for an Amazon EC2 Auto Scaling group. During deployment, the new instances are failing health checks and the deployment is rolling back. What is the MOST likely cause?

A.The new instances are not passing the configured health check grace period.
B.The application is not registered with an Elastic Load Balancer.
C.The deployment group is not configured to use an Auto Scaling group.
D.The CodeDeploy agent is not installed on the new instances.
AnswerA

During a CodeDeploy blue/green deployment, the new instances (green) are launched and then a health check grace period is applied before traffic is shifted. If the application fails to become healthy within that window, CodeDeploy considers the deployment failed and automatically rolls back to the original blue fleet. This is the only condition that directly results in a rollback after the new instances are provisioned, making it the correct answer.

Why this answer

In a blue/green deployment with CodeDeploy, new instances are launched and must pass health checks before traffic is routed to them. If the health check grace period is not configured or is too short, the new instances may be deemed unhealthy before the application has fully started, triggering a rollback. This is the most likely cause because the health check grace period directly controls how long CodeDeploy waits before evaluating instance health.

Exam trap

The trap here is that candidates often assume the CodeDeploy agent is missing (Option D) because it's a common issue, but the agent must be present for the deployment to even start—health check failures occur after the agent has successfully installed the application.

How to eliminate wrong answers

Option B is wrong because if the application were not registered with an Elastic Load Balancer, health checks would not be performed at all, and the deployment would not fail due to health check failures—it would either succeed or fail for another reason. Option C is wrong because the deployment group must be configured to use an Auto Scaling group for a blue/green deployment to work; if it were not, the deployment would fail at the start, not during health checks. Option D is wrong because if the CodeDeploy agent were not installed on the new instances, the deployment would fail during the Install phase, not during health checks, and the error would be about agent connectivity, not health check failures.

947
MCQmedium

A DevOps team is designing a disaster recovery plan for a production RDS for PostgreSQL database. The RPO must be less than 5 minutes and the RTO less than 1 hour. The database size is 2 TB. Which solution is MOST cost-effective?

A.Enable cross-Region automated backups with a retention period of 1 day
B.Take manual snapshots every 5 minutes and copy them to another Region
C.Use AWS Database Migration Service (DMS) for continuous replication to another Region
D.Create a cross-Region read replica and promote it during disaster
AnswerD

A cross-Region read replica uses asynchronous replication with lag typically under 5 minutes and can be promoted quickly, meeting both RPO and RTO cost-effectively.

Why this answer

The most cost-effective solution that meets the RPO < 5 minutes and RTO < 1 hour for a 2 TB RDS PostgreSQL database. A cross-Region read replica uses asynchronous replication, typically with lag of seconds, ensuring RPO well under 5 minutes. Promoting the replica to a standalone instance takes minutes, satisfying the RTO.

It leverages existing RDS features without additional services like DMS, and the replica instance can be sized smaller than the primary if not used, minimizing cost. Option A (cross-Region automated backups) only copies daily backups, resulting in RPO up to 24 hours, failing the requirement. Option B (manual snapshots every 5 minutes) is impractical and costly.

Option C (DMS continuous replication) meets RPO but incurs extra compute and data transfer costs, making it less cost-effective than a read replica.

Exam trap

Candidates often overlook that cross-Region automated backups do not include transaction logs for point-in-time recovery, so RPO can be up to 24 hours, not minutes.

948
MCQhard

A DevOps team uses AWS Lambda functions to process events from an SQS queue. The Lambda function occasionally fails due to transient errors, and the team wants to capture and analyze the full error details, including stack traces, for debugging. The errors are not always related to invocation failures (e.g., timeouts) but include exceptions thrown within the function code. Which approach will capture the MOST comprehensive error information?

A.Configure a DLQ on the SQS queue to capture failed messages and inspect them.
B.Enable CloudWatch Logs and rely on the automatic logging of invocation results.
C.Ensure the Lambda function code returns a meaningful error object (e.g., throws an exception) so that the error is logged in CloudWatch Logs with a stack trace.
D.Use AWS X-Ray to trace the function execution and analyze the traces.
AnswerC

By returning a meaningful error object (e.g., throwing an exception) within the Lambda handler, the error details and stack trace are automatically written to CloudWatch Logs. This gives the most comprehensive information for debugging application errors.

Why this answer

When a Lambda function throws an exception or returns an error object, AWS Lambda automatically logs the error details, including the stack trace, to CloudWatch Logs. This captures the full error information necessary for debugging transient errors. Option A is incorrect because a Dead Letter Queue (DLQ) on SQS captures the failed messages themselves, not the error details or stack traces of the function execution.

Option B is incorrect because CloudWatch Logs automatic invocation logging provides only basic information such as invocation time, duration, and status; it does not include the function's stack trace unless explicitly logged by the code. Option D is incorrect because AWS X-Ray provides tracing of requests and can show service maps and latency, but it does not necessarily capture the full stack trace of application-level exceptions; it focuses on request flow rather than detailed error logs.

949
MCQhard

A company is using AWS CodeBuild to compile a Java application. The build takes over 30 minutes, which is too long. The project uses the standard build environment. The source code is stored in an S3 bucket. What is the most effective way to reduce build time?

A.Use a custom build environment with pre-installed Java.
B.Enable local caching for dependencies in the buildspec.yml.
C.Store the source code in AWS CodeCommit instead of S3.
D.Increase the compute type to a larger instance.
AnswerB

Enabling local caching in the buildspec.yml stores resolved dependencies (e.g., Maven ~/.m2 or Gradle caches) in a local cache directory on the build host, which persists across builds for the same project. This avoids re-downloading artifacts from repositories like Maven Central on every build, which is typically the most significant variable in Java build time. The correct configuration uses the 'cache' section with 'paths' pointing to the dependency directories and a 'local' cache type; unlike S3 caching, local caching has zero network latency and is ideal for short-lived, high-frequency builds.

Why this answer

Enabling local caching in the buildspec.yml allows CodeBuild to reuse previously downloaded dependency files (e.g., Maven .m2 repository) across builds, significantly reducing the time spent on dependency resolution. Since the build takes over 30 minutes, caching avoids re-downloading dependencies on every build, which is the most effective optimization for a standard build environment.

Exam trap

The trap here is that candidates often assume increasing compute power (Option D) is the universal fix for slow builds, but the question specifically highlights a 30-minute build time in a standard environment, which typically indicates dependency download latency rather than CPU constraints.

How to eliminate wrong answers

Option A is wrong because using a custom build environment with pre-installed Java does not address the primary bottleneck of dependency downloads; it only saves a few seconds on environment setup. Option C is wrong because storing source code in CodeCommit instead of S3 does not reduce build time; both are source storage options with similar retrieval speeds, and the build time issue is not related to source code retrieval. Option D is wrong because increasing the compute type to a larger instance may improve CPU-bound tasks but does not solve the dependency download overhead, which is I/O-bound and network-bound; it would be a less effective and more costly solution.

950
MCQmedium

A CloudFormation stack update failed with the error shown. What is the most likely cause?

A.The instance type t2.micro is not available in the region.
B.The IAM role used by CloudFormation lacks ec2:RunInstances permissions.
C.The AMI ID specified in the template is incorrect or has been deregistered.
D.The stack name does not match the existing stack.
AnswerC

This option is correct because the CloudFormation error explicitly states that the imageId is invalid, which is the EC2 API's validation response for an AMI ID that is malformed, deregistered, or not present in the account/region. During a stack update, CloudFormation passes the AMI ID from the template to the EC2 RunInstances API, and EC2 rejects it with an error like 'InvalidAMIID.NotFound' or 'InvalidAMIID.Malformed', causing the stack update to roll back. This commonly happens when a template references a hard-coded AMI that was deregistered or copied from a different region.

Why this answer

The error message indicates that CloudFormation cannot find the specified AMI. This typically occurs when the AMI ID is incorrect, has been deregistered, or is not available in the region where the stack is being deployed. CloudFormation validates the AMI ID during stack creation or update, and if the AMI does not exist or is inaccessible, the operation fails with a 'Resource creation cancelled' error.

Exam trap

The trap here is that candidates may confuse a missing AMI error with an IAM permissions error, but the specific error message about 'AMI' not being found directly points to the AMI ID being invalid or unavailable, not to a lack of permissions.

How to eliminate wrong answers

Option A is wrong because if the instance type t2.micro were unavailable in the region, the error would specifically mention that the instance type is not supported, not that the AMI cannot be found. Option B is wrong because if the IAM role lacked ec2:RunInstances permissions, the error would indicate an authorization failure (e.g., 'You are not authorized to perform this operation'), not a missing AMI. Option D is wrong because a stack name mismatch would cause a different error, such as 'Stack with id [name] does not exist', and would not trigger a resource creation failure during an update.

951
MCQhard

A DevOps engineer notices that an EC2 instance in an Auto Scaling group is repeatedly failing health checks and being terminated. The engineer needs to capture the root cause by collecting memory dumps and system logs before termination. What should the engineer do?

A.Configure the CloudWatch Agent to collect memory and system logs and publish them to CloudWatch Logs.
B.Use EC2Rescue for Windows Server or Linux, configure it to run at instance startup, and extend the Auto Scaling health check grace period.
C.Use AWS Systems Manager Run Command to execute a script on the instance that collects diagnostics before it is terminated.
D.Enable EC2 instance metadata service (IMDS) to capture diagnostic data that persists after termination.
AnswerB

EC2Rescue can run diagnostics at startup; extending the grace period gives time for the tool to collect data before termination.

Why this answer

EC2Rescue is specifically designed to collect memory dumps and system logs from EC2 instances, and by configuring it to run at startup and extending the Auto Scaling health check grace period, the engineer ensures diagnostics are captured before the instance is terminated for failing health checks. This approach directly addresses the need to gather root cause data from a failing instance that is about to be replaced.

Exam trap

The trap here is that candidates often assume Systems Manager Run Command (Option C) can reliably execute scripts on failing instances, but they overlook that the instance must be in a running and reachable state, which is not guaranteed when health checks are repeatedly failing and termination is imminent.

How to eliminate wrong answers

Option A is wrong because the CloudWatch Agent collects logs and metrics during normal operation but does not capture memory dumps or system logs at the point of failure before termination; it cannot guarantee data collection from an instance that is being terminated due to health check failures. Option C is wrong because AWS Systems Manager Run Command requires the instance to be running and reachable to execute commands, but the instance is repeatedly failing health checks and may be terminated before the command can run, making it unreliable for capturing pre-termination diagnostics. Option D is wrong because EC2 instance metadata service (IMDS) provides metadata about the instance (e.g., instance ID, AMI ID) but does not capture diagnostic data like memory dumps or system logs, and it does not persist after termination.

952
MCQhard

A company uses AWS CodeDeploy for application deployments. They want to ensure that if a deployment fails, the system automatically rolls back to the previous version. Which configuration should they set?

A.Define a 'Failure' lifecycle event hook that calls a Lambda function to revert the deployment.
B.Configure the deployment group to enable automatic rollback when a deployment fails.
C.Set the 'auto-rollback' property in the CodeDeploy deployment group to 'true'.
D.Use a CloudFormation stack with a rollback configuration.
AnswerB

This is correct because CodeDeploy deployment groups support automatic rollback for trigger events such as DEPLOYMENT_FAILURE, DEPLOYMENT_STOP_REQUEST, and ALARM_ACTIVE. When any of these events occurs, CodeDeploy automatically initiates a new deployment of the last known-good revision to the same deployment group, with no custom code required. This native mechanism is the standard and recommended way to recover from a failed deployment while preserving deployment-group settings such as traffic routing and alarm monitoring.

Why this answer

AWS CodeDeploy provides a built-in automatic rollback feature that can be configured at the deployment group level. When enabled, CodeDeploy automatically reverts the deployment to the last known successful version if the deployment fails or reaches a specified alarm threshold, without requiring custom scripting or external orchestration.

Exam trap

The trap here is that candidates confuse lifecycle event hooks with rollback mechanisms, or assume a simple boolean property like 'auto-rollback' exists, when in reality the configuration requires a structured 'autoRollbackConfiguration' object with an enabled flag and specific event triggers.

How to eliminate wrong answers

Option A is wrong because CodeDeploy lifecycle event hooks (such as ApplicationStop, BeforeInstall, etc.) are used to run custom scripts or Lambda functions during deployment phases, not to trigger rollbacks; rollback is a deployment group configuration, not a lifecycle event. Option C is wrong because there is no 'auto-rollback' property in the CodeDeploy deployment group; the correct property is 'autoRollbackConfiguration' with an 'enabled' flag and 'events' list (e.g., DEPLOYMENT_FAILURE). Option D is wrong because CloudFormation stack rollback is unrelated to CodeDeploy application deployments; it handles infrastructure provisioning rollbacks, not application version rollbacks managed by CodeDeploy.

953
MCQhard

A company uses AWS Organizations to manage multiple accounts. The security team wants to enforce that all S3 buckets across all accounts are encrypted with AWS KMS. Which approach should be used to ensure compliance?

A.Attach a service control policy (SCP) to all accounts that denies s3:PutBucketEncryption or s3:PutObject without encryption.
B.Apply an S3 bucket policy on each account's buckets to deny unencrypted object uploads.
C.Create an IAM policy in the master account that denies S3:PutObject without encryption.
D.Use AWS Config rules to evaluate S3 bucket encryption and trigger a remediation action via AWS Systems Manager Automation.
AnswerA

A service control policy (SCP) attached at the organization root or to all accounts is the only option that gives central, preventive enforcement across every member account. By explicitly denying s3:PutBucketEncryption and s3:PutObject when encryption is not specified (using conditions like s3:x-amz-server-side-encryption), the SCP blocks the API actions themselves before any resource policy or IAM evaluation, so no account or workload can bypass the requirement. This works even if a member account administrator has full administrative permissions, because SCPs act as a permission boundary for all IAM principals in the account.

Why this answer

A service control policy (SCP) attached to all accounts in the organization can deny the s3:PutBucketEncryption and s3:PutObject actions without encryption, enforcing KMS encryption across all S3 buckets. Option B is incorrect because bucket policies are applied per-bucket and cannot be centrally enforced across all accounts. Option C is incorrect because IAM policies in the master account do not affect member accounts.

Option D is incorrect because AWS Config rules are detective, not preventive; while they can trigger remediation, the question asks for an approach to ensure compliance, and SCP provides preventive enforcement.

954
MCQhard

A team uses AWS CodeBuild to run integration tests that require access to an Amazon RDS database. The database is in a private subnet. The CodeBuild project is configured to use a VPC. However, the builds are failing with a timeout connecting to the database. What could be the issue?

A.The CodeBuild project's VPC configuration does not include the subnet IDs where the database resides.
B.The security group for the CodeBuild project does not allow outbound traffic to the RDS database.
C.The security group for the RDS database does not allow inbound traffic from the security group assigned to the CodeBuild project.
D.The CodeBuild project does not have a route to the internet via an internet gateway, so it cannot reach the RDS endpoint.
AnswerC

This is the correct root cause because when CodeBuild runs in your VPC, it attaches the security group you specified to its ENI. For the build container to successfully connect to RDS, the database's security group must have an inbound rule that permits traffic on the database port from the source being the CodeBuild security group ID. If that rule is missing, all connection attempts will time out or be refused, regardless of other network configurations, making this the definitive security group misconfiguration to resolve.

Why this answer

The RDS database is in a private subnet and its security group must explicitly allow inbound traffic from the CodeBuild project's security group. Even though CodeBuild is configured with a VPC, the default security group rules deny all inbound traffic; without an inbound rule for the database port (e.g., 3306 for MySQL) from the CodeBuild security group, the connection is blocked, causing a timeout.

Exam trap

The trap here is that candidates often assume the issue is outbound traffic (Option B) or subnet configuration (Option A), but the real problem is the missing inbound rule on the database security group, which is a classic security group misconfiguration in VPC-connected services.

How to eliminate wrong answers

Option A is wrong because the CodeBuild project's VPC configuration does not need to include the subnet IDs where the database resides; it only needs to specify the VPC ID and the subnets where the build environment runs, and the database can be in a different subnet within the same VPC. Option B is wrong because security groups are stateful — if the CodeBuild project initiates outbound traffic, the return traffic is automatically allowed, so an explicit outbound rule is not required. Option D is wrong because the RDS database is in a private subnet and does not require internet access; CodeBuild can reach it via private IP within the VPC without an internet gateway.

955
MCQmedium

A DevOps team uses Elastic Beanstalk to deploy a web application. They want to configure environment variables without modifying the application code. Where should they define these variables?

A.As environment properties in the Elastic Beanstalk environment
B.In the EC2 User Data script
C.In the instance metadata
D.In the application code
AnswerA

Elastic Beanstalk's native Environment Properties are key-value pairs defined at the environment level and injected directly into the operating system as environment variables on each EC2 instance, or as container environment variables for ECS-based platforms. This allows platform-managed settings to be consumed by your application with no extra code, and they are automatically updated on configuration changes without requiring a new deployment. They also support encrypted values when set through the AWS CLI or saved configurations with KMS, making them the standard, service-supported approach.

Why this answer

Elastic Beanstalk environment properties are specifically designed to set environment variables without modifying application code. They can be configured in the Elastic Beanstalk console, CLI, or via .ebextensions, and are exposed as environment variables to the application runtime. Option A is correct.

Option B (EC2 User Data) is for instance initialization scripts, not for application configuration. Option C (instance metadata) is read-only metadata about the instance, not custom environment variables. Option D (application code) would require modifying the code, which contradicts the requirement.

956
Multi-Selectmedium

A company is using Amazon CloudWatch Logs to store application logs. The DevOps team needs to search and analyze logs from multiple EC2 instances in real time. Which TWO services can be used to achieve this? (Choose TWO.)

Select 2 answers
A.Amazon OpenSearch Service.
B.Amazon Athena.
C.Amazon QuickSight.
D.Amazon Kinesis Data Analytics.
E.CloudWatch Logs Insights.
AnswersA, E

Amazon OpenSearch Service ingests CloudWatch Logs via a subscription filter and Lambda, indexing them for real-time full-text search, aggregations, and Kibana visualization. This makes it purpose-built for interactive log analytics and operational dashboards, directly querying the live stream without S3 export latency. It also scales to handle massive log volumes with open-source Elasticsearch-compatible APIs.

Why this answer

CloudWatch Logs can stream logs to Amazon OpenSearch Service for real-time search and analytics. Option E is correct because CloudWatch Logs Insights allows real-time querying of log groups directly within CloudWatch. Option B is incorrect: Amazon Athena is designed for querying data in S3, not for real-time log search from EC2 instances.

Option C is incorrect: Amazon QuickSight is a business intelligence service for visualization, not real-time log search. Option D is incorrect: Amazon Kinesis Data Analytics is for analyzing streaming data, not directly searching CloudWatch Logs.

957
MCQhard

Refer to the exhibit. A DevOps engineer deploys this CloudFormation template. The EC2 instance launches, but the httpd service does not start. The engineer connects to the instance and finds that the user data script did not run. What is the most likely cause?

A.The UserData is not base64 encoded correctly
B.The AMI does not have yum installed
C.The tags prevent user data from executing
D.The AMI uses a different init system than systemd
AnswerB

The `yum` command is specific to RPM-based distributions that use YUM as the package manager, such as older Amazon Linux (AL1/AL2) or CentOS 7. If the AMI is based on Amazon Linux 2023, which uses `dnf`, or on Ubuntu/Debian, which uses `apt`, the `yum` binary will not be present. When the UserData script runs `yum` on such an AMI, the shell returns a 'command not found' error, preventing the installation and causing the deployment to fail.

Why this answer

The most likely cause is that the AMI does not have yum installed. The CloudFormation template's UserData script uses yum to install httpd, but if the AMI is based on a distribution that does not use yum (e.g., Amazon Linux 2023 uses dnf, or Ubuntu uses apt), the script will fail silently or not execute as intended. Since the script itself is valid and the instance launched, the failure is due to the package manager not being available, preventing the httpd service from starting.

Exam trap

The trap here is that candidates often assume the issue is with base64 encoding or the init system, but the real problem is a mismatch between the package manager used in the UserData script and the one available on the AMI.

How to eliminate wrong answers

Option A is wrong because the UserData is automatically base64 encoded by CloudFormation when passed as a string in the template, so encoding is not an issue. Option C is wrong because tags do not affect the execution of user data scripts; tags are metadata and have no impact on the instance's initialization process. Option D is wrong because the init system (systemd vs.

SysVinit) does not prevent user data from running; user data scripts are executed by cloud-init, which works regardless of the init system, and the script itself does not rely on systemd commands.

958
Multi-Selecteasy

Which TWO AWS services can be used to monitor for unauthorized API calls in an AWS account? (Choose two.)

Select 2 answers
A.AWS Config
B.Amazon S3
C.Amazon CloudWatch Logs
D.AWS CloudTrail
E.Amazon GuardDuty
AnswersD, E

AWS CloudTrail is the primary service for recording API activity in an AWS account, capturing every management and data event with details like the caller's identity, the action, the resource, and the timestamp. By enabling CloudTrail in all regions and with appropriate event types, you can inspect logs to identify unauthorized attempts, such as failed authentication or IAM policy denials. CloudTrail provides the raw evidence needed for security analysis and is the foundational data source for services like GuardDuty.

Why this answer

AWS CloudTrail records API calls and can be used to monitor for unauthorized activity. AWS Config evaluates resource configurations against rules. GuardDuty provides intelligent threat detection using CloudTrail logs, VPC Flow Logs, and DNS logs.

CloudWatch Logs can store logs but does not directly monitor for unauthorized calls. S3 is for storage.

959
MCQmedium

A DevOps engineer needs to automate the creation of an AWS CodeStar project for a new microservice. The engineer wants to use AWS CloudFormation to define the project and its resources. Which CloudFormation resource should be used?

A.AWS::CodeStar::Project
B.AWS::ServiceCatalog::CloudFormationProduct
C.AWS::CodePipeline::Pipeline
D.AWS::CodeBuild::Project
AnswerA

AWS::CodeStar::Project is the CloudFormation resource that directly provisions a CodeStar project, bundling the project's underlying CI/CD infrastructure (typically CodePipeline, CodeBuild, an S3 bucket, and IAM roles) into a managed unit. It also creates the CodeStar project entry that appears in the developer dashboard and supports team member management. This is the only resource among the options that represents the CodeStar project itself, rather than a single constituent service.

Why this answer

AWS::CodeStar::Project is the correct CloudFormation resource because it directly creates an AWS CodeStar project, which is a project management hub that integrates AWS services like CodeCommit, CodeBuild, CodeDeploy, and CodePipeline for continuous delivery. This resource allows you to define the project template, source repository, and other settings in a single CloudFormation stack, automating the entire CodeStar project creation.

Exam trap

The trap here is that candidates may confuse CodeStar with its underlying services (CodePipeline, CodeBuild) and select a resource that creates only a part of the CI/CD pipeline, rather than the integrated project resource that automates the entire CodeStar project setup.

How to eliminate wrong answers

Option B is wrong because AWS::ServiceCatalog::CloudFormationProduct is used to create a product in AWS Service Catalog, which is a service for creating and managing a catalog of approved IT services, not for creating a CodeStar project. Option C is wrong because AWS::CodePipeline::Pipeline creates a CodePipeline pipeline, which is a CI/CD pipeline resource, but it does not create the overarching CodeStar project that orchestrates multiple services. Option D is wrong because AWS::CodeBuild::Project creates a CodeBuild build project, which is a single build step, not the full CodeStar project that includes source, build, deploy, and pipeline orchestration.

960
MCQeasy

A DevOps engineer receives a CloudWatch alarm indicating that an EC2 instance's CPU utilization has exceeded 90% for 10 minutes. The instance is part of an Auto Scaling group behind an Application Load Balancer. What is the MOST efficient initial step to troubleshoot the high CPU usage?

A.Review the EC2 instance's CloudWatch metrics for CPU credit balance and network utilization.
B.Modify the Auto Scaling group to use a larger instance type.
C.Check the ALB's HTTP 5xx error rate metric for the target group.
D.Immediately increase the desired capacity of the Auto Scaling group.
AnswerA

Reviewing the instance's CPU credit balance is the correct first step because a T-series instance that exhausts its earned credits will be throttled to the baseline CPU, causing slowdowns even when the alarm threshold is breached. The network utilization metric is also essential since high network throughput can drive CPU overhead from interrupt handling and packet processing, which may be the actual root cause. Together, these metrics reveal whether the alarm reflects genuine resource contention or a misconfigured alarm threshold.

Why this answer

Reviewing the EC2 instance's CloudWatch metrics for CPU credit balance and network utilization is the most efficient initial step to diagnose high CPU usage. CPU credit balance is critical for burstable performance instances (e.g., T2/T3), as a depleted credit balance directly causes sustained high CPU utilization. Network utilization metrics can reveal if the high CPU is driven by excessive traffic or a DDoS-like pattern, allowing targeted remediation without unnecessary scaling or configuration changes.

Exam trap

The trap here is that candidates often jump to scaling actions (Options B or D) or application-layer metrics (Option C) without first checking the instance's foundational health metrics, specifically CPU credit balance for burstable instances, which is the most efficient diagnostic step per AWS Well-Architected best practices.

How to eliminate wrong answers

Option B is wrong because modifying the Auto Scaling group to use a larger instance type is a reactive, long-term solution that does not diagnose the root cause and may incur unnecessary cost; the immediate need is to understand why CPU is high, not to blindly resize. Option C is wrong because checking the ALB's HTTP 5xx error rate metric for the target group focuses on application-layer errors, which are a symptom of high CPU but do not reveal the underlying cause (e.g., CPU credit exhaustion, process spike, or network saturation). Option D is wrong because immediately increasing the desired capacity of the Auto Scaling group is a scaling action that treats the symptom (high CPU) without investigating the cause, potentially leading to over-provisioning or masking a deeper issue like a memory leak or misconfigured application.

961
MCQhard

A company has a multi-account AWS environment using AWS Organizations. The security team needs to centrally monitor and analyze VPC Flow Logs from all accounts. The solution must be cost-effective and allow querying across accounts. Which approach should they take?

A.Use Amazon Elasticsearch Service (Amazon OpenSearch Service) with a cross-account ingestion pipeline.
B.Stream VPC Flow Logs from each account to Amazon Kinesis Data Analytics for real-time analysis.
C.Send VPC Flow Logs from each account to a centralized Amazon S3 bucket, then use Amazon Athena to query the logs.
D.Configure each account to send VPC Flow Logs to a central CloudWatch Logs group using cross-account subscription.
AnswerC

Sending VPC Flow Logs from each account to a centralized Amazon S3 bucket is correct because it creates a single, durable, cost-effective data lake that scales to petabytes. You configure each account's VPC Flow Logs to deliver to the same S3 bucket (with a bucket policy allowing cross-account delivery, ideally scoped to your AWS Organization ID). Then Amazon Athena can query these logs directly using standard SQL, with per-query pricing and no server to manage; using partition projection on account, region, and date drastically reduces scan costs and speeds up investigations.

Why this answer

It uses a centralized Amazon S3 bucket to aggregate VPC Flow Logs from all accounts, which is cost-effective (S3 storage costs are low) and enables cross-account querying via Amazon Athena using standard SQL. This approach avoids per-ingestion costs of services like CloudWatch Logs or Kinesis and provides a serverless, scalable query engine for analyzing logs across accounts.

Exam trap

The trap here is that candidates may overestimate the complexity of cross-account S3 access or underestimate the cost of CloudWatch Logs ingestion, leading them to choose Option D (central CloudWatch Logs group) which seems simpler but is actually more expensive and less query-friendly than S3+Athena.

How to eliminate wrong answers

Option A is wrong because Amazon OpenSearch Service (formerly Elasticsearch Service) incurs significant costs for ingestion and storage, and cross-account ingestion pipelines require complex setup with Lambda or Kinesis, making it less cost-effective than S3+Athena. Option B is wrong because Amazon Kinesis Data Analytics is designed for real-time stream processing, not for cost-effective historical querying across accounts; it would be overkill and expensive for periodic analysis of VPC Flow Logs. Option D is wrong because CloudWatch Logs cross-account subscriptions require each account to send logs to a central account's CloudWatch Logs group, which incurs per-ingestion costs and does not natively support SQL-based querying like Athena; querying across accounts would require additional tools or cross-account log group access, increasing complexity and cost.

962
MCQeasy

Refer to the exhibit. This S3 bucket policy allows the root user of account 111122223333 to perform which actions?

A.Change the bucket policy
B.Delete objects from the bucket
C.Read and write objects in the bucket
D.List objects in the bucket
AnswerC

This policy grants the root principal s3:GetObject and s3:PutObject actions on the arn:aws:s3:::bucket/* resource. s3:GetObject allows downloading an object's data and metadata, while s3:PutObject allows uploading a new object or overwriting an existing one. Together, these actions explicitly authorize reading and writing objects inside the bucket, which is exactly what the question asks — making this the correct option.

Why this answer

The policy grants s3:GetObject and s3:PutObject to the root user of the specified account. It does not grant other actions. The resource is objects under my-bucket.

The principal is the root user of the other account.

963
MCQhard

A company has a requirement to rotate database credentials every 30 days for an Amazon RDS for MySQL instance. The credentials are currently stored in AWS Secrets Manager. The DevOps engineer needs to implement automatic rotation without modifying the application code. Which solution should be used?

A.Create a scheduled job that runs every 30 days to update the secret in Secrets Manager with a new password.
B.Store the credentials in AWS Systems Manager Parameter Store and configure automatic rotation using a Lambda function.
C.Use the AWS RDS automatic password rotation feature, which automatically updates the password every 30 days.
D.Configure Secrets Manager to automatically rotate the secret every 30 days using a Lambda rotation function, and have the application retrieve the secret using the Secrets Manager API.
AnswerD

Secrets Manager natively supports rotation for RDS credentials through a managed Lambda function. The rotation function updates the password in the RDS database and then stores the new value in the secret, using staging labels like AWSCURRENT and AWSPENDING to ensure applications can always retrieve valid credentials. The application retrieves the current secret via the Secrets Manager API (for example, GetSecretValue), and effective caching keeps this cost-efficient. This exactly meets the requirement of rotating the database every 30 days while keeping the application functional.

Why this answer

AWS Secrets Manager natively supports automatic rotation of secrets using a Lambda function that updates both the secret in Secrets Manager and the password in the RDS MySQL instance. This solution meets the 30-day rotation requirement without modifying application code, as the application retrieves the current secret via the Secrets Manager API, which automatically handles versioning and caching.

Exam trap

The trap here is that candidates may confuse AWS Secrets Manager's automatic rotation with a simple scheduled update of the secret value, or mistakenly believe that RDS or Parameter Store have built-in rotation capabilities, when in fact only Secrets Manager with a Lambda rotation function provides a fully automated, code-free solution.

How to eliminate wrong answers

Option A is wrong because creating a scheduled job to update the secret in Secrets Manager does not change the password in the RDS instance, leaving the database credential out of sync. Option B is wrong because AWS Systems Manager Parameter Store does not support automatic rotation of database credentials; it lacks the built-in rotation mechanism and Lambda integration that Secrets Manager provides. Option C is wrong because Amazon RDS does not have an automatic password rotation feature; password rotation must be implemented manually or via Secrets Manager with a Lambda function.

964
Multi-Selectmedium

A company runs a critical web application on Amazon EC2 instances behind an Application Load Balancer (ALB) across multiple Availability Zones. The application stores session data in a shared Amazon ElastiCache for Redis cluster. The operations team reports that during a recent AZ failure, users experienced session loss and application errors. Which combination of actions should the company take to improve resilience and maintain session state during an AZ failure? (Choose TWO.)

Select 2 answers
A.Configure the ALB with cross-zone load balancing enabled and connection draining set to a suitable timeout.
B.Deploy an Auto Scaling group with a dynamic scaling policy that adds instances in the remaining AZs.
C.Enable cluster mode for the ElastiCache for Redis cluster and configure replica nodes in different Availability Zones.
D.Configure the application to use a custom DNS name with a low TTL pointing to the ElastiCache cluster endpoint.
E.Enable Multi-AZ for the ElastiCache cluster to automatically fail over to a replica in another AZ.
AnswersA, C

Cross-zone load balancing on the ALB ensures that incoming traffic is distributed evenly across all registered targets in every Availability Zone, preventing any single AZ from being overloaded and allowing the ALB to continue serving requests even if one AZ is impaired. Connection draining gives in-flight requests a grace period to complete before an instance is deregistered or replaced, avoiding request interruption during rolling updates or failed health checks. Together, these features support seamless instance replacement without dropping active requests, though they do not on their own preserve stored session data — they protect the connection lifecycle while the application layer (e.g., ElastiCache) handles state.

Why this answer

Enabling cross-zone load balancing on the ALB ensures traffic is distributed evenly across all EC2 instances in all AZs, and connection draining with a suitable timeout allows in-flight requests to complete before instances are deregistered, preventing session loss during an AZ failure. Option C is correct because enabling cluster mode for ElastiCache for Redis with replica nodes in different AZs provides automatic sharding and replication, ensuring session data remains available and consistent even if a primary node in one AZ fails. Option E is incorrect because while ElastiCache for Redis supports Multi-AZ with automatic failover, it alone does not guarantee that replica nodes are placed in different Availability Zones for each shard; enabling cluster mode with replicas in different AZs (Option C) provides a more comprehensive solution for maintaining session state during an AZ failure.

Exam trap

Candidates may choose Multi-AZ (Option E) thinking it provides cross-AZ failover for ElastiCache for Redis, which is true. However, Multi-AZ with automatic failover requires replication groups with replicas in different AZs. In a cluster-mode setup, you must explicitly ensure replicas are in different AZs per shard.

Option C directly addresses this by enabling cluster mode and configuring replica nodes in different AZs, making Option C a more complete solution for the given scenario of a shared cluster.

965
Multi-Selectmedium

A DevOps engineer is managing infrastructure as code using AWS CloudFormation. The engineer wants to automatically update a stack when changes are pushed to a Git repository. Which THREE services can be used together to achieve this?

Select 3 answers
A.AWS CloudFormation
B.Amazon CloudWatch Events
C.AWS CodeBuild
D.AWS CodeCommit
E.AWS CodePipeline
AnswersA, D, E

AWS CloudFormation is the core service that declaratively provisions and updates the stack by processing the template. It manages the resource lifecycle, applies change sets, and handles rollbacks in a controlled manner, making it the essential target of the infrastructure-as-code pipeline.

Why this answer

AWS CloudFormation is the core service that manages the infrastructure as code stack. When combined with AWS CodeCommit as the Git repository and AWS CodePipeline as the CI/CD orchestrator, changes pushed to the repository trigger a pipeline that automatically updates the CloudFormation stack. CodePipeline can directly invoke CloudFormation actions (create, update, delete stacks) using its built-in deployment provider, eliminating the need for intermediate compute services.

Exam trap

The trap here is that candidates may think Amazon CloudWatch Events (EventBridge) alone can trigger stack updates, but it lacks the deployment orchestration and rollback capabilities that CodePipeline provides natively for CloudFormation.

966
Multi-Selecthard

A company experiences a security incident where an IAM user's access key is compromised. Which THREE steps should the DevOps engineer take immediately?

Select 3 answers
A.Review AWS CloudTrail logs for any unauthorized API calls
B.Rotate the access key by creating a new key and deleting the old one
C.Change the IAM user's password
D.Delete the IAM user and recreate it
E.Revoke any temporary security credentials issued to the user
AnswersA, B, E

AWS CloudTrail records all IAM user and role API activity as events, including the source IP address, user agent, event name, and whether the call was authorized. Analyzing CloudTrail logs with querying or visualization tools helps you identify which unauthorized or anomalous calls occurred, when they occurred, and what resources were accessed, so you can scope the impact and determine whether other remediation steps are needed. It is the first responder's forensic tool for understanding the security incident.

Why this answer

Options A, B, and E are correct. Reviewing CloudTrail logs (A) helps identify the scope of unauthorized actions. Rotating the access key (B) invalidates the compromised key.

Revoking temporary security credentials (E) ensures any active sessions using the compromised key are terminated. Option C is incorrect because changing the password does not affect access keys. Option D is incorrect because deleting and recreating the user is more disruptive than necessary; rotating the key suffices.

967
MCQmedium

A company runs a serverless application using AWS Lambda and Amazon API Gateway. The application processes user uploads to an S3 bucket. The operations team uses CloudWatch Logs for monitoring, but they are finding it difficult to correlate logs across multiple Lambda functions that handle different parts of the workflow. The team wants to trace requests as they flow through the application and identify bottlenecks or errors. The team has already enabled CloudWatch Logs for all Lambda functions. What should the team do to achieve end-to-end request tracing?

A.Use CloudWatch Contributor Insights to analyze the log data and identify the top contributors to latency.
B.Use AWS CloudTrail to log all API calls and correlate them with CloudWatch Logs.
C.Create a CloudWatch ServiceLens service map to visualize the application components.
D.Enable AWS X-Ray on the Lambda functions and API Gateway to trace requests end-to-end.
AnswerD

AWS X-Ray provides distributed tracing by propagating a trace ID across instrumented services and recording segments and subsegments for each component. Enabling X-Ray on API Gateway and Lambda functions (e.g., via active tracing on the API Gateway stage and the Lambda execution role with X-Ray permissions) captures the full lifecycle of a request, including the API Gateway frontend, Lambda invocation, and any downstream SDK calls or HTTP requests. This allows you to follow a specific request through the entire architecture, view a service map, and drill into per-service latency, errors, and annotations, making it the correct solution for end-to-end tracing.

Why this answer

AWS X-Ray provides end-to-end tracing and integrates with Lambda and API Gateway, enabling request tracing across the entire workflow. Option A is wrong because CloudWatch Contributor Insights analyzes top contributors to latency but does not trace requests across services. Option B is wrong because CloudTrail logs API calls, not application-level tracing, and cannot correlate requests across Lambda functions.

Option C is wrong because CloudWatch ServiceLens provides service maps but relies on X-Ray for actual tracing; without X-Ray, ServiceLens cannot trace requests.

968
MCQeasy

A company uses AWS CodeDeploy with a blue/green deployment configuration. The engineer wants to automatically roll back the deployment if the new instances fail the health check for 5 minutes. Which setting should the engineer configure?

A.Create a CloudWatch alarm that monitors the health check endpoint
B.Configure the deployment group to roll back when a CloudWatch alarm is triggered
C.Set the Auto Scaling group health check grace period to 5 minutes
D.Set the deployment configuration's 'timeout' to 5 minutes
AnswerB

Configuring the deployment group to roll back when a CloudWatch alarm is triggered is the correct action because CodeDeploy natively supports this as a rollback trigger. An alarm can monitor any custom metric—including a health check endpoint—and when it transitions to ALARM, CodeDeploy automatically rolls back the deployment to the last known-good revision. This mechanism directly ties the health check's failure signals to the deployment lifecycle, enabling the desired rollback behavior.

Why this answer

AWS CodeDeploy blue/green deployments can be configured to automatically roll back when a CloudWatch alarm is triggered. By creating a CloudWatch alarm that monitors the health check endpoint and associating it with the deployment group, the engineer can ensure that if the alarm state persists for 5 minutes (as defined in the alarm's period and evaluation periods), CodeDeploy will automatically initiate a rollback to the previous working version.

Exam trap

The trap here is that candidates confuse the Auto Scaling group health check grace period (which delays EC2 health checks) with the application-level health check monitoring needed for CodeDeploy rollbacks, leading them to incorrectly select Option C.

How to eliminate wrong answers

Option A is wrong because simply creating a CloudWatch alarm that monitors the health check endpoint does not cause an automatic rollback; the alarm must be associated with the deployment group's rollback configuration. Option C is wrong because the Auto Scaling group health check grace period (default 300 seconds) only delays when EC2 health checks begin, but does not trigger a CodeDeploy rollback based on application-level health check failures. Option D is wrong because the deployment configuration's 'timeout' setting controls how long CodeDeploy waits for the deployment to complete before marking it as failed, not a health-check-based rollback trigger.

969
MCQeasy

A developer wants to automatically run unit tests when a pull request is created in AWS CodeCommit. Which AWS service should be used to trigger the tests?

A.AWS CodePipeline with source polling.
B.AWS CodeBuild with webhooks from CodeCommit.
C.AWS CloudWatch Logs subscription filter for repository logs.
D.Amazon EventBridge rule for CodeCommit pull request state changes targeting AWS Lambda.
AnswerD

Amazon EventBridge natively captures CodeCommit events, including the 'CodeCommit Pull Request State Change' detail type, and invokes Lambda via an event rule. This event-driven pattern eliminates polling and reacts the moment a pull request transitions to a state such as Approved or Merged. The Lambda function can run unit tests and then post results back to the pull request, and you can optionally route results to other services like SNS for notifications.

Why this answer

Amazon EventBridge can capture CodeCommit pull request state changes (e.g., created, updated, merged) via a rule and route them to a target like AWS Lambda. The Lambda function can then invoke unit tests in response to the pull request creation event. This provides a serverless, event-driven trigger without polling or webhooks.

Exam trap

The trap here is that candidates often confuse CodeCommit webhooks (which only support push events) with EventBridge events (which support pull request state changes), leading them to incorrectly select AWS CodeBuild with webhooks.

How to eliminate wrong answers

Option A is wrong because AWS CodePipeline with source polling periodically checks the repository for changes, but it cannot directly react to a pull request creation event; it is designed for continuous delivery pipelines, not event-driven triggers for specific pull request actions. Option B is wrong because AWS CodeBuild with webhooks from CodeCommit supports triggers on push events to branches, not on pull request creation events; webhooks in CodeBuild are configured for branch or tag changes, not for pull request state changes. Option C is wrong because AWS CloudWatch Logs subscription filter for repository logs would require CodeCommit to emit logs for pull request events (which it does not by default) and is not designed to trigger actions based on repository events; it is meant for real-time log processing.

970
MCQmedium

A company runs a stateful application on EC2 instances. The application stores session data locally. The instances are behind an ALB with sticky sessions enabled. A scaling event terminates an instance, causing loss of session data. How can the company prevent this while maintaining performance?

A.Use Amazon ElastiCache to store session data
B.Use a dedicated EC2 instance for sessions
C.Disable sticky sessions
D.Increase the sticky session duration
AnswerA

ElastiCache provides a resilient, high-performance session store.

Why this answer

Using ElastiCache for session storage externalizes session data, making it resilient to instance termination.

971
MCQeasy

A DevOps engineer is using AWS CloudFormation to deploy a stack that includes a VPC with public and private subnets. The engineer wants to ensure that the public subnets automatically get a public IP address assigned to instances launched in them. Which property should be set?

A.EnableDnsSupport on the VPC
B.MapPublicIpOnLaunch on the subnet
C.EnableDnsHostnames on the VPC
D.AssociatePublicIpAddress on the instance
AnswerB

MapPublicIpOnLaunch is a subnet-level attribute that, when set to true, automatically assigns a public IPv4 address to every instance's primary network interface upon launch. This is the correct control for achieving subnet-wide public IP assignment, as it directly applies at the subnet boundary and affects all instances regardless of individual launch configuration. Changing this attribute is the standard CloudFormation approach to provision instances in a public subnet with reachable IP addresses.

Why this answer

The `MapPublicIpOnLaunch` property on an AWS CloudFormation `AWS::EC2::Subnet` resource controls whether instances launched in that subnet automatically receive a public IP address. Setting this property to `true` ensures that any EC2 instance launched in the public subnet gets a public IPv4 address from the subnet's CIDR range, which is essential for internet-facing resources in a VPC.

Exam trap

The trap here is that candidates often confuse VPC-level DNS settings (`EnableDnsSupport` and `EnableDnsHostnames`) with subnet-level public IP assignment, or they mistakenly think the instance-level `AssociatePublicIpAddress` is the only way to control public IP assignment, ignoring the subnet-level auto-assign feature.

How to eliminate wrong answers

Option A is wrong because `EnableDnsSupport` on the VPC controls whether DNS resolution is supported for the VPC (i.e., the VPC's DNS server responds to queries), not whether instances get public IP addresses. Option C is wrong because `EnableDnsHostnames` on the VPC determines whether instances in the VPC are assigned DNS hostnames (e.g., ec2-xxx.compute-1.amazonaws.com), but it does not assign public IP addresses. Option D is wrong because `AssociatePublicIpAddress` is a property of an EC2 instance (e.g., in `AWS::EC2::Instance` or launch configuration), not a subnet-level setting; while it can override the subnet's behavior, the question asks for the property that ensures public IPs are assigned automatically at the subnet level.

972
Multi-Selecthard

A DevOps engineer is designing an infrastructure as code solution for a microservices application that runs on Amazon ECS with Fargate. The application requires a shared Application Load Balancer (ALB) and multiple ECS services. Which CloudFormation resources are required to expose each service behind the ALB? (Choose THREE.)

Select 3 answers
A.AWS::ElasticLoadBalancingV2::Listener
B.AWS::ElasticLoadBalancingV2::LoadBalancer
C.AWS::ECS::Service
D.AWS::ElasticLoadBalancingV2::ListenerRule
E.AWS::AutoScaling::AutoScalingGroup
AnswersA, C, D

The listener receives incoming traffic on a specific port.

Why this answer

AWS::ElasticLoadBalancingV2::Listener is correct because it defines the protocol and port (e.g., HTTP:80) on which the ALB accepts traffic. Without a listener, the ALB cannot receive incoming requests. This resource is essential for routing traffic to target groups that are associated with ECS services.

Exam trap

The trap here is that candidates often select the LoadBalancer resource (Option B) thinking it is required for each service, but the LoadBalancer is a shared resource created once, while the Listener, ListenerRules, and ECS Service are the per-service components that enable routing.

973
MCQmedium

A company uses AWS KMS to encrypt data in S3. The security team requires that the key material be rotated every 90 days. What should be done to meet this requirement?

A.Create a customer managed key and enable automatic yearly rotation.
B.Use an AWS managed key (SSE-S3) and enable rotation.
C.Use a custom key store with imported key material and enable automatic rotation.
D.Create a customer managed key and manually rotate it every 90 days.
AnswerD

Customer managed keys are the only KMS key type that supports manual rotation, allowing you to create a new key and update aliases as needed at any time. By manually rotating every 90 days, the company can enforce its required rotation policy while keeping the same alias or key ID for applications. This gives full control over rotation frequency, unlike automatic rotation which is fixed at yearly.

Why this answer

AWS KMS customer managed keys support manual rotation, which allows you to rotate the key material every 90 days as required. Automatic key rotation for customer managed keys is only available with a minimum rotation period of 365 days (yearly), so it cannot meet a 90-day requirement. Manual rotation creates a new backing key while retaining the old one for decryption of previously encrypted data, ensuring compliance with the 90-day rotation policy.

Exam trap

The trap here is that candidates assume automatic rotation can be configured to any interval, but AWS KMS only supports automatic rotation with a fixed 365-day period for customer managed keys, so a 90-day requirement forces manual rotation.

How to eliminate wrong answers

Option A is wrong because automatic yearly rotation for customer managed keys has a fixed period of 365 days, which cannot be changed to 90 days. Option B is wrong because AWS managed keys (SSE-S3) do not support user-controlled rotation; they are rotated automatically by AWS but the rotation schedule is not configurable and does not meet a specific 90-day requirement. Option C is wrong because a custom key store with imported key material does not support automatic rotation; you must manually re-import new key material to rotate, and automatic rotation is not available for imported keys.

974
Multi-Selectmedium

A company is building a multi-tier web application on AWS. The application must be resilient to the failure of an entire Availability Zone. The architecture includes an Application Load Balancer (ALB), EC2 instances in an Auto Scaling group, and an Amazon RDS for MySQL database. Which TWO actions should be taken to achieve this resilience? (Choose two.)

Select 2 answers
A.Configure an RDS read replica in a different Availability Zone.
B.Use a Single-AZ RDS for MySQL database to keep costs low.
C.Place all EC2 instances in the same Availability Zone to reduce cross-AZ data transfer costs.
D.Configure the Auto Scaling group to launch EC2 instances in at least two Availability Zones.
E.Deploy the RDS for MySQL database in a Multi-AZ configuration.
AnswersD, E

Distributing instances across AZs provides high availability for the web tier.

Why this answer

Configuring the Auto Scaling group to launch EC2 instances in at least two Availability Zones ensures that if one AZ fails, the remaining AZ(s) can continue serving traffic. This is a fundamental pattern for building AZ-resilient compute tiers. Option E is correct because deploying Amazon RDS for MySQL in a Multi-AZ configuration automatically provisions and maintains a synchronous standby replica in a different AZ, providing automatic failover if the primary DB instance fails, thus ensuring database resilience.

Exam trap

The trap here is that candidates often confuse read replicas (asynchronous, for read scaling) with Multi-AZ deployments (synchronous, for high availability), and mistakenly think placing all resources in one AZ reduces costs without recognizing the critical single point of failure it introduces.

975
MCQeasy

A company has a legacy application running on an EC2 instance that is not part of an Auto Scaling group. The instance is experiencing a memory leak. The DevOps engineer needs to collect memory metrics to analyze the issue without modifying the application. What should the engineer do?

A.Install the CloudWatch agent on the instance and configure it to collect memory metrics.
B.Use the AWS Management Console to view memory metrics from the EC2 monitoring tab.
C.Use EC2Rescue to generate a memory dump and analyze it.
D.Enable CloudWatch detailed monitoring on the instance.
AnswerA

The default EC2 monitoring only exposes hypervisor-level metrics like CPU, network, and disk I/O; memory utilization is a guest-OS metric that AWS cannot see without an in-guest component. Installing the unified CloudWatch agent (with the `mem_used_percent` and similar metrics in the agent's JSON config) and starting the `amazon-cloudwatch-agent` service enables the agent to publish memory metrics to CloudWatch, making them available for alarms and dashboards. This is required because no amount of instance-level monitoring settings can surface guest-OS memory.

Why this answer

The CloudWatch agent is required to collect custom metrics like memory utilization from an EC2 instance because the standard EC2 monitoring only captures hypervisor-level metrics (CPU, network, disk I/O). By installing and configuring the CloudWatch agent, the engineer can collect memory metrics without modifying the application code, directly addressing the memory leak analysis requirement.

Exam trap

The trap here is that candidates often assume the EC2 monitoring tab or detailed monitoring includes memory metrics, but AWS does not provide OS-level metrics (memory, disk space, swap usage) without the CloudWatch agent.

How to eliminate wrong answers

Option B is wrong because the AWS Management Console EC2 monitoring tab only displays default metrics (CPU, network, disk, status checks) and does not include memory metrics, which require a custom agent. Option C is wrong because EC2Rescue is a tool for troubleshooting and repairing common EC2 issues (e.g., OS boot failures, disk corruption), not for collecting ongoing memory metrics; it can generate a memory dump but that is a one-time snapshot, not a continuous metric stream for trend analysis. Option D is wrong because enabling CloudWatch detailed monitoring only increases the frequency of default metric collection (from 5 minutes to 1 minute) but does not add memory metrics, which are not available at the hypervisor level.

Page 12

Page 13 of 15

Page 14