Courseiva

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

1487 questions total · 20pages · All types, answers revealed

Page 19

Page 20 of 20

1426
Multi-Selecthard

Which TWO metrics should be monitored in Amazon CloudWatch to detect a potential memory leak in an EC2 instance? (Choose two.)

Select 2 answers
A.DiskReadOps
B.MemoryUtilization (custom metric published via CloudWatch Agent).
C.NetworkIn
D.SwapUsage (custom metric published via CloudWatch Agent).
E.CPUUtilization
AnswersB, D

MemoryUtilization, published as a custom metric by the CloudWatch Agent, is calculated from /proc/meminfo or OS-level memory counters and represents the percentage of actual RAM in use. A memory leak causes this value to climb continuously over time as allocations are never freed, even when the workload is stable. Monitoring this metric reveals the leak as a monotonic upward trend, making it one of the most direct and essential signals for detection.

Why this answer

MemoryUtilization is a custom metric that must be published via the CloudWatch Agent because EC2 does not expose memory metrics by default. Monitoring this metric over time can reveal a steady upward trend in memory usage that does not drop after processes complete, which is a classic symptom of a memory leak.

Exam trap

The trap here is that candidates assume EC2 provides memory metrics by default (like CPUUtilization), but they must be explicitly enabled via the CloudWatch Agent, and they overlook SwapUsage as a complementary indicator of memory pressure from a leak.

1427
Drag & Dropmedium

Drag and drop the steps to set up an AWS CloudFormation stack with a nested stack.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

First upload the nested stack template, then create the parent template, then validate, then create stack, then monitor.

1428
MCQeasy

A company wants to ensure its data in Amazon S3 is protected against accidental deletion. The bucket stores critical documents. Which approach provides the HIGHEST level of resilience?

A.Apply a bucket policy that denies s3:DeleteObject for all users.
B.Enable S3 lifecycle policies to archive objects to Glacier.
C.Enable versioning and MFA delete on the bucket.
D.Configure cross-region replication (CRR) to another bucket.
AnswerC

Enabling versioning on the bucket creates a new version for every object put, overwrite, or delete, so a delete operation only inserts a delete marker that hides old versions rather than purging them; with versioning enabled, you can permanently recover any object version. MFA Delete fortifies this by requiring an MFA code (using root credentials) to permanently delete an object version, suspend versioning, or change the versioning state—thus preventing attackers or accidental admin actions from irreversibly destroying data.

Why this answer

Enabling versioning and MFA delete provides protection against both accidental overwrites and malicious deletions. Versioning allows recovery of deleted or overwritten objects, while MFA delete adds an extra layer of security by requiring multi-factor authentication for permanent deletions. Option A is incorrect because a bucket policy that denies s3:DeleteObject can prevent deletions but does not allow recovery if the policy is bypassed or changed.

Option B is incorrect because lifecycle policies archive objects to Glacier, which reduces costs but does not prevent or recover from accidental deletion. Option D is incorrect because cross-region replication protects against regional failures but does not protect against accidental deletion within the source bucket.

1429
MCQhard

A company's production environment consists of EC2 instances in an Auto Scaling group behind an Application Load Balancer (ALB). The instances run a web application that stores session data in an ElastiCache Redis cluster. The company has enabled detailed CloudWatch metrics and set up a dashboard. The operations team notices that the average CPU utilization across the Auto Scaling group spikes to 95% every 15 minutes, coinciding with a high number of Redis connections. What is the MOST likely cause?

A.The application is using Memcached instead of Redis, causing increased load.
B.The Auto Scaling group's scaling policy is based on memory utilization instead of CPU.
C.The ALB has session stickiness enabled, causing traffic to be routed to the same instances.
D.The ElastiCache cluster is not large enough to handle the number of requests.
AnswerC

With session stickiness enabled on the ALB target group, the load balancer consistently routes a given client's requests to the same EC2 instance for the stickiness duration. When a few power users or long-lived connections generate heavy traffic, those specific instances absorb a disproportionate share of load, causing CPU utilization to spike even if the aggregate fleet average remains moderate. This creates a hot-spot pattern where some targets are saturated while others idle, and the Auto Scaling group, if scaling on average CPU, may not react in time.

Why this answer

ALB session stickiness (sticky sessions) causes the load balancer to route requests from the same client to the same EC2 instance. When a large number of clients connect simultaneously (e.g., due to a periodic batch job), they may all be routed to the same few instances, causing CPU spikes on those instances. The high number of Redis connections corresponds to the sessions being stored in Redis.

This explains the 15-minute periodic spikes. Option A is incorrect because Memcached is not used; the question states ElastiCache Redis. Option B is incorrect because the scaling policy is based on CPU utilization, not memory.

Option D is incorrect because the cluster size doesn't cause periodic spikes; it would cause consistent high utilization.

1430
MCQmedium

A company uses Terraform with an S3 backend to manage infrastructure. The DevOps engineer notices that after a colleague runs 'terraform apply' locally, the state file in S3 becomes corrupted and subsequent runs fail. What is the BEST way to prevent this issue?

A.Store the state file locally and commit it to version control.
B.Use DynamoDB for state locking and enable consistency checks.
C.Use S3 server-side encryption to protect the state file.
D.Enable S3 versioning on the state bucket to recover previous versions.
AnswerB

The DynamoDB lock table uses conditional writes to ensure that only one Terraform run can hold the state lock at a time, preventing two `apply` executions from simultaneously updating the same S3 object and causing corruption. Enabling consistency checks (for example, verifying the lock acquisition and using DynamoDB's strongly consistent reads) ensures that the state pulled before a plan or apply is the latest known-good version, so stale or partially written state is never used as the basis for changes.

Why this answer

Enabling DynamoDB for state locking prevents concurrent modifications that can corrupt the state file. When a user runs 'terraform apply', Terraform acquires a lock in DynamoDB, ensuring only one operation modifies the state at a time. Consistency checks (e.g., using DynamoDB's conditional writes) further validate that the state hasn't been tampered with, directly addressing the corruption issue.

Exam trap

The trap here is that candidates often confuse recovery mechanisms (like S3 versioning) with prevention mechanisms (like state locking), leading them to choose Option D even though it only mitigates damage after corruption occurs.

How to eliminate wrong answers

Option A is wrong because storing the state file locally and committing it to version control introduces risks of manual merge conflicts, stale state, and accidental exposure of sensitive data; it does not prevent corruption from concurrent applies. Option C is wrong because S3 server-side encryption protects data at rest but does not prevent concurrent writes or state corruption from race conditions. Option D is wrong because S3 versioning allows recovery of previous state versions after corruption, but it does not prevent the corruption from occurring in the first place.

1431
MCQeasy

A company uses AWS CodeBuild to compile a Java application. The build specification includes a pre-build phase to download dependencies. Which file defines the commands for each build phase?

A.pipeline.json
B.buildspec.yml
C.config.xml
D.appspec.yml
AnswerB

buildspec.yml is the correct file because AWS CodeBuild automatically looks for a file named buildspec.yml in the root of the source code directory, unless an alternate buildspec file is specified in the build project. This YAML file defines the build phases—install, pre_build, build, and post_build—along with environment variables, artifact output, and cache settings. For a Java application, the `build` phase would contain commands such as `mvn compile` or `gradle build` to compile the source code. Without a valid buildspec, CodeBuild will fail unless an inline buildspec is provided in the project configuration.

Why this answer

In AWS CodeBuild, the build specification file named 'buildspec.yml' defines the commands that CodeBuild runs during each phase of the build process, including the pre-build phase for downloading dependencies. This YAML file is placed in the root of the source code or specified in the build project configuration, and it contains structured sections for install, pre_build, build, and post_build phases. Option B is correct because buildspec.yml is the standard file that CodeBuild uses to orchestrate build commands.

Exam trap

The trap here is that candidates often confuse the build specification file for CodeBuild (buildspec.yml) with the deployment specification file for CodeDeploy (appspec.yml), especially since both services are part of the AWS CI/CD pipeline and have similar naming patterns.

How to eliminate wrong answers

Option A is wrong because pipeline.json is not a file used by AWS CodeBuild; it is associated with AWS CodePipeline for defining pipeline stages and actions, not for specifying build phase commands. Option C is wrong because config.xml is a configuration file commonly used by Jenkins (a different CI/CD tool) for job configuration, not by AWS CodeBuild. Option D is wrong because appspec.yml is used by AWS CodeDeploy to define deployment lifecycle hooks and file mappings, not for CodeBuild build phases.

1432
MCQhard

A company has a multi-account strategy using AWS Organizations. The security team needs to respond to incidents across all accounts. They want to ensure that all CloudTrail trails are enabled and logging to a central S3 bucket in the management account. What is the MOST efficient way to monitor compliance?

A.Create a CloudTrail organization trail and use CloudTrail Insights to detect configuration changes.
B.Use AWS Config conformance packs with a managed rule to check CloudTrail is enabled.
C.Set up CloudWatch Events rules in each account to detect trail disabling.
D.Use AWS Trusted Advisor to check CloudTrail configuration in each account.
AnswerB

AWS Config conformance packs provide a way to deploy a collection of AWS Config rules and remediation actions across all accounts and Regions in an organization. A managed rule such as `cloudtrail-enabled` can be included in a conformance pack to verify that CloudTrail trails are configured and enabled, and the results are aggregated centrally in the AWS Config console for the entire organization. This approach gives a single, policy-as-code mechanism to enforce and audit CloudTrail enablement consistently across every account.

Why this answer

AWS Config conformance packs with managed rules can be deployed across multiple accounts using StackSets or directly via AWS Organizations to check that CloudTrail trails are enabled and logging to a central S3 bucket. This provides centralized, automated compliance monitoring without manual per-account setup. Option A is wrong because CloudTrail Insights detects unusual API activity, not configuration compliance.

Option C is wrong because setting up CloudWatch Events rules in each account is less efficient and harder to maintain than Config conformance packs. Option D is wrong because Trusted Advisor checks are per-account and cannot be centrally enforced across an organization.

Exam trap

Candidates might mistakenly believe that CloudTrail organization trails or Trusted Advisor can monitor compliance across all accounts, but neither provides the centralized rule enforcement and automated remediation that AWS Config conformance packs offer.

1433
MCQeasy

Refer to the exhibit. A DevOps engineer attaches the IAM policy to an IAM user. The user reports being unable to download objects from the S3 bucket. What is the likely cause?

A.The bucket policy denies access to the user
B.The policy is malformed because the Resource element is incorrect
C.The policy does not allow s3:ListBucket, which is required for the AWS CLI to list objects
D.The user's access key is expired
AnswerC

The AWS CLI's high-level command aws s3 cp does not directly invoke GetObject on a known key; it first performs a ListObjectsV2 operation to discover the objects in the bucket. Even if the IAM policy allows s3:GetObject, without the s3:ListBucket permission the CLI receives AccessDenied when attempting to list the source bucket. This is a common gotcha because users assume GetObject is sufficient for downloads, but the CLI's behavior requires both actions for object transfer commands.

Why this answer

The policy only allows s3:GetObject, but the user may be trying to list objects or access a bucket that requires additional permissions. Option A is wrong because the policy allows GetObject. Option B is wrong because the policy is not malformed.

Option D is wrong because the user is allowed to access the bucket.

1434
MCQmedium

A company uses AWS CodePipeline to deploy a Node.js application to AWS Elastic Beanstalk. The pipeline includes a build stage using AWS CodeBuild. Developers notice that the deployed application occasionally crashes due to missing environment variables that were configured in the Elastic Beanstalk environment but not passed from CodeBuild. What is the MOST efficient way to ensure the environment variables are consistently applied?

A.Define environment variables in the source code using .ebextensions configuration files.
B.Update the environment variables manually in the Elastic Beanstalk console after each deployment.
C.Use the aws elasticbeanstalk update-environment CLI command after the pipeline completes.
D.Store environment variables in AWS Systems Manager Parameter Store and have the application retrieve them at runtime.
AnswerA

Commit the variables in a .ebextensions/*.config file (e.g., option_settings for namespace aws:elasticbeanstalk:application:environment). CodePipeline packages the entire source into the application version, and the Elastic Beanstalk deployment agent processes this file automatically, injecting the values into the Node.js process's environment. This makes environment configuration declarative, versioned, and reproducible for every pipeline run, eliminating manual or post-deployment steps.

Why this answer

Ebextensions configuration files allow you to define environment variables declaratively in the source code, ensuring they are consistently applied during every deployment via CodePipeline. This approach eliminates the dependency on runtime or manual steps, as the Elastic Beanstalk environment automatically reads these files during environment creation and updates. It integrates seamlessly with CodeBuild and CodePipeline, making it the most efficient and reliable method for maintaining environment variable consistency.

Exam trap

The trap here is that candidates often assume runtime parameter retrieval (e.g., from Parameter Store or Secrets Manager) is the best practice for all scenarios, but for environment variables required at process startup in Elastic Beanstalk, .ebextensions provide a more reliable and simpler solution that avoids application code changes and ensures variables are set before the application runs.

How to eliminate wrong answers

Option B is wrong because manually updating environment variables in the Elastic Beanstalk console after each deployment is error-prone, not scalable, and violates the principle of infrastructure as code, leading to configuration drift. Option C is wrong because using the aws elasticbeanstalk update-environment CLI command after the pipeline completes introduces an extra post-deployment step that can fail or be forgotten, and it does not tie the variables to the source code version, making rollbacks inconsistent. Option D is wrong because while Parameter Store can be used for runtime retrieval, it requires application code changes to fetch variables at startup, adds latency, and does not guarantee the variables are present during the Elastic Beanstalk environment initialization, potentially causing crashes before the application code runs.

1435
Multi-Selectmedium

A company uses AWS CodePipeline with a source stage from Amazon S3 and a deploy stage to AWS Elastic Beanstalk. The pipeline has been working for months, but recently the deploy stage started failing with the error 'The S3 object does not exist.' The source artifact is uploaded to the S3 bucket by an external system. Which TWO actions should be taken to resolve this issue? (Choose TWO.)

Select 2 answers
A.Ensure the external system does not overwrite the object after the pipeline execution starts.
B.Change the source stage to use AWS CodeCommit instead of S3.
C.Enable versioning on the S3 bucket and configure the pipeline to use the specific version ID.
D.Use server-side encryption with AWS KMS (SSE-KMS) on the S3 bucket.
E.Increase the timeout for the deploy stage in the pipeline.
AnswersA, C

CodePipeline's S3 source action resolves the artifact by object key at the moment the pipeline execution starts. If an external system overwrites or deletes that object during the run, the pipeline may fetch a different revision or fail entirely because the original content no longer exists. Enforcing immutability through a write-once policy or access controls prevents this race condition and guarantees the pipeline operates on a stable artifact.

Why this answer

The deploy stage fails with 'The S3 object does not exist' when the external system overwrites the source artifact after the pipeline execution starts. CodePipeline references the object by its key at the time the pipeline is triggered; if the object is replaced (i.e., deleted and re-uploaded with the same key), the pipeline may attempt to download a version that no longer exists, especially if the S3 bucket is not versioned. Ensuring the external system does not overwrite the object during execution prevents this race condition.

Exam trap

The trap here is that candidates often assume the error is due to a permission or encryption issue (like SSE-KMS) rather than recognizing it as a classic race condition caused by object overwriting in a non-versioned bucket.

1436
MCQhard

A large enterprise uses AWS Systems Manager to manage configuration drift on thousands of EC2 instances. The compliance team requires that instances must have a specific security configuration enforced by a Systems Manager State Manager association. The association is configured to run every 30 minutes. However, some instances consistently report a status of 'Failed' in the association compliance dashboard. The instances are running and have the SSM Agent installed. What is the MOST likely cause of the failures?

A.The instances do not have the required IAM instance profile to execute the association document.
B.The instances are behind a firewall that blocks communication with the Systems Manager endpoint.
C.The association is configured to run at a specific time that conflicts with the instance's maintenance window.
D.The SSM Agent version on the instances is outdated and not compatible with the association document.
AnswerA

When an SSM association runs, the SSM Agent on the instance must assume an IAM instance profile that grants permissions such as ssm:DescribeAssociation and ssm:UpdateAssociationStatus. If that profile is missing, the agent cannot authenticate its requests to the Systems Manager API, and the association execution fails - typically with a status of 'Failed' or an 'InvalidInstanceId' error. This is the most common cause of an association failing for instances that are otherwise registered and visible in Manager.

Why this answer

The most likely cause is that the instances lack the required IAM instance profile permissions to execute the association document. State Manager associations require the EC2 instance to have an IAM role that grants permissions for the Systems Manager actions defined in the document. Without the correct instance profile, the association fails consistently.

Option B (firewall) would affect all communication, not just the association. Option C (maintenance window conflict) would result in a different status, such as 'Pending'. Option D (outdated SSM Agent) would typically cause a different error or the agent would be automatically updated.

1437
MCQhard

A company runs a web application on Amazon ECS with Fargate launch type behind an Application Load Balancer (ALB). The application uses an RDS MySQL database. The security team performed a penetration test and discovered that the application is vulnerable to SQL injection. The development team has deployed a WAF web ACL to the ALB that includes rules to block SQL injection attacks. However, after the deployment, the application started returning 403 errors for legitimate requests, and the security team needs to investigate. The team also wants to ensure that only approved AWS services can access the RDS database. The current security groups are configured with a rule that allows inbound traffic from the ALB security group to the RDS database on port 3306. Which combination of actions should the security team take to resolve the issue and improve the security posture?

A.Disable the WAF rules that are causing false positives and add network ACLs to block all traffic to the database except from the ALB.
B.Remove the WAF web ACL and rely on security group ingress rules that allow all traffic from the VPC CIDR to the database.
C.Switch the WAF web ACL to count mode and add a second ALB in front of the database to filter traffic.
D.Switch the WAF web ACL to count mode while tuning the rules, and implement an IAM policy to restrict database access to specific AWS services using the aws:SourceArn condition key.
AnswerD

Switching to count mode allows monitoring and tuning of WAF rules to eliminate false positives while still detecting SQL injection. Implementing an IAM policy with the aws:SourceArn condition key restricts database access to only approved AWS services, enhancing security beyond network controls.

Why this answer

The correct answer. Switching the WAF web ACL to count mode allows the security team to monitor requests that would be blocked without actually blocking them, enabling them to fine-tune the rules to eliminate false positives while still protecting against SQL injection. Additionally, implementing an IAM policy with the aws:SourceArn condition key can restrict database access to only approved AWS services, such as Lambda functions or specific EC2 instances, enhancing the security posture beyond just network-level controls.

Option A is incorrect because disabling WAF rules would leave the application vulnerable, and network ACLs are stateless and not sufficient for fine-grained access control. Option B is incorrect because relying solely on security groups with VPC CIDR allows broad access and does not address the false positive issue. Option C is incorrect because adding a second ALB is unnecessary and does not solve the false positive problem, and using count mode alone without IAM policy does not address database access restrictions.

1438
MCQeasy

A company experiences an unexpected spike in network traffic to a web application hosted on EC2 instances behind an Application Load Balancer. The DevOps team needs to investigate the source IP addresses generating the traffic. Which AWS service should they use to capture the traffic?

A.Amazon CloudWatch Logs
B.AWS Config
C.AWS CloudTrail
D.VPC Flow Logs
AnswerD

VPC Flow Logs capture IP traffic metadata for every network interface in a VPC, subnet, or at the interface level, recording source and destination IP addresses, ports, protocol, packet/byte counts, and whether the action was accepted or rejected by security groups and network ACLs. Enabling flow logs on the affected VPC or subnets would immediately provide the raw data needed to identify the top talkers, unusual port usage, or malicious sources behind the spike. This makes it the correct service for diagnosing an unexpected increase in network traffic.

Why this answer

VPC Flow Logs capture IP traffic information, including source and destination IPs, ports, and protocols, allowing investigation of source IPs. Option A (CloudWatch Logs) is wrong because it captures application logs, not network traffic. Option B (AWS Config) is wrong because it records resource configuration changes.

Option C (CloudTrail) is wrong because it logs API calls, not network traffic.

1439
MCQmedium

A company is using AWS OpsWorks for configuration management. They have a stack with a PHP application layer and a MySQL layer. The DevOps team needs to update the PHP version across all instances. They create a custom Chef recipe that updates the PHP package and add it to the lifecycle events. After running the 'Setup' lifecycle event on the layer, the instances are updated but the application stops working because the new PHP version is incompatible with some custom PHP extensions. The team needs to roll back the PHP version to the previous one quickly and minimize downtime. The instances are in an Auto Scaling group with a desired count of 4. What should the team do?

A.Re-run the old 'Setup' recipe that installs the previous PHP version on the layer.
B.Create a new AMI with the old PHP version, launch new instances, and terminate the old ones.
C.Use the OpsWorks 'Rollback' feature to revert the stack to a previous state.
D.Manually SSH into each instance and downgrade the PHP package, then restart the web server.
AnswerA

The correct approach in OpsWorks Stacks is to run the original 'Setup' recipe manually on the layer by using the 'Execute Recipes' action, which re-applies the Chef code that installs and configures the previous PHP version on all instances. Because lifecycle recipes should be idempotent, re-running the Setup recipe restores the desired PHP version without needing to recreate instances or manually edit files. This leverages OpsWorks's intended pattern for configuration changes and updates all instances in the layer in a controlled, automated manner.

Why this answer

Re-running the old 'Setup' recipe on the layer will revert the PHP version to its previous state, leveraging Chef's idempotency and the OpsWorks lifecycle event system. This approach minimizes downtime as it only re-applies the old configuration without reprovisioning instances. Option B is incorrect because creating a new AMI and launching new instances takes time and may cause prolonged downtime.

Option C is incorrect because OpsWorks does not have a built-in 'Rollback' feature; you must use recipes to revert changes. Option D is incorrect because manually SSHing into each instance is error-prone, not scalable, and not recommended for production environments.

Exam trap

Candidates might assume that OpsWorks has a native rollback feature for stacks, but it does not. The correct approach is to re-run the previous recipe via the appropriate lifecycle event.

1440
Multi-Selectmedium

A company is designing a disaster recovery plan for an RDS PostgreSQL database. They have a cross-region read replica. Which THREE steps should they take to ensure a successful failover?

Select 3 answers
A.Enable automated backups on the replica before promotion
B.Configure applications to use the new database endpoint
C.Update Route 53 DNS record to point to the new master
D.Promote the read replica to a standalone database instance
E.Enable Multi-AZ on the read replica before promotion
AnswersB, C, D

A promoted read replica is a new database instance with a distinct DNS endpoint; the original master endpoint does not automatically reroute to the replica. Applications that connect using the old endpoint will continue hitting the original instance (or fail if it is down), so you must update your connection strings or configuration to use the promoted replica's endpoint. In complex environments, this is often managed via a CNAME that can be repointed to the replica, but the core requirement is that clients resolve to the new master.

Why this answer

To failover a cross-region read replica, promote it to a standalone database instance (Option D). After promotion, update the Route 53 DNS record to point to the new master (Option C) and configure applications to use the new database endpoint (Option B). Option A is incorrect because automated backups are enabled by default on the replica once promoted or can be enabled separately, but they are not required prior to promotion.

Option E is incorrect because Multi-AZ is not supported on read replicas in the same region; cross-region replicas also cannot have Multi-AZ before promotion. Multi-AZ can be configured after promotion if desired.

1441
MCQhard

A company runs a production application on Amazon ECS with Fargate launch type. The application uses an RDS MySQL database. The security team requires that all traffic between the application and the database be encrypted in transit. Currently, the database security group allows inbound traffic from the ECS tasks' security group on port 3306 (MySQL). The application uses the standard MySQL client connection without SSL. After enabling SSL on the RDS instance, the application starts failing to connect. The error logs show 'SSL connection error: protocol version mismatch'. The application runs on a custom Docker image based on Amazon Linux 2. The DevOps engineer needs to fix the connection issue. Which course of action should the engineer take?

A.Update the Docker image to include the latest MySQL client libraries that support TLS 1.2.
B.Update the application code to connect using SSL with the --ssl-mode=REQUIRED flag.
C.Modify the RDS parameter group to allow TLS 1.0 and 1.1.
D.Create a VPC peering connection and route traffic through a VPN.
AnswerA

The root cause is a TLS protocol version mismatch: the MySQL client library in the Docker image is too old to negotiate TLS 1.2, which is the minimum version required by Amazon RDS for MySQL. Rebuilding the Docker image with the latest MySQL client libraries ensures the client supports TLS 1.2 (and later), allowing the SSL handshake to succeed. This is the correct fix because it directly addresses the version negotiation failure at the transport layer without forcing insecure protocol fallbacks.

Why this answer

The error indicates that the MySQL client in the container does not support the TLS version required by RDS. The simplest solution is to modify the application connection string to use the '--ssl-mode=REQUIRED' flag or equivalent, but the error persists even after that. The actual fix is to update the MySQL client libraries in the container image to a version that supports TLS 1.2, as RDS requires TLS 1.2 or higher.

Alternatively, the engineer can configure RDS to accept TLS 1.0, but that is not secure. Changing the security group or using SSH tunneling does not address the TLS version mismatch.

1442
MCQhard

A company runs a containerized microservices application on Amazon EKS. The application includes a critical service that processes real-time financial transactions. This service must be highly available and resilient to node failures. The current setup uses a Deployment with 3 replicas and a ClusterIP service. During a recent node failure, the application experienced a brief period of unavailability. Which action should the DevOps engineer take to improve resilience without changing the underlying infrastructure?

A.Change the service type from ClusterIP to NodePort and configure an external load balancer.
B.Increase the number of replicas to 10 and use a node selector to schedule all pods on the largest instance type.
C.Configure a PodDisruptionBudget with a maxUnavailable of 1, and add pod anti-affinity rules to spread pods across different nodes.
D.Enable HorizontalPodAutoscaler with a target CPU utilization of 50% to automatically scale the Deployment.
AnswerC

A PodDisruptionBudget with maxUnavailable:1 guarantees that at most one Pod is unavailable during voluntary evictions such as node drains, and pod anti-affinity rules (preferably with topologyKey kubernetes.io/hostname) force the scheduler to place replicas on distinct nodes. This means an involuntary node failure can kill only one replica, and the remaining replicas continue to serve traffic. Combined, these mechanisms directly address both failure classes—involuntary hardware failures and voluntary maintenance—by ensuring the application always has at least N-1 replicas available across different failure domains.

Why this answer

A PodDisruptionBudget with maxUnavailable=1 ensures that at most one pod is unavailable during voluntary disruptions, while pod anti-affinity rules force the scheduler to distribute pods across different nodes. This combination prevents a single node failure from taking down all replicas, maintaining service availability without altering the underlying infrastructure.

Exam trap

The trap here is that candidates often confuse scaling (HPA or more replicas) with resilience, failing to realize that without proper pod distribution and disruption budgets, scaling alone cannot prevent downtime from node failures.

How to eliminate wrong answers

Option A is wrong because changing to NodePort with an external load balancer adds network complexity and does not address pod distribution or node failure resilience; the ClusterIP service already provides internal load balancing. Option B is wrong because increasing replicas to 10 and using node selector to pin pods to the largest instance type actually reduces resilience by creating a single point of failure on that node. Option D is wrong because HorizontalPodAutoscaler scales based on CPU utilization, which does not protect against node failures; it may even exacerbate the problem by scaling pods onto the same failing nodes.

1443
Multi-Selecthard

A company runs a critical application on Amazon EC2 instances in an Auto Scaling group. The application generates logs that are sent to Amazon CloudWatch Logs. The DevOps team needs to configure a metric filter to monitor for error patterns and trigger an alarm when the error rate exceeds 5% of total requests over a 5-minute period. Which TWO steps should the team take? (Choose TWO.)

Select 2 answers
A.Create a CloudWatch Logs log group for the error metric.
B.Create a metric filter on the log group to count occurrences of the error pattern.
C.Create a CloudWatch Logs subscription filter to stream errors to a Lambda function that calculates the error rate.
D.Create a CloudWatch metric for the error count.
E.Create a CloudWatch alarm that uses a math expression to calculate the error rate (error count / total request count) and compare it to the threshold of 5%.
AnswersB, E

This creates a custom metric for error count.

Why this answer

To achieve the monitoring goal, the team must first create a metric filter on the existing log group (Option B). This filter defines the error pattern to count and emits a custom metric for the error count. Then, they need to create a CloudWatch alarm that uses a math expression to calculate the error rate by dividing the error count metric by a total request count metric (or by using the same log group with another filter for total requests) and triggers when the rate exceeds 5% over 5 minutes (Option E).

Option A is not required because the log group already exists. Option C is incorrect because a subscription filter would forward logs to Lambda, but the requirement is to use metric filters and alarms. Option D is incorrect because the metric is automatically created by the metric filter; you do not need to manually create a separate metric.

1444
MCQmedium

A company uses AWS CloudFormation to manage its infrastructure. The DevOps team wants to ensure that critical resources, such as an RDS database, are not accidentally deleted when a stack is updated or deleted. Which CloudFormation feature should be used to prevent this?

A.DeletionPolicy attribute with Retain
B.Stack policy
C.Termination protection
D.DependsOn attribute
AnswerA

DeletionPolicy: Retain on a resource instructs AWS CloudFormation to preserve that physical resource when the stack is deleted. Without it, DeleteStack removes every resource in the template; with Retain, the resource is simply left in place and becomes orphaned, allowing you to keep critical data such as databases or S3 buckets. This is the standard way to prevent accidental data loss during stack deletion.

Why this answer

The DeletionPolicy attribute with the Retain value is the correct choice because it explicitly instructs CloudFormation to preserve the physical resource (e.g., an RDS database) when its corresponding logical resource is deleted from the stack template during an update or when the entire stack is deleted. This prevents accidental deletion of critical stateful resources by ensuring the resource remains in the AWS account even after the stack operation completes.

Exam trap

The trap here is that candidates confuse termination protection (an EC2-specific feature) with CloudFormation's DeletionPolicy, or mistakenly think a stack policy can prevent deletion during a full stack deletion, when it only restricts update operations.

How to eliminate wrong answers

Option B is wrong because a stack policy is an IAM-like resource-level policy that controls which stack resources can be updated or deleted during a stack update, but it does not prevent deletion when the entire stack is deleted; it only restricts update/delete actions during an update operation. Option C is wrong because termination protection is an EC2 instance-level feature that prevents accidental termination of an EC2 instance, not a CloudFormation feature and not applicable to RDS databases. Option D is wrong because the DependsOn attribute only specifies resource creation order within a stack template; it has no effect on preventing deletion of resources during stack updates or deletions.

1445
Multi-Selectmedium

A company needs to ensure that an EC2 instance can only be launched using a specific Amazon Machine Image (AMI) that has been approved by the security team. Which TWO actions should be taken?

Select 2 answers
A.Tag the approved AMI and use resource-based policies to allow only tagged AMIs.
B.Create an IAM policy that denies ec2:RunInstances unless the AMI ID matches the approved AMI.
C.Use an AWS Organizations service control policy (SCP) to restrict AMI usage across accounts.
D.Create an AWS Config rule to check that EC2 instances are launched from the approved AMI.
E.Enable CloudTrail to log all EC2 RunInstances calls and alert on unapproved AMIs.
AnswersB, C

An identity-based IAM policy can deny ec2:RunInstances unless the request's ec2:ImageId condition key matches the approved AMI ID. Because IAM policies are evaluated synchronously before the launch proceeds, this is a true preventive control that blocks the API call, not just an after-the-fact check. It can be attached to all relevant principals and combined with a Deny for a null ImageId to ensure every launch specifies an approved AMI.

Why this answer

An IAM policy with a condition for ec2:ImageId can restrict which AMIs can be used. Option C is correct because an SCP in AWS Organizations can enforce this across accounts. Option A is wrong because tagging does not enforce AMI usage.

Option D is wrong because AWS Config rules only detect non-compliance, not prevent. Option E is wrong because CloudTrail is for logging.

1446
MCQeasy

A DevOps engineer is reviewing a CloudFormation template for an S3 bucket that stores application logs. The bucket has versioning enabled and a lifecycle rule to expire noncurrent versions after 30 days. The bucket policy allows public read access to all objects. The company's security policy requires that all S3 buckets block public access. Which change should the engineer make to comply?

A.Change the bucket name to include 'private'.
B.Enable default encryption on the bucket.
C.Remove the bucket policy statement that grants public access.
D.Remove the lifecycle rule that expires noncurrent versions.
AnswerC

The bucket policy allows s3:GetObject from anyone (*). Removing it blocks public read access.

Why this answer

The bucket policy currently allows public read access, which violates the security policy requiring all S3 buckets to block public access. To comply, the engineer must remove the bucket policy statement that grants public access or enable the 'Block all public access' setting on the bucket. Option A (changing the bucket name) does not affect public access.

Option B (enabling default encryption) enhances security but does not block public access. Option D (removing the lifecycle rule) is unrelated to public access.

1447
MCQhard

A company's security team suspects that an attacker has compromised an IAM user's access keys. The keys were used to launch instances in an unauthorized region. What is the FASTEST way to mitigate the threat?

A.Delete the IAM user.
B.Change the IAM user's password.
C.Rotate the access keys immediately.
D.Attach an AWS WAF to block the attacker's IP address.
AnswerC

Rotating the access keys means generating a new access key pair for the IAM user, updating dependent applications with the new credentials, and then deactivating and deleting the compromised keys. This immediately denies requests signed with the stolen keys because IAM checks key validity for every call, making it the fastest, least-disruptive way to stop the attacker.

Why this answer

Rotating the access keys immediately invalidates the compromised keys, preventing further unauthorized use without disrupting the IAM user's other permissions or requiring a full user recreation. This is the fastest mitigation because it directly revokes the attacker's access while allowing the legitimate user to continue using new keys after rotation.

Exam trap

The trap here is that candidates confuse password changes (console access) with access key rotation (programmatic access), or they overcorrect by deleting the entire user instead of simply rotating the compromised keys.

How to eliminate wrong answers

Option A is wrong because deleting the IAM user is an overly drastic measure that removes all permissions and associated resources, causing unnecessary downtime and operational overhead; it is not the fastest way to stop key-based access. Option B is wrong because changing the IAM user's password only affects console login credentials, not access keys, so it does nothing to mitigate the threat from compromised programmatic keys. Option D is wrong because AWS WAF is a web application firewall that operates at the application layer (HTTP/HTTPS) and cannot block IAM access key usage, which occurs at the AWS API level via Signature Version 4 signing.

1448
MCQeasy

A company runs a critical application on Amazon EC2 instances behind an Application Load Balancer. During a security incident, the security team needs to isolate a compromised instance for forensic analysis without affecting the application's availability. What is the MOST effective action to take?

A.Deregister the instance from the target group and stop the instance for forensic analysis.
B.Modify the security group of the instance to deny all inbound and outbound traffic.
C.Terminate the compromised instance immediately to prevent further damage.
D.Change the subnet route table to route traffic away from the compromised instance.
AnswerA

Deregistering the instance from the Target Group stops new traffic from the Application Load Balancer while leaving the instance running, which preserves volatile memory for forensic collection. Stopping the instance (not terminating it) retains the EBS volumes, allowing investigators to create snapshots or attach them to a forensic workstation for offline analysis. This approach keeps the remaining fleet operational and maintains availability while containing the compromise.

Why this answer

Deregistering the instance from the target group removes it from the Application Load Balancer's routing, ensuring no new traffic is sent to it while existing connections drain (connection draining). Stopping the instance preserves its memory and disk state for forensic analysis without impacting application availability, as the remaining healthy instances continue to serve traffic.

Exam trap

The trap here is that candidates confuse network-level isolation (security groups or route tables) with application-level isolation (target group deregistration), failing to recognize that the ALB continues to route traffic to a registered instance regardless of its security group or subnet routing.

How to eliminate wrong answers

Option B is wrong because modifying the security group to deny all traffic only blocks network-level access; the instance remains registered in the target group, and the ALB may still attempt to route traffic to it, potentially causing connection timeouts or errors. Option C is wrong because terminating the instance immediately destroys volatile data (e.g., memory contents, running processes) needed for forensic analysis and could cause a sudden loss of capacity if the instance was handling active requests. Option D is wrong because changing the subnet route table affects all instances in that subnet, not just the compromised one, and does not prevent the ALB from sending traffic to the instance via its private IP; route tables control layer-3 routing, not load balancer target group membership.

1449
Multi-Selectmedium

Which TWO approaches can be used to manage configuration files (e.g., application.properties) across multiple AWS accounts and regions using AWS Systems Manager? (Select TWO.)

Select 2 answers
A.Use AWS AppConfig to create, manage, and deploy application configurations across accounts and regions.
B.Use AWS OpsWorks for Chef Automate to store configuration data in Chef data bags.
C.Store configuration files in AWS Secrets Manager and retrieve them using the Secrets Manager API.
D.Store configuration parameters in AWS Systems Manager Parameter Store and reference them from applications using the AWS SDK.
E.Use AWS Systems Manager Run Command to push configuration files to EC2 instances on demand.
AnswersA, D

AWS AppConfig is the correct choice because it is purpose-built for managing application configuration independently of code deployments. It supports creating and maintaining configurations in a central store, validating them with format or semantic checks, and rolling them out gradually across accounts and regions using deployment strategies. Unlike the other options, AppConfig also provides built-in monitoring, automatic rollback, and the ability to retrieve configuration at runtime, making it an enterprise-grade configuration management service.

Why this answer

AWS AppConfig is a feature of AWS Systems Manager that allows you to create, manage, and deploy application configurations across accounts and regions. It supports staged rollouts, validation, and monitoring, making it suitable for managing configuration files like application.properties in multi-account, multi-region environments.

Exam trap

The trap here is that candidates often confuse AWS Secrets Manager with Parameter Store for configuration management, or assume Run Command is suitable for configuration deployment, when in fact AppConfig and Parameter Store are the correct Systems Manager services for managing and deploying configuration files across multiple accounts and regions.

1450
MCQeasy

A company uses AWS Elastic Beanstalk to deploy a web application. The operations team wants to ensure that the environment's configuration (e.g., instance type, scaling limits) is version-controlled and reproducible. Which practice should they adopt?

A.Manually recreate the environment from the Elastic Beanstalk console when needed.
B.Use the Elastic Beanstalk saved configuration feature to download a configuration file and store it in version control.
C.Use AWS CloudFormation to define the environment and store the template in a Git repository.
D.Document the configuration in a wiki and apply it manually through the AWS Management Console.
AnswerB

The Elastic Beanstalk saved configuration feature exports the current environment's settings into a YAML file via `eb config save`, which can be downloaded and committed to version control. This file captures the complete environment configuration—platform, instance type, environment variables, scaling limits, health-check settings, and other option settings—without including transient data like application versions. Storing this file in Git enables you to recreate the same environment later with `eb config put`, apply it across regions or accounts, and revert to older configurations through normal version-control history.

Why this answer

Elastic Beanstalk's saved configuration feature allows you to download the environment's configuration as a YAML or JSON file, which can be stored in version control and used to recreate identical environments. This directly addresses the need for version-controlled, reproducible environment configuration without requiring additional infrastructure-as-code tools.

Exam trap

The trap here is that candidates may overthink and choose CloudFormation (Option C) because it is a powerful IaC tool, but the question specifically asks for a practice within Elastic Beanstalk's own features to version-control its configuration, not to replace the deployment service entirely.

How to eliminate wrong answers

Option A is wrong because manually recreating an environment from the console is error-prone, not version-controlled, and violates the principle of reproducibility. Option C is wrong because while AWS CloudFormation can define Elastic Beanstalk environments, the question specifically asks for a practice within Elastic Beanstalk's native capabilities; using CloudFormation adds unnecessary complexity and is not the recommended practice for version-controlling Elastic Beanstalk environment configuration. Option D is wrong because documenting configuration in a wiki and applying it manually is not version-controlled, is prone to human error, and does not enable automated or reproducible deployments.

1451
Drag & Dropmedium

Drag and drop the steps to perform a disaster recovery failover from a primary region to a secondary region using AWS Route 53 and RDS.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

First configure health checks, then lower TTL, then promote RDS, then update DNS, then verify.

1452
Multi-Selectmedium

A DevOps engineer is designing a centralized logging solution for a multi-account AWS environment. The solution must be cost-effective and provide real-time log analysis. Which THREE services should they consider?

Select 3 answers
A.Amazon OpenSearch Service (Elasticsearch)
B.Amazon Kinesis Data Firehose
C.Amazon S3
D.Amazon CloudWatch Logs
E.AWS CloudTrail
AnswersA, B, D

Amazon OpenSearch Service provides the interactive search and visualization layer for a centralized logging solution. Logs ingested from Firehose, CloudWatch Logs subscriptions, or Logstash are indexed and available for real-time queries, aggregations, and Kibana dashboards, making it the correct target for log analytics. Unlike object storage or API audit trails, OpenSearch supports full-text search, ad hoc filtering, and anomaly detection across massive log volumes.

Why this answer

Amazon OpenSearch Service (option A) provides real-time log analysis and visualization, making it a core component for centralized logging. Amazon Kinesis Data Firehose (option B) enables near-real-time streaming of log data to destinations like OpenSearch or S3, facilitating cost-effective ingestion. Amazon CloudWatch Logs (option D) can centralize logs from multiple AWS services and accounts, with subscription filters to stream to Kinesis Firehose or OpenSearch.

Option C (Amazon S3) is a storage service, not suitable for real-time analysis itself, though it can serve as a destination. Option E (AWS CloudTrail) records API activity but is not a centralized logging service for all logs.

1453
MCQeasy

A DevOps engineer must ensure that all API calls in an AWS account are logged for compliance. The logs should be stored in an S3 bucket with server-side encryption enabled. Which two services should be used together to meet these requirements?

A.AWS CloudTrail and Amazon CloudWatch Logs
B.AWS CloudTrail and Amazon S3
C.Amazon VPC Flow Logs and Amazon S3
D.AWS Config and AWS CloudTrail
AnswerB

CloudTrail logs API calls and delivers to S3, which supports server-side encryption.

Why this answer

AWS CloudTrail logs all API calls in the account and can deliver these logs to an S3 bucket, where server-side encryption (SSE) can be enabled for compliance. Option A (AWS CloudTrail and Amazon CloudWatch Logs) can capture API calls, but the requirement is to store logs in an S3 bucket with encryption, not CloudWatch Logs. Option C (Amazon VPC Flow Logs and Amazon S3) captures network traffic, not API calls.

Option D (AWS Config and AWS CloudTrail) includes AWS Config, which tracks resource configuration changes, not API calls; CloudTrail alone suffices for API logging, but Config is not needed for this requirement.

1454
MCQhard

A company has a VPC with public and private subnets. They launch an EC2 instance in a private subnet that needs to download patches from the internet. Which solution is MOST secure and scalable?

A.Create a NAT Gateway in a public subnet and update the private route table.
B.Launch a proxy server in a public subnet and route traffic through it.
C.Assign an Elastic IP to the instance in the private subnet.
D.Use a VPC endpoint to the Amazon Linux repository.
AnswerA

A NAT Gateway is a fully managed service deployed in a public subnet with an Elastic IP. To grant a private subnet outbound internet access, you must add a route 0.0.0.0/0 to the private route table pointing to the NAT Gateway. This performs source NAT, translating private instance traffic to the gateway's Elastic IP, while dropping unsolicited inbound traffic. It is highly available and scales automatically, making it the recommended solution for outbound connectivity without exposing the instances.

Why this answer

A NAT Gateway in a public subnet allows instances in private subnets to initiate outbound traffic to the internet and receive responses, without allowing inbound traffic. This is the most secure and scalable solution because it is managed by AWS and scales automatically. Option B (a proxy server) is less scalable and requires ongoing management.

Option C (assigning an Elastic IP to the private instance) would expose the instance to inbound internet traffic, violating the security of the private subnet. Option D (using a VPC endpoint) is only for accessing AWS services, not general internet patch repositories.

1455
MCQhard

A financial services company runs a critical application on Amazon ECS with Fargate launch type. The application consists of three microservices: Service A (frontend), Service B (processing), and Service C (database access). Services communicate via REST APIs. The application stores data in Amazon Aurora PostgreSQL Serverless v2. The company has a disaster recovery (DR) requirement: RTO of 30 minutes and RPO of 15 minutes. The primary region is us-east-1 and the DR region is us-west-2. The DevOps team has configured cross-region replication for the Aurora database using an Aurora Global Database. The ECS services are deployed with a service-linked role for Fargate. The team wants to automate the failover process to meet the RTO. Which solution should the team implement?

A.Use AWS CloudFormation StackSets to deploy the ECS services and supporting resources in the DR region. Configure an Aurora Global Database for cross-region replication. Use Amazon Route 53 with health checks and failover routing to automatically redirect traffic to the DR region when the primary region health check fails.
B.Take daily snapshots of the Aurora database and copy them to the DR region. In the event of a disaster, restore the snapshot and use AWS CloudFormation to launch the ECS services.
C.Use AWS Backup to schedule cross-region backups of the Aurora database every 15 minutes. In the event of a disaster, restore the latest backup and use Elastic Beanstalk to deploy the application in the DR region.
D.Configure AWS Global Accelerator with an endpoint group in each region. Use AWS Lambda to periodically check the health of the primary region and update the DNS records manually to point to the DR region.
AnswerA

This option is correct because CloudFormation StackSets pre-provisions all infrastructure—ECS services, load balancers, security groups, and supporting resources—in both regions, ensuring the DR environment is ready to serve traffic. Aurora Global Database provides managed, low-latency cross-region replication, typically under one second, so the DR database is already live with minimal data loss (RPO). Route 53 health checks monitor the primary region and automatically shift DNS to the DR region using failover routing, enabling automated failover without manual runbooks. Together, these services achieve a very low RTO and RPO, satisfying the 30-minute requirement.

Why this answer

Using CloudFormation StackSets to deploy the infrastructure in both regions and using Route 53 with health checks and failover routing allows automated failover with DNS propagation. The Aurora Global Database provides managed cross-region replication with low RPO. Option B (snapshot restore) is too slow and cannot meet the 15-minute RPO.

Option C (AWS Backup with 15-minute backups and Elastic Beanstalk) also cannot meet the RTO and RPO because restoring from backups takes time and Elastic Beanstalk is not the best fit for this architecture. Option D (AWS Global Accelerator and Lambda for manual DNS update) does not provide automated failover and manual intervention would not meet the 30-minute RTO.

1456
MCQmedium

A company uses AWS Organizations with multiple accounts. The security team wants to ensure that all IAM roles in member accounts have a maximum session duration of 1 hour. They need a way to detect any roles that violate this policy. What should they do?

A.Use IAM Access Analyzer to validate the roles against a policy template.
B.Use AWS Config with the managed rule iam-role-max-session-duration to evaluate roles.
C.Run AWS Trusted Advisor and check the IAM report for roles with long session durations.
D.Enable AWS CloudTrail and create a metric filter to detect role creation with session duration greater than 1 hour.
AnswerB

The AWS Config managed rule iam-role-max-session-duration evaluates every IAM role in the account, comparing each role's MaxSessionDuration setting against the rule's maxSessionDuration parameter. This rule is triggered proactively on configuration changes and periodically, so it detects both existing and newly modified roles, flagging any role whose allowed session duration exceeds the defined threshold as noncompliant. It integrates with AWS Organizations and can be remediated automatically or through Config conformance packs.

Why this answer

AWS Config provides a managed rule called `iam-role-max-session-duration` that specifically evaluates IAM roles to ensure their `MaxSessionDuration` setting does not exceed a specified threshold (default 1 hour). This rule can be deployed across all member accounts in AWS Organizations using a conformance pack or AWS Config aggregator, allowing the security team to continuously detect and report any roles that violate the policy without manual intervention.

Exam trap

The trap here is that candidates often confuse AWS Config's ability to evaluate resource configurations (like IAM role session duration) with CloudTrail's event logging or IAM Access Analyzer's policy analysis, leading them to choose options that detect creation events rather than continuously assess the current state of all roles.

How to eliminate wrong answers

Option A is wrong because IAM Access Analyzer is designed to analyze resource-based policies (like S3 bucket policies or KMS key policies) for unintended public or cross-account access, not to validate IAM role session duration settings against a policy template. Option C is wrong because AWS Trusted Advisor checks for IAM use (e.g., unused IAM users, MFA on root) but does not include a specific check for IAM role maximum session duration. Option D is wrong because while CloudTrail can log `CreateRole` and `UpdateAssumeRolePolicy` events, a metric filter cannot directly evaluate the `MaxSessionDuration` parameter from the event; it would require complex custom parsing and still not provide ongoing compliance evaluation like AWS Config.

1457
MCQhard

A company runs a fleet of EC2 instances behind an Auto Scaling group. The DevOps team wants to detect and respond to memory leaks in their application. They have configured CloudWatch agent to collect memory metrics. However, the metric shows unpredictable spikes. The team needs to correlate these spikes with application logs to identify the root cause. Which solution provides the BEST correlation?

A.Export the memory metric and application logs to Amazon S3 and use Amazon Athena to join them
B.Enable AWS X-Ray on the application to trace requests and identify memory-heavy requests
C.Use CloudWatch Logs Insights to query application logs for error patterns around the time of memory spikes
D.Use Amazon EventBridge to capture EC2 instance state changes and correlate with memory spikes
AnswerC

CloudWatch Logs Insights provides a queryable index of live application logs, so you can run interactive queries that filter for ERROR, FATAL, or exception patterns within the exact time window of a memory spike. Using the parse command on structured logs and grouping by timestamp or host, you can quickly identify a correlated error or log burst, making it the appropriate tool for real-time operational correlation between CloudWatch metrics and log data.

Why this answer

CloudWatch Logs Insights allows you to query application logs directly in CloudWatch Logs using a purpose-built query language. By filtering logs around the timestamps of memory spikes, you can correlate specific error patterns or log entries with the metric data, enabling root cause analysis without moving data or adding complexity.

Exam trap

The trap here is that candidates often confuse AWS X-Ray's request tracing with OS-level metric correlation, or assume that exporting to S3 and using Athena is a universal solution, when in fact CloudWatch Logs Insights provides the most direct and efficient correlation within the same monitoring ecosystem.

How to eliminate wrong answers

Option A is wrong because exporting metrics and logs to S3 and using Athena to join them introduces unnecessary latency, cost, and complexity; Athena is designed for ad-hoc analysis of structured data, not real-time correlation of streaming metrics and logs. Option B is wrong because AWS X-Ray traces requests and identifies latency or errors, but it does not capture memory metrics or correlate them with memory leaks; it focuses on distributed tracing, not OS-level resource usage. Option D is wrong because EventBridge captures EC2 instance state changes (e.g., start, stop, terminate), which are unrelated to memory spikes caused by application-level memory leaks; state changes do not provide the granular log correlation needed.

1458
MCQeasy

A company is designing a resilient architecture for a web application using AWS Global Accelerator and two Application Load Balancers in different AWS Regions. The application is stateless and uses a global DynamoDB table for data. What is the primary benefit of using Global Accelerator in this architecture?

A.It replaces the need for an Application Load Balancer.
B.It provides static IP addresses and automatically routes traffic to the closest healthy ALB, improving availability and performance.
C.It provides DNS-based failover between Regions.
D.It caches static content at AWS edge locations.
AnswerB

Global Accelerator uses two static Anycast IP addresses at AWS edge locations, which are announced from multiple points of presence. It monitors the health of your ALB or NLB endpoints and automatically routes each user's traffic to the closest endpoint that is healthy, using the AWS backbone instead of the public internet. This improves availability by failing over to a healthy endpoint within seconds and improves performance by reducing latency and jitter, but it still depends on the ALB to handle the actual HTTP/HTTPS load balancing.

Why this answer

Global Accelerator provides static IP addresses and directs traffic to the nearest healthy endpoint, improving resilience and performance. Option A is wrong because Global Accelerator does not cache content. Option C is wrong because DNS routing is not the primary benefit; Global Accelerator uses anycast.

Option D is wrong because Global Accelerator does not replace ALB; it works with ALBs.

1459
MCQeasy

A developer needs to allow an EC2 instance to read from an S3 bucket. Which is the most secure way to grant this access?

A.Use the root user credentials of the AWS account.
B.Store AWS access keys in the instance's user data and use them in the application.
C.Create an S3 bucket policy that allows the EC2 instance's public IP address.
D.Create an IAM role with an S3 read policy and attach it to the EC2 instance profile.
AnswerD

Create an IAM role with a policy such as s3:GetObject and s3:ListBucket, then attach it to the EC2 instance profile. The instance will automatically obtain temporary security credentials from AWS STS through the instance metadata service, which are rotated every few hours and never stored on disk. This follows least privilege, avoids long-lived keys, and is the AWS best practice for granting permissions to a running instance.

Why this answer

The most secure way to grant an EC2 instance access to an S3 bucket is to use an IAM role with an S3 read policy attached to the instance profile. This allows the instance to obtain temporary security credentials via the instance metadata service, avoiding hardcoded keys or exposing credentials. Option A is wrong because root credentials are overly privileged and should never be used for routine access.

Option B is wrong because storing access keys in user data is insecure—keys can be exposed through instance metadata or logs. Option C is wrong because bucket policies based on public IP addresses are not secure; IPs can change and other instances could have the same IP, plus S3 bucket policies should not rely on IP addresses for authentication. Option D is the correct approach because it uses IAM roles, the best practice for granting permissions to AWS services.

1460
MCQhard

A DevOps team is implementing a blue/green deployment strategy for a microservice running on Amazon ECS with AWS CodeDeploy. They want to shift 10% of traffic to the new task set for 5 minutes, then shift the remaining 90%. Which deployment configuration should they use?

A.CodeDeployDefault.ECSAllAtOnce
B.CodeDeployDefault.ECSLinear10PercentEvery1Minutes
C.CodeDeployDefault.ECSCanary10Percent5Minutes
D.Custom configuration with 10% initial traffic and 100% after 5-minute interval
AnswerC

The built-in deployment configuration CodeDeployDefault.ECSCanary10Percent5Minutes instructs CodeDeploy to initially route 10% of the load balancer's traffic to the new ECS task set (the green environment) while the remaining 90% continues to go to the blue task set. After a 5-minute waiting period, during which health checks and metrics can be evaluated, CodeDeploy automatically shifts the remaining 90% of traffic to green, completing the deployment. This two-step canary pattern exactly satisfies the requirement for a 10% initial shift with a 5-minute soak before the final 90% cutover.

Why this answer

The built-in configuration `CodeDeployDefault.ECSCanary10Percent5Minutes` shifts 10% of traffic to the new task set, holds for 5 minutes, then shifts the remaining 90%. This matches the requirement exactly. A custom configuration (D) is unnecessary and not a standard deployment configuration.

Exam trap

Candidates often confuse the canary and linear configurations. `CodeDeployDefault.ECSCanary10Percent5Minutes` shifts 10% instantly and then holds for 5 minutes before shifting the rest. The linear configuration, `CodeDeployDefault.ECSLinear10PercentEvery1Minutes`, shifts 10% every minute over 10 minutes without a hold.

How to eliminate wrong answers

Option A is wrong because CodeDeployDefault.ECSAllAtOnce shifts 100% of traffic to the new task set immediately, which does not match the 10% then 90% gradual shift requirement. Option B is wrong because CodeDeployDefault.ECSLinear10PercentEvery1Minutes shifts 10% of traffic every 1 minute until 100%, resulting in a linear progression over 10 minutes, not a 5-minute wait at 10% followed by a single 90% shift. Option C is wrong because CodeDeployDefault.ECSCanary10Percent5Minutes shifts 10% for 5 minutes and then automatically shifts the remaining 90% immediately after the 5-minute interval, which does not allow the 5-minute hold at 10% before the final shift as specified; it completes the deployment in one canary step.

1461
Multi-Selectmedium

A company wants to implement a configuration management strategy for their EC2 instances that are part of an Auto Scaling group. They need to ensure that new instances are automatically configured with the latest software packages and settings without manual intervention. Which TWO approaches meet these requirements? (Choose TWO.)

Select 2 answers
A.Use AWS OpsWorks to manage configurations and associate with the Auto Scaling group.
B.Use AWS CodeDeploy with an Auto Scaling lifecycle hook to deploy applications to new instances.
C.Use EC2 user data scripts to install software at launch.
D.Use AWS Config rules to enforce configuration settings.
E.Use AWS Systems Manager Run Command on a schedule to apply configurations.
AnswersB, C

Lifecycle hooks can trigger CodeDeploy deployments on launch.

Why this answer

Options B and C are correct. Option B uses AWS CodeDeploy with an Auto Scaling lifecycle hook to automatically deploy applications to new instances as they launch. Option C uses EC2 user data scripts to install software and apply configurations during instance launch.

Option A is incorrect because AWS OpsWorks is a configuration management service, but it does not automatically integrate with Auto Scaling groups without additional configuration; it is not the simplest automated approach. Option D is incorrect because AWS Config is used for compliance and auditing, not for proactively configuring instances. Option E is incorrect because AWS Systems Manager Run Command requires manual or scheduled execution and does not automatically run on instance launch.

1462
Multi-Selecthard

A DevOps engineer is building a CI/CD pipeline for a PHP application that uses Amazon RDS for MySQL. The pipeline must run database migrations as part of the deployment. The team wants to ensure that if a migration fails, the deployment is rolled back and the database is restored to its previous state. Which THREE steps should the engineer implement?

Select 3 answers
A.Take a snapshot of the RDS database before the migration.
B.Use CloudFormation with a custom resource to run the migration.
C.Use CodeDeploy's AppSpec file to run a migration script in the AfterInstall lifecycle hook.
D.Use AWS Database Migration Service (DMS) to replicate the database continuously.
E.Configure the CodeDeploy deployment group to automatically roll back on failure.
AnswersA, C, E

A manual RDS snapshot taken immediately before the migration is the only mechanism that provides a point-in-time, database-level restore point independent of the application deployment. If the migration script corrupts data or fails mid-transaction, you can restore the instance from this snapshot and redeploy the previous code version, ensuring a clean rollback. This is the standard pre-migration practice because other options either target application code only or do not give you a deterministic restore point for the database itself.

Why this answer

Taking a manual snapshot of the RDS database before the migration provides a reliable restore point. If the migration fails, you can restore the database from this snapshot to its previous state, ensuring data integrity and enabling a clean rollback.

Exam trap

The trap here is that candidates might think AWS DMS is suitable for rollback scenarios, but DMS is for ongoing replication, not for capturing a pre-migration state; the correct approach is to use RDS snapshots combined with CodeDeploy's automatic rollback feature.

1463
Multi-Selecthard

Which THREE actions should be taken to ensure that an AWS CloudFormation stack update does not cause downtime for a production application that runs on an Auto Scaling group behind an Application Load Balancer? (Select THREE.)

Select 3 answers
A.Configure an 'UpdateWaitCondition' in the CloudFormation template to pause the stack update until a healthy signal is received from the new instances.
B.Add a custom resource that triggers an AWS Lambda function to take a snapshot of the database before the update.
C.Ensure that the Auto Scaling group spans at least three Availability Zones to distribute instances.
D.Set the Auto Scaling group's UpdatePolicy to 'AutoScalingRollingUpdate' with a 'BatchSize' of 1 and 'MinInstancesInService' equal to the desired capacity.
E.Define a lifecycle hook for the Auto Scaling group that delays instance termination until the new instance is fully registered and healthy with the load balancer.
AnswersA, D, E

An UpdateWaitCondition (typically implemented as a WaitCondition resource or UpdatePolicy with WaitOnSignals) makes CloudFormation pause the stack update until each new instance sends a success signal, usually via cfn-signal after it has passed health checks and is ready to serve traffic. This ensures that CloudFormation does not complete the update and potentially remove old resources until the new capacity is confirmed operational, directly preventing application downtime during the replacement process.

Why this answer

An 'UpdateWaitCondition' in a CloudFormation template can pause the stack update until a healthy signal is received from the new instances. This ensures that the update proceeds only after the new instances have passed health checks, preventing premature traffic routing and potential downtime.

Exam trap

The trap here is that candidates may confuse general high-availability practices (like multi-AZ distribution) with specific update-time actions that prevent downtime, or they may think database snapshots are relevant to instance-level availability during a stack update.

1464
MCQmedium

A company uses AWS CloudFormation to manage infrastructure as code. They have a stack that creates an Amazon RDS database instance. The database password is stored as a parameter in AWS Systems Manager Parameter Store. The CloudFormation template references the parameter using the 'resolve:ssm' dynamic reference. Recently, a security audit found that the password was exposed in plaintext in the CloudFormation stack outputs. The team wants to prevent sensitive information from being displayed in stack outputs or logs. Which approach should be taken?

A.Set the 'NoEcho' property to 'true' for the parameter in the template
B.Store the password in AWS Secrets Manager and reference it in the template
C.Remove the output from the CloudFormation stack
D.Encrypt the output value using AWS KMS
AnswerC

Removing the output from the CloudFormation stack is the only direct way to prevent the password from being exposed in the stack's output section. Outputs are stored in plaintext by CloudFormation and are retrievable via the console, APIs such as DescribeStacks, and any logging that captures API responses. By eliminating the output, you ensure that the password does not appear in that specific exposure path; additional best practices like using Secrets Manager for retrieval by applications should still be implemented to protect the secret throughout its lifecycle.

Why this answer

Removing the output from the CloudFormation stack is the most direct way to prevent the password from being displayed in outputs or logs. Dynamic references like 'resolve:ssm' resolve the value at stack creation/update time, and if that value is included in an output, it will be displayed in plaintext. Setting 'NoEcho' on a template parameter does not affect the resolved value; it only masks the parameter's value in the console when entering it, not the output of a dynamic reference.

Option B (Secrets Manager) is a better practice for storing secrets but does not prevent exposure if the secret is still referenced in an output. Option D (KMS encryption of outputs) is not supported.

1465
Multi-Selecthard

A security audit reveals that an S3 bucket contains objects that are publicly accessible. The DevOps engineer must prevent any future public access to the bucket and all objects within it. Which THREE actions should the engineer take? (Choose THREE.)

Select 3 answers
A.Enable Block Public Access settings on the bucket.
B.Disable object ACLs on the bucket.
C.Remove any bucket policy that grants public read access.
D.Apply an SCP that denies s3:PutBucketPolicy that would make objects public.
E.Enable S3 server access logging.
AnswersA, C, D

Enabling Block Public Access (BPA) on the bucket is the correct immediate remediation because it applies four distinct settings—BlockPublicAcls, IgnorePublicAcls, BlockPublicPolicy, and RestrictPublicBuckets—that override all existing and future public access grants, including those from object ACLs, bucket policies, and access point policies. This is the most direct and comprehensive way to seal the bucket at the resource level until a full audit can be completed, and it prevents accidental re-publication through any subsequent misconfiguration.

Why this answer

Enabling block public access settings on the bucket prevents any future public access, including through ACLs or bucket policies. Option C is correct because removing any bucket policy that grants public read access eliminates one potential vector for public access. Option D is correct because applying an SCP that denies s3:PutBucketPolicy actions that would make objects public ensures that no account in the organization can create a policy that grants public access.

Option B is incorrect because disabling object ACLs only removes one method of granting public access; bucket policies can still allow public access. Option E is incorrect because enabling server access logging helps with auditing but does not prevent public access.

1466
MCQhard

A company needs to audit all changes to security groups in a multi-account environment. The logs must be centrally stored and immutable. Which solution meets these requirements with minimal operational overhead?

A.Enable VPC Flow Logs in each VPC and aggregate them in Amazon CloudWatch Logs
B.Enable AWS CloudTrail in all accounts, deliver logs to a central S3 bucket with S3 Object Lock enabled
C.Enable Amazon GuardDuty and send findings to a central S3 bucket
D.Enable AWS Config rules to detect security group changes and store results in a central S3 bucket
AnswerB

CloudTrail is the only service that records management-plane API events such as AuthorizeSecurityGroupIngress, RevokeSecurityGroupEgress, and CreateSecurityGroup, including the requesting IAM principal, source IP, and request parameters. Delivering those trail logs to a centralized S3 bucket with S3 Object Lock enabled in compliance mode makes each log object write-once-read-many (WORM), preventing any user—even one with administrative privileges—from altering or deleting audit evidence, which satisfies the immutability and centralized audit requirements. Additionally, enabling CloudTrail in all accounts with a single organization trail and delivering to a central bucket provides a complete, tamper-proof, cross-account audit record of every security group change.

Why this answer

AWS CloudTrail logs all API calls, including security group changes. Delivering CloudTrail logs from all accounts to a central S3 bucket with S3 Object Lock enabled ensures immutable storage. This meets the requirements with minimal operational overhead.

Option A (VPC Flow Logs) logs network traffic, not security group changes. Option C (Amazon GuardDuty) is for threat detection and does not log all API calls. Option D (AWS Config) records configuration changes but not API calls; it can be used to detect changes but requires additional setup and does not provide the same API-level audit trail.

1467
Matchingmedium

Match each AWS Config rule to its purpose.

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

Concepts
Matches

Checks that resources have specified tags

Ensures EBS volumes are encrypted

Prevents public read access on S3 buckets

Verifies CloudTrail is enabled

Checks for IAM policies granting full admin access

Why these pairings

The correct matches are: s3-bucket-public-read-prohibited with S3 public read check, restricted-ssh with SSH access check, iam-user-no-policies-check with no attached policies, and cloud-trail-cloud-watch-logs-enabled with CloudWatch integration. Common confusions include swapping definitions between different rule types.

1468
MCQeasy

A DevOps engineer receives a CloudWatch alarm that an Auto Scaling group has been in an 'Insufficient data' state for 20 minutes. What does this indicate?

A.All instances in the Auto Scaling group are unhealthy
B.The Auto Scaling group needs to scale up
C.The alarm has not received enough metric data to evaluate
D.The CloudWatch agent is not installed on the instances
AnswerC

CloudWatch alarms use the state INSUFFICIENT_DATA when the number of metric data points available in the evaluation period is less than the number required to determine the alarm state. This commonly occurs for a newly created alarm before the first metric points arrive, when an instance is stopped and stops publishing metrics, or when the metric name is missing. The alarm cannot evaluate to ALARM or OK until the metric stream provides enough valid points within the configured period.

Why this answer

The 'Insufficient data' state in CloudWatch alarms indicates that the alarm has not received enough metric data points to determine whether the threshold has been breached. This can occur when the metric is not being published, the data collection period is too short, or the metric namespace is misconfigured. It does not directly indicate instance health, scaling needs, or agent installation status.

Exam trap

The trap here is that candidates confuse 'Insufficient data' with a problem state (like unhealthy instances or scaling failures), when it actually means the alarm simply lacks enough data to make a determination.

How to eliminate wrong answers

Option A is wrong because 'Insufficient data' does not imply unhealthy instances; it means the alarm lacks metric data to evaluate, whereas unhealthy instances would trigger 'ALARM' state if health check metrics are configured. Option B is wrong because the alarm state does not indicate a scaling need; scaling decisions are based on threshold breaches, not insufficient data. Option D is wrong because the CloudWatch agent is not required for all metrics; many metrics (e.g., EC2 basic monitoring) are published automatically without an agent, and 'Insufficient data' can occur even with the agent installed if data is not flowing.

1469
MCQeasy

A DevOps engineer receives an alert that an Amazon EC2 instance’s CPU utilization has been above 90% for the past hour. The instance is part of an Auto Scaling group with a step scaling policy based on average CPU. The engineer checks the CloudWatch alarm and sees that it is in the ALARM state. What should the engineer do to verify that the Auto Scaling group is scaling out properly?

A.Ensure the scaling policy is configured to scale in
B.Check the CloudWatch Logs for the instance
C.Verify that the CloudWatch alarm is in INSUFFICIENT_DATA state
D.Review the Auto Scaling group’s activity history in the EC2 console
AnswerD

The Auto Scaling group’s activity history is the authoritative record of every scale-out and scale-in event, including the time, instance ID, reason code, and status (e.g., 'InProgress', 'Successful', or 'Failed'). By reviewing it, you can determine whether the CloudWatch alarm triggered the scaling policy, whether the capacity was blocked by the maximum instance limit, a service quota, or a launch template error. This directly shows why the instance did not receive the expected scale-out action, making it the correct first troubleshooting step.

Why this answer

Reviewing the Auto Scaling group's activity history in the EC2 console shows whether scaling actions were triggered and if new instances were launched. The CloudWatch alarm is in ALARM state (indicating high CPU), and the step scaling policy should scale out, so checking the activity history confirms the scaling action occurred. Option A is incorrect because the scaling policy is for scaling out on high CPU, not scaling in.

Option B is incorrect because CloudWatch Logs show instance-level logs, not Auto Scaling actions. Option C is incorrect because the alarm is in ALARM state, not INSUFFICIENT_DATA.

1470
Multi-Selecteasy

Which TWO actions can help protect an AWS account's root user? (Choose TWO.)

Select 2 answers
A.Do not create access keys for the root user; use IAM users instead
B.Delete the root user after creating administrative IAM users
C.Enable multi-factor authentication (MFA) on the root user
D.Rotate the root user password every 30 days
E.Change the root user's email address to a group email
AnswersA, C

Root access keys are long-lived and carry unrestricted permissions that cannot be scoped down by any IAM policy. If they are leaked, the entire account is compromised, and because AWS does not allow you to restrict root credentials, the keys remain an unmanageable risk. Instead, create IAM users with only the necessary permissions, and use temporary credentials from AWS STS (roles) for programmatic access, so each request is authenticated with least privilege and can be audited.

Why this answer

Not creating access keys for the root user is a best practice because root access keys have full permissions and cannot be restricted. Option C is correct: enabling MFA adds an extra layer of security. Option B is wrong: the root user cannot be deleted.

Option D is wrong: rotating the password alone does not protect against unauthorized access; MFA is more important. Option E is wrong: changing the email to a group email does not inherently protect the account and may cause issues with account recovery.

1471
MCQhard

A company uses AWS Lambda with Amazon DynamoDB to process orders. During peak hours, the Lambda function sometimes fails with throttling errors from DynamoDB. The system must be resilient and cost-effective. What should a DevOps engineer do?

A.Use Amazon SQS to buffer the requests and have Lambda pull from the queue with a reserved concurrency limit.
B.Increase the DynamoDB provisioned read and write capacity units to a high fixed value.
C.Provision DynamoDB Accelerator (DAX) to cache reads and reduce throttling.
D.Configure DynamoDB auto scaling and implement a dead-letter queue in Lambda to retry failed events.
AnswerD

DynamoDB auto scaling adjusts provisioned capacity based on actual usage, preventing most throttling, but it cannot anticipate sudden one-off spikes because it relies on trends. A Lambda dead-letter queue, combined with the function's built-in retries and exponential backoff, ensures that any event which still fails due to a throttle is safely captured for manual or automated replay rather than silently dropped. This two-tier approach balances elasticity with data durability, which is why it is the recommended solution for unpredictable write spikes.

Why this answer

Configuring DynamoDB auto scaling allows the table to adjust its provisioned capacity based on actual traffic patterns, preventing throttling during peak hours while remaining cost-effective during low usage. Implementing a dead-letter queue (DLQ) in Lambda ensures that failed events (e.g., due to transient throttling) are captured and can be retried or investigated, providing resilience without manual intervention.

Exam trap

The trap here is that candidates may confuse read caching solutions (DAX) or queue-based decoupling (SQS) with the direct need to scale write capacity and handle retries, overlooking the combination of auto scaling and DLQ as the most resilient and cost-effective approach for write-throttling scenarios.

How to eliminate wrong answers

Option A is wrong because using Amazon SQS to buffer requests and having Lambda pull from the queue with a reserved concurrency limit does not directly address DynamoDB throttling; it only controls Lambda concurrency, not the underlying DynamoDB capacity, and could still result in throttling if the database cannot handle the aggregate write volume. Option B is wrong because increasing DynamoDB provisioned read and write capacity units to a high fixed value is not cost-effective; it leads to over-provisioning during off-peak hours and does not adapt to variable traffic, contradicting the requirement for a cost-effective solution. Option C is wrong because DynamoDB Accelerator (DAX) is an in-memory cache for read operations only; it does not mitigate write throttling errors, which are the primary issue described in the scenario.

1472
MCQeasy

A DevOps engineer needs to grant an IAM user temporary access to an S3 bucket for exactly one hour. Which AWS service should be used to generate temporary credentials?

A.Amazon Cognito
B.AWS SSO
C.AWS STS
D.AWS IAM
AnswerC

AWS STS is the correct service for generating temporary credentials for an IAM user. APIs like GetSessionToken and AssumeRole return an access key ID, secret access key, and a session token that is valid for a specified duration (from 15 minutes up to 36 hours). The temporary credentials carry the same permissions as the IAM user's existing permissions (in the case of GetSessionToken) or the permissions defined in the assumed role's policy, making it ideal for short-lived access without rotating long-term keys.

Why this answer

AWS STS (Security Token Service) is used to generate temporary, limited-privilege credentials for IAM users or federated users. IAM roles provide temporary credentials but are assumed, not generated for a specific user. Cognito is for identity federation with mobile/web apps.

SSO provides single sign-on access.

1473
MCQeasy

A company is using Amazon RDS for MySQL and needs to encrypt the database at rest. Which action should be taken to enable encryption?

A.Create a read replica with encryption enabled
B.Use AWS Secrets Manager to encrypt the data
C.Enable encryption when creating the DB instance
D.Modify the existing DB instance and enable encryption
AnswerC

Amazon RDS supports encryption at rest only as an attribute that is set during the initial Create DB instance operation. When you provision the instance, you choose to enable encryption and optionally select a customer-managed KMS key; this setting is permanently attached to that instance. If you skip this option at launch, you cannot enable it later—you must migrate data to a newly created encrypted instance.

Why this answer

Encryption at rest for Amazon RDS MySQL can only be enabled during the creation of the DB instance. Once the instance is created, encryption cannot be added. Option A is incorrect because while you can create an encrypted read replica from an unencrypted source, that does not encrypt the original instance.

Option B is incorrect because AWS Secrets Manager is used for managing database credentials, not for encrypting data at rest. Option D is incorrect because modifying an existing DB instance does not support enabling encryption; the instance must be created with encryption enabled.

1474
MCQeasy

A DevOps engineer needs to ensure that an application running on EC2 can automatically recover from an underlying hardware failure without manual intervention. Which AWS feature should be enabled?

A.Enable termination protection
B.Configure EC2 Auto Recovery with a CloudWatch alarm
C.Configure an Auto Scaling group with a minimum size of 1
D.Enable CloudWatch detailed monitoring
AnswerB

EC2 Auto Recovery uses a CloudWatch alarm on the StatusCheckFailed_System metric to detect underlying host or network failures. When the alarm triggers, EC2 automatically relaunches the same instance on a new physical host while preserving the instance ID, private and Elastic IP addresses, and attached EBS volumes. This in-place recovery requires the instance to be EBS-backed and in a VPC, making it the correct choice for restoring availability after hardware failure.

Why this answer

EC2 Auto Recovery automatically recovers an instance when it becomes impaired due to underlying hardware failure, preserving its instance ID, private IP, and Elastic IP. Option A is incorrect because termination protection only prevents accidental deletion, not recovery. Option C is incorrect because an Auto Scaling group with a minimum size of 1 can replace a failed instance but launches a new instance rather than recovering the same one.

Option D is incorrect because CloudWatch detailed monitoring provides more frequent metrics but does not trigger recovery actions.

1475
MCQmedium

A DevOps engineer is troubleshooting a failed AWS CloudFormation stack creation. The stack creates an EC2 instance with a user data script that runs a configuration management tool. The instance launches successfully, but the user data script fails. How can the engineer retrieve the user data execution logs to debug the issue?

A.Use AWS CloudTrail to view the user data execution events.
B.Use AWS Systems Manager Run Command to retrieve the logs remotely.
C.Check the CloudWatch Logs group for the instance.
D.Access the instance via EC2 Instance Connect and check /var/log/cloud-init-output.log.
AnswerD

EC2 Instance Connect opens a temporary SSH session through the AWS Console, giving you direct interactive access to the running instance. Once connected, you can read /var/log/cloud-init-output.log, which captures the output of cloud-init including your user-data script, so any error or traceback from the script will be visible there. It is an effective diagnostic because it accesses the primary log source without requiring pre-installed agents or external log forwarding.

Why this answer

The user data script output is logged by cloud-init to /var/log/cloud-init-output.log on the EC2 instance. By using EC2 Instance Connect to access the instance, the engineer can directly read this log file to see the full execution output, including any error messages from the configuration management tool.

Exam trap

The trap here is that candidates assume CloudTrail or CloudWatch Logs automatically capture user data execution logs, but those services require explicit configuration and do not capture the script's output by default.

How to eliminate wrong answers

Option A is wrong because AWS CloudTrail records API calls (e.g., RunInstances) but does not capture the execution output of user data scripts inside the instance. Option B is wrong because AWS Systems Manager Run Command requires the SSM Agent to be installed and the instance to have an IAM role with appropriate permissions; it is not a default method for retrieving user data logs, and the user data script may fail before SSM Agent is fully operational. Option C is wrong because user data script logs are not automatically sent to CloudWatch Logs unless the instance is explicitly configured with the CloudWatch Logs agent and the user data script writes to the agent.

1476
MCQhard

A company uses AWS Organizations with multiple accounts. The security team needs a centralized solution to detect and respond to EC2 instances that are publicly accessible with SSH open to 0.0.0.0/0. Which combination of services provides the most automated detection and remediation?

A.AWS CloudTrail and Amazon EventBridge
B.Amazon GuardDuty and AWS Lambda
C.AWS Config and Amazon Simple Notification Service (SNS)
D.AWS Config and AWS Systems Manager Automation
AnswerD

This pair provides end-to-end compliance: AWS Config continuously evaluates security group resources against rules like restricted-common-ports, and when an SG is non-compliant, Config's remediation action triggers an AWS Systems Manager Automation runbook (e.g., AWS-DisablePublicSecurityGroupIngress or a custom runbook). The Automation step performs the actual modification, such as revoking offending ingress rules, thus closing the loop. Config can remediate automatically via SSM Automation without manual intervention, making this the correct solution.

Why this answer

AWS Config rules can detect non-compliant security groups, and Systems Manager Automation can remediate by modifying the security group rules. GuardDuty detects threats but not config compliance. EventBridge alone doesn't remediate.

CloudTrail is for auditing API calls.

1477
MCQmedium

A company has a production environment that uses Amazon Route 53 for DNS and an Application Load Balancer (ALB) to distribute traffic to EC2 instances. The company wants to implement a disaster recovery plan that automatically fails over to a secondary region in case the primary region becomes unavailable. Which configuration should be used?

A.Use Route 53 weighted routing policy with equal weights for both regions.
B.Use Route 53 geolocation routing policy to route users based on their location.
C.Use Route 53 failover routing policy with primary and secondary records and health checks.
D.Use Route 53 latency routing policy to route to the region with lowest latency.
AnswerC

Failover routing is the Route 53 policy explicitly designed for active-passive disaster recovery. It lets you mark one record (or record set within a group) as the primary and another as secondary, and associate each with a health check. Route 53 monitors the primary endpoint's health and, when the health check fails after the configured threshold, automatically returns the secondary record's answer for all DNS queries. This deterministic, health-driven promotion of the standby region matches the company's requirement for automatic failover.

Why this answer

Route 53 failover routing policy with health checks on the ALB endpoint can automatically route traffic to a secondary endpoint when the primary is unhealthy. Option A is wrong because weighted routing distributes traffic based on weights, not failover. Option B is wrong because geolocation routing routes based on geographic location, not failover.

Option D is wrong because latency routing routes based on latency, not automatic failover.

1478
MCQmedium

A company runs a critical web application on EC2 instances behind an Application Load Balancer. To improve resilience, they want to automatically replace failed instances. Which AWS service should they use?

A.EC2 Instance Recovery
B.AWS Systems Manager Automation
C.CloudFormation Stack update
D.Auto Scaling group with health checks
AnswerD

An Auto Scaling group with health checks automatically replaces failed EC2 instances by monitoring them using EC2 status checks and optionally Elastic Load Balancing health checks. When an instance is marked unhealthy, the ASC terminates it and launches a new instance in an attempt to maintain the desired capacity, and it does so across multiple Availability Zones to increase resilience. This meets the requirement for automatic replacement based on instance health, and because it is a continuous, managed process, it is the correct solution for keeping critical applications available.

Why this answer

Auto Scaling groups with health checks automatically replace unhealthy instances based on ELB health check integration. Option D is correct. Option A (EC2 Instance Recovery) recovers instances on the same host but does not replace them if the host fails.

Option B (Systems Manager Automation) requires manual or scheduled automation, not automatic health-based replacement. Option C (CloudFormation Stack update) does not provide auto-replacement; it manages infrastructure updates.

1479
MCQeasy

A DevOps engineer is implementing AWS Config rules to enforce tagging standards on resources. The rule should trigger a remediation action via AWS Systems Manager Automation to apply the correct tags if a resource is non-compliant. What is the correct way to set up this remediation?

A.Use the AWS Config rule's remediation action to run an AWS Systems Manager Automation document.
B.Configure the AWS Config rule to send events to AWS CodePipeline to trigger a pipeline that fixes the tags.
C.Configure a CloudWatch Events rule to detect non-compliant resources and invoke a Lambda function that applies tags.
D.Use an SNS topic to notify administrators when a resource is non-compliant.
AnswerA

AWS Config rules natively support an automated remediation feature that links a non-compliant rule evaluation to an AWS Systems Manager Automation document. This is the intended, first-party mechanism: the Automation document can run pre-built or custom steps (e.g., AWS-TagResource) to fix tag violations, and Config can automatically apply remediation to affected resources. Because it is built into the Config service itself, it avoids the need to wire separate event routing or manual workflows, making it the most direct and operationally efficient option.

Why this answer

AWS Config rules can directly associate a remediation action using an AWS Systems Manager Automation document. When a resource is evaluated as non-compliant, Config can automatically invoke the specified SSM Automation document to apply the correct tags, without requiring intermediate services. This is the native, supported mechanism for auto-remediation of non-compliant resources.

Exam trap

The trap here is that candidates may over-engineer a solution with Lambda or CloudWatch Events, not realizing that AWS Config has a built-in, one-click remediation action that directly invokes SSM Automation documents, making it the simplest and most correct approach.

How to eliminate wrong answers

Option B is wrong because AWS Config does not natively integrate with AWS CodePipeline for remediation; CodePipeline is a CI/CD service, not designed for real-time tag enforcement. Option C is wrong because while a CloudWatch Events rule can detect non-compliant resources and invoke a Lambda function, this is an indirect, custom approach that duplicates the built-in remediation capability of AWS Config, and the question specifically asks for the correct way to set up remediation using AWS Config's native feature. Option D is wrong because an SNS topic only notifies administrators; it does not perform any automated remediation action, which the question requires.

1480
MCQhard

A company runs a containerized microservices application on Amazon ECS with Fargate launch type. The application uses an Application Load Balancer to route traffic to the ECS service. Recently, the DevOps team noticed that the ECS service is failing to deploy new tasks during a rolling update. The CloudWatch Logs for the ECS service show that new tasks are failing to start because they cannot pull the container image from Amazon ECR. The error message indicates 'AccessDenied' when attempting to pull the image. The task execution role has the necessary permissions, and the image URI is correct. The VPC has a VPC endpoint for ECR configured. The security group for the tasks allows outbound traffic to the VPC endpoint. What is the MOST likely cause of the access denied error?

A.The task execution role does not have the 'ecr:GetAuthorizationToken' permission.
B.The security group for the ALB does not allow inbound traffic to the ECS tasks.
C.The VPC endpoint for ECR does not have 'Private DNS names enabled' selected.
D.The task role does not have the 'ecr:BatchGetImage' permission.
AnswerC

This option is correct because when the 'Private DNS names enabled' option is not selected for an Amazon ECR VPC endpoint, the default DNS endpoint (ecr.<region>.amazonaws.com) continues to resolve to public IP addresses. Since the ECS task runs in a private subnet with no internet route, the ECS agent sends the request to a public IP that is unreachable, and the VPC endpoint responds with AccessDenied because the request is not being handled by the endpoint. Enabling private DNS names creates a Route 53 private hosted zone that associates the endpoint's DNS with its private IP, ensuring traffic destined for ECR is routed through the VPC endpoint and bypasses the public network.

Why this answer

For ECS tasks using Fargate to pull images from ECR via a VPC endpoint, the private DNS names must be enabled on the endpoint. If not enabled, the task's DNS resolution of the ECR repository URL returns a public IP, which may be blocked by security groups or route tables, causing an 'AccessDenied' error despite correct IAM permissions. Option A is incorrect because 'ecr:GetAuthorizationToken' is needed for authentication, but the error occurs after authentication (the task execution role has permissions).

Option B is irrelevant as the ALB security group does not affect image pulling. Option D is incorrect because the task role is for application-level permissions, not for pulling images; that is handled by the task execution role.

1481
MCQhard

A DevOps engineer is troubleshooting an issue where an Amazon RDS instance's CPU utilization is consistently high. The engineer has enabled Performance Insights and sees that the top SQL query is a SELECT statement that scans many rows. What is the best course of action to reduce CPU utilization?

A.Create a read replica to offload read traffic.
B.Increase the allocated storage to improve I/O.
C.Increase the DB instance size to handle the load.
D.Add appropriate indexes to optimize the query.
AnswerD

Adding an appropriate index transforms a full table scan into an index seek, drastically reducing the number of rows the database engine must read and process, which directly lowers the CPU cycles spent on evaluating rows, join operations, and sort operations. An index that matches the query predicate (e.g., on the columns used in WHERE, JOIN, or ORDER BY) allows the optimizer to access only relevant pages, shrinking buffer pool I/O and improving overall query latency. This is the root-cause fix because it eliminates the unnecessary CPU work rather than merely hiding the symptom.

Why this answer

Adding appropriate indexes can reduce the number of rows scanned by the SELECT query, directly reducing CPU utilization. Option A is incorrect: creating a read replica offloads read traffic from the primary instance, but the problematic query would still run on whichever instance it is executed. If the query is still executed on the primary, the CPU remains high.

Additionally, the issue is a specific query scanning many rows, not general read load. Option B is incorrect: increasing allocated storage improves I/O performance but does not reduce CPU usage caused by scanning many rows. Option C is incorrect: increasing the DB instance size provides more CPU capacity, but it does not address the root cause of inefficient querying; optimizing the query is a more cost-effective and sustainable solution.

1482
MCQhard

A DevOps engineer is reviewing the CodePipeline structure above. The pipeline fails during the Deploy stage with an error: 'The deployment group could not be found.' What is the most likely cause?

A.The pipeline is configured as a single-region pipeline, but the Deploy action is in a different region.
B.The source artifact is not accessible from us-west-2.
C.The CodeDeploy application does not exist in us-west-2.
D.The CodeBuild project is not configured to output artifacts.
AnswerA

In CodePipeline, every pipeline is bound to a single region. If a Deploy action references a CodeDeploy application in another region, it is treated as a cross-region action and must be explicitly configured with the Region property. Without that, the pipeline attempts to execute the action in us-east-1, where no deployment group exists, producing the 'Deployment group not found' error. The fix is to add the cross-region configuration or move the Deploy action to the same region.

Why this answer

The error 'The deployment group could not be found' indicates that CodePipeline is attempting to invoke a CodeDeploy deployment in a region where the specified deployment group does not exist. If the pipeline is configured as a single-region pipeline (e.g., in us-east-1) but the Deploy action references a deployment group in a different region (e.g., us-west-2), CodePipeline will fail because it cannot resolve the deployment group across regions in a single-region pipeline configuration. Cross-region actions require explicit cross-region action configuration in the pipeline structure.

Exam trap

The trap here is that candidates often confuse the error message 'deployment group could not be found' with the deployment group not existing at all (Option C), rather than recognizing it as a region mismatch issue where the deployment group exists but in a different region than the pipeline.

How to eliminate wrong answers

Option B is wrong because the source artifact's accessibility from us-west-2 would cause a different error, such as 'Artifact not found' or 'Access denied', not a deployment group not found error. Option C is wrong because if the CodeDeploy application did not exist in us-west-2, the error would be 'The application could not be found' or 'Application does not exist', not specifically about the deployment group. Option D is wrong because a CodeBuild project not configured to output artifacts would cause the pipeline to fail earlier in the Build stage or during artifact retrieval, not during the Deploy stage with a deployment group error.

1483
MCQmedium

A company uses AWS Elastic Beanstalk for deploying a web application. The development team wants to implement a blue/green deployment strategy to minimize downtime. Which approach should they use?

A.Update the Auto Scaling group launch configuration and gradually replace instances.
B.Create a new CodeDeploy deployment group and use the blue/green deployment configuration.
C.Create a new Elastic Beanstalk environment and swap the environment CNAMEs.
D.Create a new target group and register instances from the old environment.
AnswerC

Creating a new Elastic Beanstalk environment and then swapping the environment CNAMEs is the native blue/green deployment method. The new environment is fully provisioned, tested, and warmed up behind its own URL before the CNAME swap atomically redirects production traffic. This enables immediate rollback by swapping back, and it is the standard Elastic Beanstalk pattern for zero-downtime blue/green releases.

Why this answer

In AWS Elastic Beanstalk, blue/green deployment is achieved by creating a separate environment (the green environment) alongside the existing one (the blue environment), deploying the new application version to it, and then swapping the CNAME records of the two environments. This swap is instantaneous at the DNS level, resulting in zero downtime because traffic is immediately redirected from the old environment to the new one without any instance replacement or gradual shifting.

Exam trap

The trap here is that candidates confuse the blue/green deployment mechanism in Elastic Beanstalk (CNAME swap) with the blue/green deployment in AWS CodeDeploy (which uses deployment groups and target groups), leading them to incorrectly select Option B.

How to eliminate wrong answers

Option A is wrong because updating the Auto Scaling group launch configuration and gradually replacing instances describes a rolling update or immutable deployment, not a blue/green deployment, and it does not involve a separate environment or DNS swap. Option B is wrong because CodeDeploy blue/green deployments are used with EC2 instances or Lambda functions, not with Elastic Beanstalk environments; Elastic Beanstalk manages its own deployment mechanisms and does not integrate with CodeDeploy deployment groups for environment-level swaps. Option D is wrong because creating a new target group and registering instances from the old environment is a pattern used with Application Load Balancers for manual traffic shifting, but Elastic Beanstalk abstracts load balancer management and uses environment CNAMEs for traffic routing, not target group swaps.

1484
MCQeasy

A company runs a web application on EC2 instances behind an Application Load Balancer. The application experiences intermittent failures due to a single Availability Zone failing. Which solution is MOST resilient and cost-effective?

A.Use a larger instance type in the same Availability Zone
B.Use an Auto Scaling group with a single instance in each of three Availability Zones and a Network Load Balancer
C.Migrate to a single larger instance in a different region
D.Deploy EC2 instances across two Availability Zones and configure the ALB to distribute traffic
AnswerD

Deploying EC2 instances across two Availability Zones behind an Application Load Balancer provides both fault isolation and active load balancing. The ALB performs health checks, routes traffic only to healthy instances, and can distribute requests across both AZs, so if one entire AZ becomes unavailable, the other continues to serve traffic. This is the standard architecture for achieving regional high availability with an HTTP web application.

Why this answer

Most resilient and cost-effective. Deploying EC2 instances across two Availability Zones and configuring the ALB to distribute traffic ensures high availability by handling a single AZ failure without over-provisioning. Option A is wrong because using a larger instance in the same AZ does not address AZ failure.

Option B is wrong because using three AZs with a single instance each and a Network Load Balancer is more expensive and not necessary for this scenario; ALB already supports cross-zone load balancing. Option C is wrong because migrating to a different region adds latency, complexity, and cost.

1485
Multi-Selecteasy

A DevOps engineer needs to monitor the health of a web application running on EC2 instances behind an Application Load Balancer (ALB). Which TWO metrics from ALB should be monitored to detect application errors? (Choose TWO.)

Select 2 answers
A.RequestCount.
B.HTTPCode_ELB_5XX_Count.
C.HTTPCode_Target_5XX_Count.
D.HealthyHostCount.
E.TargetResponseTime.
AnswersC, E

HTTPCode_Target_5XX_Count is the definitive metric for monitoring application health because it directly counts HTTP 5xx responses returned by the registered targets (EC2 instances, containers, or Lambda). This value reflects actual application failures—unhandled exceptions, internal server errors, or gateway timeouts—making it the most precise indicator of unhealthy application logic. It is the recommended metric to alarm on for detecting when your web application is returning server-side errors to users.

Why this answer

(HTTPCode_Target_5XX_Count) is correct because it counts HTTP 5XX errors returned by the target (EC2 instances), indicating application errors. Option E (TargetResponseTime) is correct because elevated response times can indicate application performance issues or errors, and is a key metric for detecting application problems. Option A (RequestCount) is incorrect because it simply counts total requests, not errors.

Option B (HTTPCode_ELB_5XX_Count) is incorrect because it counts 5XX errors generated by the ALB itself (e.g., due to configuration issues), not application errors. Option D (HealthyHostCount) is incorrect because it indicates the number of healthy targets, not application-level errors.

1486
Multi-Selectmedium

Which THREE are valid AWS Systems Manager capabilities for configuration management? (Select THREE.)

Select 3 answers
A.Run Command
B.OpsCenter
C.Parameter Store
D.Patch Manager
E.State Manager
AnswersA, D, E

Run Command is a valid Systems Manager capability because it lets you execute operational commands and scripts on EC2 instances and on-premises machines via the SSM agent, without opening inbound ports like SSH or RDP. It supports ad-hoc execution across targets defined by tags, resource groups, or individual instance IDs, with features like rate control, error thresholds, and integration with EventBridge for automation.

Why this answer

Run Command enables you to manage configuration by remotely executing commands on instances. Patch Manager automates the process of patching managed instances. State Manager helps you define and maintain the desired state of your instances.

OpsCenter (B) is an operational data hub for viewing and resolving operational issues, not primarily for configuration management. Parameter Store (C) provides secure storage for configuration data and secrets, but it is a supporting service rather than a configuration management capability itself.

1487
MCQmedium

A DevOps team uses AWS CodePipeline with a multi-branch strategy. The pipeline should deploy to production only from the 'main' branch, but run unit tests for all branches. How should the team configure the pipeline?

A.Configure the pipeline source stage to trigger on all branches, use branch-specific logic in the test stage, and add a manual approval step for production deployment only when the branch is 'main'.
B.Use an AWS Lambda function to check the branch name and invoke different CodePipeline executions for testing and deployment.
C.Create one pipeline with two source stages: one for 'main' and one for all other branches, each with its own test and deploy actions.
D.Create a separate pipeline for each branch, each with identical test and deploy stages.
AnswerA

Configuring the source stage to trigger on all branches is the recommended approach because CodePipeline natively supports branch filters on source actions, allowing a single pipeline to react to every branch push. Branch-specific logic can then be implemented in the test stage using environment variables or run-time conditions to vary test suites, while a manual approval action can be conditionally added to the deploy stage only when the branch is 'main'. This leverages built-in pipeline features, avoids duplication, and keeps the deployment workflow centralized and auditable, which is the most scalable and maintainable design.

Why this answer

AWS CodePipeline supports branch filtering in the source stage to trigger on all branches, and you can use a condition in the deploy stage (e.g., via a Lambda function or a manual approval step) to restrict production deployment to the 'main' branch only. This approach avoids duplicating pipelines while ensuring unit tests run for every branch, meeting the multi-branch strategy requirement efficiently.

Exam trap

The trap here is that candidates may think they need separate pipelines or multiple source stages to handle branch-specific logic, but CodePipeline's branch filtering and conditional actions (like Lambda checks or manual approvals) allow a single pipeline to handle all branches efficiently.

How to eliminate wrong answers

Option B is wrong because invoking separate CodePipeline executions via a Lambda function for testing and deployment adds unnecessary complexity and breaks the single-pipeline model; CodePipeline natively supports branch-based conditions without external orchestration. Option C is wrong because having two source stages in one pipeline is not supported—CodePipeline allows only one source stage per pipeline, and mixing branches in separate source stages would cause conflicts in artifact handling. Option D is wrong because creating a separate pipeline for each branch violates the DRY principle, increases maintenance overhead, and does not leverage CodePipeline's built-in branch filtering and conditional execution capabilities.

Page 19

Page 20 of 20