Courseiva

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

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

Page 14

Page 15 of 20

Page 16
1051
MCQmedium

An operations team manages a fleet of Amazon EC2 instances that require periodic software updates. They want to use AWS Systems Manager to apply patches automatically while ensuring that patches are tested before production deployment. Which approach meets these requirements?

A.Use AWS Systems Manager Automation to create a runbook that patches instances one by one.
B.Create a patch baseline and assign it to all instances; enable automatic approval for all patches.
C.Use AWS Systems Manager Run Command to manually run patch commands on test instances, then on production.
D.Use AWS Systems Manager Patch Manager with maintenance windows, and configure a patch baseline that approves patches after a test period.
AnswerD

Patch Manager automates the entire patching process by using a patch baseline to define which patches are approved, when they are approved (e.g., after a test period expressed in days), and how those rules are applied to tagged instance groups. Maintenance windows schedule when the patching runs on test and production fleets, ensuring production patches are installed only after the baseline's approval delay lets the test fleet validate them. This combination provides automation, a testing gate, and controlled rollout windows, which directly satisfies the requirement.

Why this answer

AWS Systems Manager Patch Manager, when combined with maintenance windows and a patch baseline configured with an approval delay after a test period, allows patches to be automatically applied to test instances first and then, after a defined waiting period, to production instances. This ensures patches are tested before production deployment without manual intervention, meeting the requirement for automated, staged patching.

Exam trap

The trap here is that candidates often confuse Run Command (a manual, ad-hoc tool) with Patch Manager (an automated, policy-driven service), or they assume that simply enabling automatic approval (Option B) is sufficient without considering the need for a testing delay.

How to eliminate wrong answers

Option A is wrong because using Automation to patch instances one by one does not inherently provide a test-before-production staging mechanism; it simply serializes patching without a defined approval delay. Option B is wrong because enabling automatic approval for all patches bypasses any testing period, applying patches to all instances immediately without validation. Option C is wrong because Run Command is a manual execution tool, not an automated solution, and it does not enforce a test period before production deployment.

1052
Drag & Dropmedium

Drag and drop the steps to configure an AWS Auto Scaling group with a launch template and scaling policies.

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 create the launch template, then create the Auto Scaling group, then configure network, then set capacities, then add scaling policy.

1053
MCQhard

A company is migrating to AWS and has a requirement to encrypt all data at rest and in transit. They are using AWS KMS with Customer Master Keys (CMKs) for encryption. The DevOps engineer has set up an S3 bucket with default encryption using SSE-KMS. The bucket policy allows access only to a specific IAM role. The engineer also enabled S3 bucket versioning and MFA Delete. However, when the engineer tries to download an object using the AWS CLI with the IAM role, the command fails with 'AccessDenied'. The IAM role has the following permissions: s3:GetObject, s3:ListBucket, kms:Decrypt, kms:DescribeKey. What is the most likely missing permission?

A.The IAM role is missing kms:GenerateDataKey permission.
B.The IAM role is missing kms:Encrypt permission.
C.The IAM role is missing kms:CreateGrant permission.
D.The KMS key policy does not grant the IAM role permission to decrypt using the key.
AnswerD

For an IAM role to decrypt an object using a customer managed key, the KMS key policy must explicitly include the role (or an account principal with delegation) in a statement that allows kms:Decrypt. Even if the IAM role's permissions policy grants kms:Decrypt, KMS requires both the IAM policy and the key policy to authorize the action. If the key policy only allows a different principal or restricts access to specific roles, the decryption fails—this is the most direct cause of the error.

Why this answer

The error 'AccessDenied' when downloading an object encrypted with SSE-KMS indicates that the IAM role lacks permission to use the KMS key for decryption. Even though the IAM role has kms:Decrypt, the KMS key policy must explicitly grant the role permission to decrypt using that key. Without this key policy grant, the role's IAM permissions are insufficient.

Option D is correct because the key policy is the missing piece. Option A is incorrect because kms:GenerateDataKey is needed for uploading, not downloading. Option B is incorrect as kms:Encrypt is also for writing.

Option C is incorrect because kms:CreateGrant is not required for this operation.

1054
Multi-Selecthard

A company is designing a disaster recovery plan for a critical application that uses Amazon RDS for MySQL with Multi-AZ. The RPO must be less than 1 minute and RTO less than 15 minutes. The primary Region is us-east-1. Which TWO steps should the company take to meet these requirements?

Select 2 answers
A.Take manual snapshots of the RDS instance every 30 seconds and copy them to the secondary Region
B.Enable Multi-AZ in the primary Region
C.Create a cross-Region read replica of the RDS instance in the secondary Region
D.Create an AWS Lambda function to promote the read replica to primary in the secondary Region during a disaster
E.Enable automated backups with cross-Region copy enabled to the secondary Region
AnswersC, D

A cross-Region read replica uses the database engine's native asynchronous replication from the primary RDS instance to a secondary instance in another Region. The lag is typically low (often well under 60 seconds), so it can satisfy an RPO of less than one minute, and because the replica is a fully open read-only instance you can promote it to primary quickly, giving a low RTO. This makes it the core mechanism for a resilient cross-Region disaster recovery plan that meets both RPO and RTO requirements.

Why this answer

C and D are correct. A cross-Region read replica of the RDS instance in the secondary Region provides near-real-time replication, achieving an RPO of less than 1 minute. When a disaster occurs, the read replica can be promoted to a primary instance quickly, meeting the RTO of less than 15 minutes.

An AWS Lambda function can automate the promotion process, reducing manual intervention and further improving RTO. Option E is incorrect because automated backups with cross-Region copy are taken periodically (e.g., daily), not continuously, so they cannot achieve an RPO of less than 1 minute.

1055
Multi-Selectmedium

A company is using AWS Secrets Manager to rotate database credentials automatically. The DevOps engineer needs to ensure that the rotation process is secure and does not cause downtime. Which THREE steps should the engineer take?

Select 3 answers
A.Disable automatic rotation for the old secret version.
B.Set up CloudWatch alarms to monitor rotation failures.
C.Use a separate database user for rotation that has permissions to change passwords.
D.Configure the Lambda rotation function to use a VPC endpoint for Secrets Manager.
E.Grant the Lambda rotation function IAM permissions to read and update the secret.
AnswersB, C, E

Setting up CloudWatch alarms on the Secrets Manager rotation Lambda function's failure metrics or on the RotationFailed event (via Amazon EventBridge and CloudTrail) is essential because rotation failures can occur silently without directly impacting the application. If a failure goes unnoticed, the secret may remain stale for an extended period; more critically, the Lambda might have created and stored a new version but failed to promote it to AWSCURRENT, leaving the database and Secrets Manager in an inconsistent state. An alarm ensures administrators are notified quickly to prevent both stale credential burnout and potential data-plane outages.

Why this answer

CloudWatch alarms can monitor rotation failures and trigger alerts, ensuring issues are detected promptly. Option C is correct because using a separate database user for rotation allows the old credentials to remain valid while the new ones are being set, preventing downtime during the rotation process. Option E is correct because the Lambda rotation function needs IAM permissions to read and update the secret in Secrets Manager.

Option A is incorrect: disabling automatic rotation for the old secret version is unnecessary; Secrets Manager automatically manages version staging during rotation. Option D is incorrect: while the Lambda function must reach Secrets Manager, using a VPC endpoint is not mandatory; the function can access Secrets Manager via the internet or a VPC endpoint, but this is not a required step for secure rotation.

1056
MCQhard

A DevOps team uses AWS CodePipeline to deploy a web application. The application stores user session data in an ElastiCache Redis cluster. The security team mandates that all data in transit between the application and Redis must be encrypted. What should the team do?

A.Use a network ACL to allow only encrypted traffic on the Redis port.
B.Modify the application to use TLS when connecting to Redis.
C.Place the application and Redis cluster in the same VPC and use VPC peering.
D.Enable encryption in transit on the ElastiCache Redis cluster and configure the application to use TLS.
AnswerD

Correct. ElastiCache Redis supports encryption in transit via TLS, which must be enabled when creating the cluster, and the application must be configured to connect using TLS.

Why this answer

ElastiCache Redis supports encryption in transit using TLS, which must be enabled at cluster creation. Option A is wrong because NACLs do not encrypt traffic. Option B is wrong because the application must use TLS, but the cluster must also be configured to support it.

Option C is wrong because VPC peering does not encrypt traffic.

1057
MCQeasy

An organization wants to grant cross-account access to an S3 bucket in Account A to a user in Account B. Which policy configuration is required?

A.A bucket policy in Account A and an IAM user policy in Account B
B.An S3 bucket ACL granting access to the user in Account B
C.An IAM user policy in Account B allowing access to the bucket
D.A bucket policy in Account A granting access to the user in Account B
AnswerA

Combining a bucket policy in Account A that grants the IAM user ARN from Account B permissions on the target S3 bucket with an IAM user policy in Account B that approves the same actions is the standard method for cross-account S3 access. The bucket policy acts as the resource-based authorization, defining who can interact with the bucket and its objects; the IAM user policy acts as the identity-based authorization, allowing the user to invoke those S3 APIs. Without both explicit allows, the request is denied by AWS's default deny behavior.

Why this answer

Cross-account access to an S3 bucket requires both a resource-based policy (bucket policy) on the bucket in Account A granting access to the user in Account B, and an identity-based policy (IAM user policy) in Account B allowing the user to access the bucket. Option A correctly includes both policies. Option B is incorrect because S3 bucket ACLs are legacy and not recommended for cross-account access.

Option C is missing the bucket policy in Account A, so it is insufficient. Option D is missing the IAM user policy in Account B, so it is insufficient.

1058
MCQmedium

A DevOps team uses AWS OpsWorks for configuration management. They have a stack with a custom cookbook that installs and configures an application. After updating the cookbook on GitHub, they need to apply the changes to existing instances without creating new ones. What should the team do?

A.Clone the stack and assign the updated cookbook to the new stack.
B.Use the 'Execute Recipes' feature to run the updated custom recipe on the instances.
C.Update the layer's custom cookbook settings and then reboot the instances.
D.Update the stack's custom cookbook source and click 'Update Dependencies' on the stack.
AnswerB

The Execute Recipes feature in AWS OpsWorks Stacks allows you to run a specified recipe on selected instances immediately. This initiates an ad-hoc Chef run that pulls the latest cookbook from your configured source and executes the recipe's logic, directly applying the changes to the existing instances. It is the intended mechanism for manually applying cookbook updates without recreating or redeploying instances.

Why this answer

AWS OpsWorks provides the 'Execute Recipes' feature, which allows you to run a specific recipe from a cookbook on existing instances without requiring a stack update or instance replacement. This is the direct method to apply changes from an updated custom cookbook to running instances, as it triggers Chef to execute the specified recipe immediately on the selected instances.

Exam trap

The trap here is that candidates often confuse updating the cookbook source (which only stages the new code) with actually executing the recipes, leading them to choose Option D, which does not apply the changes to running instances.

How to eliminate wrong answers

Option A is wrong because cloning the stack creates a new set of instances, which does not apply changes to the existing instances and introduces unnecessary overhead. Option C is wrong because updating the layer's custom cookbook settings only changes the source for future instance provisioning or updates, and rebooting instances does not automatically run the updated recipes; it merely restarts the OS without executing Chef. Option D is wrong because updating the stack's custom cookbook source and clicking 'Update Dependencies' only refreshes the cookbook cache on the instances but does not automatically execute the updated recipes; a separate 'Execute Recipes' action is required to apply the changes.

1059
MCQmedium

A DevOps engineer is designing a CI/CD pipeline for a microservices application using AWS CodePipeline. Each microservice has its own CodeCommit repository. The engineer wants to run unit tests in parallel for all services when any repository receives a push, then run integration tests only after all unit tests pass. Which pipeline structure should the engineer use?

A.Create a single pipeline with a parallel action for unit tests, then a serial stage for integration tests
B.Create a single pipeline with a serial stage for unit tests, then integration tests
C.Create one pipeline per microservice, each triggering integration tests via SNS
D.Use AWS CodeBuild batch builds with a fan-out/fan-in pattern
AnswerA

This design uses CodePipeline stages to gate flow: a stage with parallel unit-test actions runs the per-microservice unit suites concurrently, cutting total test wall-clock time, and the stage only completes when every action succeeds. The subsequent integration-test stage is serial relative to unit tests, so integration testing starts only after all unit suites are green, preserving deterministic dependency ordering while still exploiting parallelism where safe.

Why this answer

AWS CodePipeline supports parallel actions within a stage, allowing unit tests for all microservices to run concurrently. After all unit tests succeed, the pipeline transitions to a serial stage for integration tests, ensuring the correct dependency order. This structure minimizes build time while enforcing the required sequential gate.

Exam trap

The trap here is that candidates often confuse parallel actions within a stage with parallel stages, or assume that separate pipelines are needed for each microservice, overlooking CodePipeline's ability to run multiple actions concurrently in a single stage.

How to eliminate wrong answers

Option B is wrong because it runs unit tests serially, which increases overall pipeline duration unnecessarily since there is no dependency between microservice unit tests. Option C is wrong because creating separate pipelines per microservice prevents a single coordinated integration test stage after all unit tests pass; triggering via SNS would require custom orchestration and lose CodePipeline's built-in state management. Option D is wrong because AWS CodePipeline does not natively support fan-out/fan-in patterns; CodeBuild batch builds can parallelize builds but lack the stage-level dependency control needed to run integration tests only after all unit tests complete.

1060
MCQhard

A company uses AWS CodeBuild to run integration tests as part of a pipeline. The tests require access to an Amazon RDS database. The RDS instance is in a private subnet with no public access. The CodeBuild project is configured with a VPC. Which additional configuration is necessary to ensure the build can connect to the database?

A.Add an IAM policy that grants the CodeBuild service role access to the RDS instance.
B.Configure the security group for the RDS instance to allow inbound traffic from the security group associated with the CodeBuild project.
C.Create a VPC endpoint for Amazon RDS.
D.Attach a NAT gateway to the private subnet.
AnswerB

The RDS instance's security group must have an inbound rule that allows TCP traffic on the database port (e.g., 3306, 5432) from the security group ID attached to the CodeBuild project's elastic network interface. This is the standard way to permit traffic between AWS resources within a VPC, because security group rules reference other security groups as sources. The CodeBuild project must also be configured with VPC settings (VPC ID, subnets, and security groups) so its ENI is placed in the same network context as the RDS instance, enabling the security group-to-security group allow.

Why this answer

The CodeBuild project is configured with a VPC, meaning it runs inside a private subnet and uses an elastic network interface (ENI) with an associated security group. To allow the build container to connect to the RDS instance, the RDS security group must have an inbound rule that permits traffic on port 3306 (or the appropriate database port) from the CodeBuild security group. This is a standard network-layer access control; no additional IAM or gateway is required for connectivity.

Exam trap

The trap here is that candidates confuse IAM permissions (which control API access) with network security group rules (which control traffic flow), leading them to select Option A, or they mistakenly think a VPC endpoint is needed for database connectivity when it is only for API calls.

How to eliminate wrong answers

Option A is wrong because IAM policies control authentication and authorization for AWS API calls, not network-level traffic; RDS security groups control inbound traffic at the network layer, and IAM does not open ports. Option C is wrong because a VPC endpoint for RDS is used to access the RDS API (e.g., to modify DB instances) from within a VPC without internet traffic, not to connect to the database engine itself; database connections use the database port, not the RDS API endpoint. Option D is wrong because a NAT gateway provides outbound internet access for private subnets, but the RDS instance is in the same VPC, so traffic between CodeBuild and RDS stays within the VPC and does not require internet access.

1061
MCQhard

Refer to the exhibit. A developer is using this buildspec.yml in AWS CodeBuild to build and push a Docker image to Amazon ECR. The build fails with the error: 'Error: No region specified'. Which change should the developer make to resolve this error?

A.Add a pre_build command to export AWS_DEFAULT_REGION using the AWS CLI.
B.Set the AWS_DEFAULT_REGION environment variable in the CodeBuild project's environment configuration.
C.Replace $AWS_DEFAULT_REGION with a hardcoded region like us-east-1.
D.Use the AWS_REGION environment variable instead of AWS_DEFAULT_REGION in the buildspec.
AnswerB

Setting AWS_DEFAULT_REGION in the CodeBuild project's environment configuration is the correct fix because CodeBuild injects all project-level environment variables into every phase of the build, making the value available to the AWS CLI, SDKs, and all build commands without any buildspec changes. This approach is explicit, portable, and aligns with AWS best practices for configuring tooling at the project level rather than relying on phase-scoped shell exports.

Why this answer

The error occurs because the $AWS_DEFAULT_REGION environment variable is not set in the CodeBuild project. The developer must explicitly set the AWS_DEFAULT_REGION environment variable in the CodeBuild project configuration.

1062
Multi-Selecteasy

A company uses AWS CodePipeline to automate their software release process. They want to add a stage that runs security scanning on the code before deployment. Which two AWS services can be integrated into the pipeline for this purpose? (Choose TWO.)

Select 2 answers
A.Amazon Inspector
B.Amazon GuardDuty
C.Amazon Detective
D.AWS CodeBuild
E.AWS CodeDeploy
AnswersA, D

Amazon Inspector is a vulnerability management service that scans workloads for software vulnerabilities and unintended network exposure. Its CodePipeline integration uses the Inspector Scan action to automatically inspect container images stored in Amazon ECR during the pipeline, blocking deployment if critical findings are discovered. This catches CVE-level issues in dependencies and OS packages before release, making it a direct preventive control.

Why this answer

Amazon Inspector is a vulnerability management service that scans workloads for software vulnerabilities and unintended network exposure. It can be integrated into a CodePipeline stage to perform automated security scanning on the code or infrastructure before deployment, helping to identify issues early in the SDLC.

Exam trap

The trap here is that candidates often confuse Amazon Inspector (a vulnerability scanner for workloads) with Amazon GuardDuty (a threat detector for account activity), or assume that AWS CodeDeploy includes built-in security scanning capabilities, when in fact it only handles deployment orchestration.

1063
MCQmedium

A DevOps engineer is reviewing the IAM policy attached to a CodeBuild service role. The policy allows starting builds and viewing logs. However, when CodeBuild tries to download artifacts from an S3 bucket in the same account, it fails with an access denied error. What is the missing permission?

A.s3:GetObject
B.kms:Decrypt
C.s3:PutObject
D.logs:DescribeLogGroups
AnswerA

To download an object from an S3 bucket, the calling principal must be granted the s3:GetObject action. Without this permission, S3 returns an AccessDenied error even if other S3 actions like ListBucket or PutObject are allowed, so adding s3:GetObject is the minimal and correct fix for a build process that retrieves artifacts.

Why this answer

The error occurs because CodeBuild needs to download artifacts from S3, which requires the s3:GetObject permission on the bucket or object. Without this permission, the service role cannot read the artifact files, even though it can start builds and view logs. The s3:GetObject action is the specific permission that grants read access to S3 objects.

Exam trap

The trap here is that candidates may confuse s3:GetObject with s3:PutObject or assume KMS decryption is always required, but the direct cause is the lack of read access to the S3 object.

How to eliminate wrong answers

Option B is wrong because kms:Decrypt is only needed if the S3 bucket uses server-side encryption with AWS KMS (SSE-KMS), but the question does not mention encryption, so the missing permission is not KMS-related. Option C is wrong because s3:PutObject is for uploading objects to S3, not downloading them; the error is about downloading artifacts, not uploading. Option D is wrong because logs:DescribeLogGroups is for listing CloudWatch log groups, which is unrelated to S3 access; it would not cause an S3 access denied error.

1064
MCQmedium

A DevOps engineer is creating a CloudFormation template that includes an AWS Lambda function. The function code is stored in an S3 bucket. The engineer wants to ensure that the Lambda function is updated whenever the code in S3 changes. What should the engineer do?

A.Use AWS CodeDeploy to deploy the Lambda function
B.Reference the S3 object version in the Lambda function's Code property to force an update when the version changes
C.Add a DependsOn clause to the Lambda function resource
D.Use AWS CodePipeline to automatically update the stack when the S3 object changes
AnswerB

In a CloudFormation template, the Lambda function's Code property, when referencing an S3 bucket, can include the S3ObjectVersion attribute. Because CloudFormation treats any template property change as a stack update trigger, explicitly specifying the object version creates a new template value whenever the zip file in S3 is modified. Without this version, CloudFormation compares only the bucket and key, both of which stay constant, so it considers the resource unrmodified and skips the Lambda update—even if the S3 object's contents were replaced. Adding the S3ObjectVersion forces a resource replacement or update, making it the simplest and most direct way to ensure the stack updates on code changes.

Why this answer

Referencing the S3 object version in the Lambda function's Code property (e.g., `S3ObjectVersion`) creates a dependency on that specific version. When the S3 object is updated, its version changes, which triggers CloudFormation to detect a change in the template and update the Lambda function during the next stack update. This ensures the function code is refreshed without manual intervention.

Exam trap

The trap here is that candidates assume any automation tool (CodePipeline or CodeDeploy) can replace the need for explicit version tracking, but CloudFormation requires a property change to trigger an update, and only referencing the S3 object version achieves that directly.

How to eliminate wrong answers

Option A is wrong because AWS CodeDeploy is a deployment service for managing traffic shifting and rollbacks, not a mechanism to detect S3 object changes and trigger CloudFormation updates. Option C is wrong because a DependsOn clause only controls resource creation order, not update triggers based on S3 object version changes. Option D is wrong because AWS CodePipeline can automate stack updates, but it requires an external trigger (e.g., S3 event notification or webhook) and does not inherently detect S3 object version changes to update the Lambda function directly.

1065
MCQmedium

A company uses AWS CloudTrail to monitor API activity. During an incident, they need to quickly identify any unauthorized IAM role assumption attempts. Which CloudTrail feature should be used to filter and alert on this specific event?

A.Configure VPC Flow Logs to capture traffic to the IAM endpoint.
B.Use S3 event notifications on the CloudTrail bucket for PutObject events.
C.Set up a CloudWatch Logs metric filter on the CloudTrail log group for 'AssumeRole' events.
D.Enable CloudTrail Insights to detect anomalous AssumeRole events.
AnswerD

CloudTrail Insights is the correct choice because it automatically applies machine learning to management events, including IAM AssumeRole, to establish a normal baseline and flag anomalous activity. It requires no manual filter definitions—you simply enable Insights on the trail, and it begins detecting unusual API call rates or error rates, logging them as separate Insights events. This is purpose-built for identifying abnormal role assumption patterns, such as an unexpected spike in AssumeRole calls or a new principal assuming roles outside its normal context.

Why this answer

CloudTrail Insights automatically analyzes management events to detect unusual activity, such as spikes in AssumeRole calls, without requiring manual filter configuration. This feature uses machine learning to establish a baseline and then alerts on deviations, making it ideal for quickly identifying unauthorized role assumption attempts during an incident.

Exam trap

The trap here is that candidates often assume a CloudWatch Logs metric filter (Option C) is the only way to detect specific events, but they overlook that CloudTrail Insights provides automated anomaly detection without requiring manual filter creation, which is faster during an incident.

How to eliminate wrong answers

Option A is wrong because VPC Flow Logs capture network traffic metadata (IP addresses, ports, protocols) at the VPC level, not IAM API calls or CloudTrail events; they cannot filter on specific IAM actions like AssumeRole. Option B is wrong because S3 event notifications on the CloudTrail bucket for PutObject events would trigger on every log file delivery, not on specific event types within those logs, leading to excessive noise and no filtering capability. Option C is wrong because CloudTrail logs are delivered to a CloudWatch Logs log group only if explicitly configured, and a metric filter on that log group for 'AssumeRole' events would require manual setup and ongoing maintenance, whereas the question asks for a feature that can be used quickly during an incident without pre-configuration.

1066
Multi-Selecthard

A company is migrating a monolithic application to a microservices architecture on Amazon EKS. The application uses a relational database. The team wants to ensure that database connections are managed efficiently and that the database can withstand a sudden spike in connections from multiple microservices. Which solution should the DevOps engineer implement? (Choose THREE.)

Select 3 answers
A.Use direct database connections from each microservice pod.
B.Use Amazon ElastiCache for Redis to cache database query results.
C.Deploy Amazon RDS Proxy in front of the database.
D.Configure the database to have a higher max_connections and enable Auto Scaling.
E.Implement a connection pool sidecar container (e.g., PgBouncer) in each EKS pod.
AnswersC, D, E

RDS Proxy manages connection pooling and reduces database load.

Why this answer

The correct solutions are C, D, and E. Option C (RDS Proxy) pools and shares database connections, reducing the number of connections and handling spikes efficiently. Option D (increase max_connections and enable Auto Scaling) allows the database to accept more connections and scale dynamically during spikes.

Option E (connection pool sidecar like PgBouncer) adds connection pooling at the pod level, further managing connections. Option A (direct connections) would increase the number of connections, potentially overwhelming the database. Option B (ElastiCache) is for caching query results, not for managing database connections, and does not address the spike issue.

1067
MCQeasy

A DevOps engineer needs to manage the configuration of a large number of EC2 instances that are part of a cluster. The instances should have consistent software packages, services, and settings. The engineer wants to use a configuration management tool that integrates with AWS and supports a push-based model. Which service should be used?

A.AWS OpsWorks Stacks
B.AWS CodeCommit
C.AWS Systems Manager Run Command
D.AWS CloudFormation
AnswerC

AWS Systems Manager Run Command is a capability of AWS Systems Manager that lets you securely push commands to managed EC2 instances and on-premises machines without requiring SSH, RDP, or bastion hosts. The SSM Agent polls for commands, executes them, and can report status back, enabling admins to run scripts, install software, or change system settings across a fleet. Features such as tag-based targets, rate controls, and integration with IAM make it specifically designed for this kind of on-demand configuration activity.

Why this answer

AWS Systems Manager Run Command is the correct choice because it provides a push-based configuration management model that allows you to remotely and securely execute commands or scripts across a large fleet of EC2 instances without needing SSH access. It integrates natively with AWS, supports consistent software package installation and service management via SSM documents, and is ideal for maintaining configuration consistency in a cluster.

Exam trap

The trap here is that candidates confuse 'push-based' with agentless models or assume OpsWorks (which uses Chef/Chef push) is push-based, but OpsWorks Stacks primarily relies on pull-based Chef agents, whereas Systems Manager Run Command is the true push-based service for ad-hoc or scheduled configuration tasks.

How to eliminate wrong answers

Option A is wrong because AWS OpsWorks Stacks uses a pull-based model (Chef or Puppet agents on instances pull configuration from a central server) rather than a push-based model. Option B is wrong because AWS CodeCommit is a source control service for storing code and configuration files, not a configuration management tool for applying settings to EC2 instances. Option D is wrong because AWS CloudFormation is an Infrastructure as Code (IaC) service for provisioning and managing AWS resources declaratively, not for performing ongoing configuration management or push-based command execution on running instances.

1068
MCQmedium

A company runs a critical web application on EC2 instances behind an Application Load Balancer (ALB) across multiple Availability Zones. During a recent failure of one AZ, the application experienced downtime because the Auto Scaling group did not launch new instances quickly enough. What should a DevOps engineer do to improve resilience?

A.Configure the Auto Scaling group to span multiple AZs and enable health checks to replace unhealthy instances.
B.Use a larger AMI to reduce boot times.
C.Increase the instance size of the EC2 instances to handle more traffic.
D.Configure the Auto Scaling group to launch instances in a single AZ with a larger instance count.
AnswerA

Multiple AZs provide high availability and health checks ensure quick replacement.

Why this answer

Configuring the Auto Scaling group to span multiple Availability Zones (AZs) and enabling health checks ensures that if an entire AZ fails, the Auto Scaling group can launch replacement instances in the remaining healthy AZs. The ALB health checks detect unhealthy instances and trigger the Auto Scaling group to replace them, reducing downtime. This approach leverages the fault isolation of multiple AZs and the automatic scaling capabilities of AWS Auto Scaling.

Exam trap

The trap here is that candidates often focus on instance-level improvements (like larger AMIs or instance sizes) instead of architectural resilience across Availability Zones, which is the core requirement for AZ failure scenarios.

How to eliminate wrong answers

Option B is wrong because using a larger AMI would increase boot times, not reduce them, and boot time is not the primary bottleneck in this scenario—the issue is the lack of instances in other AZs. Option C is wrong because increasing instance size handles more traffic per instance but does not address the failure of an entire AZ; if all instances are in the same AZ, they all fail simultaneously. Option D is wrong because launching instances in a single AZ with a larger instance count concentrates all resources in one AZ, making the application vulnerable to a single AZ failure, which is exactly the problem described.

1069
Multi-Selecteasy

A DevOps engineer is troubleshooting an issue where an EC2 instance in a private subnet cannot reach the internet. The instance has a route to a NAT gateway. Which TWO of the following should the engineer check? (Choose TWO.)

Select 2 answers
A.The NAT gateway is in the same subnet as the instance
B.The route table of the private subnet has a route to the NAT gateway
C.The internet gateway is attached to the private subnet
D.The instance has a public IP address
E.The security group allows outbound traffic to the internet
AnswersB, E

For a private subnet to reach the internet via a NAT gateway, its route table must contain a route with a destination of 0.0.0.0/0 and a target of the NAT gateway's ID. This route tells the instance's traffic to be forwarded to the NAT gateway, which then performs source NAT using its Elastic IP. Without this specific route, the instance's outbound packets have no defined next hop to the internet, causing connectivity to fail.

Why this answer

The private subnet's route table must have a route pointing to the NAT gateway for traffic to be forwarded to the internet. Option E is correct because the security group associated with the EC2 instance must allow outbound traffic (e.g., HTTPS) to reach the internet; otherwise, packets are dropped. Option A is incorrect because the NAT gateway must be in a public subnet, not the same private subnet as the instance.

Option C is incorrect because the internet gateway is attached to the VPC, not to the subnet directly; private subnets use NAT to access the internet. Option D is incorrect because instances in private subnets do not require public IP addresses; they use the NAT gateway's public IP.

1070
Multi-Selecthard

A company uses AWS CodePipeline to deploy a serverless application using AWS SAM. The pipeline includes a build stage that runs 'sam build' and a deploy stage that runs 'sam deploy'. The team wants to automatically test the deployed application before promoting it to production. Which THREE steps should be included in the pipeline?

Select 3 answers
A.Add a stage that runs a performance or load test.
B.Add a stage that automatically rolls back the deployment if tests fail.
C.Add a manual approval stage after testing before promoting to production.
D.Add a stage that deploys the application to a separate production environment.
E.Add a stage after deployment that runs integration tests against the deployed API.
AnswersA, C, E

Running a performance/load test stage (e.g., using AWS CodeBuild with Apache JMeter or Artillery against the deployed API endpoint) validates that the serverless application can sustain expected concurrency and throughput without exceeding Lambda concurrency limits or API Gateway throttling quotas. It catches issues like cold start latency, inadequate memory allocation, or downstream dependency bottlenecks that unit tests miss. In serverless, load tests also confirm that provisioned concurrency or auto-scaling behavior works as intended under spike traffic.

Why this answer

Adding a performance or load test stage after deployment validates that the serverless application can handle expected traffic volumes under AWS SAM's provisioned concurrency and scaling limits. This ensures the application meets non-functional requirements before promotion, catching issues like cold start latency or throttling that unit tests miss.

Exam trap

The trap here is that candidates confuse automatic rollback (Option B) with a valid pipeline step, but AWS CodePipeline requires explicit actions for rollback, and the question specifically asks for steps to include, not automated recovery mechanisms.

1071
Multi-Selecteasy

A DevOps team is implementing a CI/CD pipeline for a microservices application deployed on Amazon ECS. They want to automatically build, test, and deploy container images to Amazon ECR and then update the ECS service. Which TWO steps are essential to achieve this goal?

Select 2 answers
A.Use AWS CodeDeploy to update the ECS service with a new task definition.
B.Use AWS Secrets Manager to store Docker credentials.
C.Use AWS CodeBuild to build the Docker image and push it to Amazon ECR.
D.Use AWS X-Ray for tracing.
E.Use Amazon CodeGuru for code review.
AnswersA, C

AWS CodeDeploy provides a native ECS deployment mechanism that can shift traffic from the old to the new task definition using blue/green or rolling configurations with an Application Load Balancer. In a CodePipeline-based CI/CD flow, this is the deployment action that makes the newly built image actually run on the ECS service, so it is essential to the pipeline.

Why this answer

AWS CodeDeploy is the native AWS service for managing ECS rolling or blue/green deployments. It orchestrates the creation of a new ECS task definition, registers it, and updates the ECS service to use the new task definition, ensuring zero-downtime deployments. Option C is correct because AWS CodeBuild can execute build commands from a buildspec.yml file to build a Docker image and push it to Amazon ECR using the built-in AWS CLI or Docker commands, which is a fundamental step in a CI/CD pipeline for containerized applications.

Exam trap

The trap here is that candidates may confuse AWS CodeDeploy with AWS CodePipeline or AWS CloudFormation for updating ECS services, but CodeDeploy is the specific service designed for controlled ECS deployments with traffic shifting and rollback capabilities.

1072
MCQeasy

A company uses AWS CloudFormation to manage its infrastructure. The DevOps team needs to deploy a stack that includes a Lambda function and an S3 bucket. The Lambda function's code is stored in the S3 bucket. How can the team ensure that the Lambda function is created after the S3 bucket and the code is uploaded?

A.Upload the code to the S3 bucket before creating the stack.
B.Use the Fn::GetAtt intrinsic function to retrieve the bucket name.
C.Define the S3 bucket resource before the Lambda function resource in the template.
D.Use the DependsOn attribute on the Lambda function to depend on the S3 bucket.
AnswerD

The DependsOn attribute explicitly declares a dependency edge from the Lambda function back to the S3 bucket, forcing CloudFormation to wait until the bucket resource has reached CREATE_COMPLETE before it starts provisioning the Lambda function. This is the definitive way to guarantee creation order, especially when the function needs the bucket to exist for side effects such as populating an environment variable, writing to the bucket, or associating permissions, and no implicit dependency exists in the template. Unlike implicit references, DependsOn works even if the bucket is not directly referenced in any property of the Lambda function, making it the correct answer.

Why this answer

The DependsOn attribute explicitly instructs CloudFormation to create the S3 bucket before the Lambda function. Even though CloudFormation automatically determines resource dependencies for certain intrinsic functions, it does not infer dependencies based on code uploads. Using DependsOn ensures the bucket exists and the code is uploaded before the Lambda function is created, preventing a deployment failure when the Lambda references code that is not yet available.

Exam trap

The trap here is that candidates assume CloudFormation automatically orders resources based on template order or implicit references like Fn::GetAtt, but it does not infer dependencies from code uploads or resource definition order, so explicit DependsOn is required for non-attribute-based dependencies.

How to eliminate wrong answers

Option A is wrong because it requires manual intervention outside of the CloudFormation stack, breaking the principle of infrastructure as code and making the deployment non-repeatable and error-prone. Option B is wrong because Fn::GetAtt retrieves an attribute of a resource (e.g., the bucket ARN) but does not create a dependency that ensures the bucket is fully created and the code is uploaded before the Lambda function is created. Option C is wrong because the order of resource definitions in the template does not guarantee creation order; CloudFormation may create resources in parallel or in a different order unless explicit dependencies are defined.

1073
MCQhard

A company is running a critical application on Amazon ECS with Fargate. The application generates custom metrics that are published to CloudWatch using the PutMetricData API. Recently, the metrics have been delayed by up to 5 minutes. The DevOps team needs to reduce the latency. What should the team do?

A.Install the CloudWatch agent on the Fargate tasks to collect metrics.
B.Set the StorageResolution parameter to 1 when calling PutMetricData.
C.Publish the metrics as structured logs to CloudWatch Logs and use metric filters.
D.Increase the frequency of PutMetricData calls to every 5 seconds.
AnswerB

Calling PutMetricData with StorageResolution=1 creates a high-resolution custom metric with 1-second granularity, making the data available for CloudWatch alarms in as little as 10 seconds instead of the 60-second standard resolution. This lower storage resolution is the key to detecting critical issues faster because CloudWatch can evaluate alarms at a 10- or 30-second period. Without this parameter, your metrics default to 60-second resolution and alarm latency remains as high as a minute.

Why this answer

Setting the StorageResolution parameter to 1 when calling PutMetricData enables high-resolution metrics with a 1-second granularity. This reduces the latency of metric ingestion and retrieval because CloudWatch processes high-resolution metrics more quickly than standard 60-second resolution metrics, addressing the 5-minute delay.

Exam trap

The trap here is that candidates may think increasing API call frequency or using log-based metrics will reduce latency, but the actual cause is the default 60-second storage resolution, which delays metric availability regardless of how often data is sent.

How to eliminate wrong answers

Option A is wrong because the CloudWatch agent cannot be installed on Fargate tasks; Fargate is a serverless compute engine that does not allow direct installation of agents, and metrics are already being published via PutMetricData, so the agent is unnecessary. Option C is wrong because publishing metrics as structured logs and using metric filters adds additional processing overhead and latency from log ingestion and filter evaluation, which would not reduce the delay and may increase it. Option D is wrong because increasing the frequency of PutMetricData calls to every 5 seconds does not change the resolution or ingestion latency; it may cause throttling from CloudWatch API limits and does not address the underlying delay caused by standard-resolution metric processing.

1074
Multi-Selectmedium

A DevOps engineer needs to set up a monitoring solution that can detect and alert on unusual patterns in application metrics. Which TWO AWS services can be used together to achieve this? (Choose TWO.)

Select 2 answers
A.Amazon GuardDuty
B.Amazon CloudWatch Alarms
C.Amazon CloudWatch Anomaly Detection
D.AWS CloudTrail
E.AWS Config
AnswersB, C

Amazon CloudWatch Alarms are the action engine that watches a single CloudWatch metric, a math expression, or an anomaly detection band over a specified time period, then transitions to an ALARM state when the observed value breaches a defined threshold. You can configure the alarm to publish to an SNS topic, trigger Auto Scaling, or execute an EC2 action such as a reboot when the anomaly condition persists. In this solution, the alarm consumes the band produced by CloudWatch Anomaly Detection and calls the monitoring hook when unusual metric behavior is detected.

Why this answer

CloudWatch Anomaly Detection uses machine learning to model expected metric behavior and detect anomalies. CloudWatch Alarms can then be configured to trigger actions (e.g., SNS notifications) when an anomaly is detected. Together, these two services provide a solution for alerting on unusual patterns in application metrics.

Amazon GuardDuty is a threat detection service for security threats, not application metrics. AWS CloudTrail is used for auditing API calls, not metric monitoring. AWS Config is for configuration compliance and resource inventory, not real-time metric anomaly detection.

1075
MCQmedium

A DevOps engineer needs to enforce encryption in transit for all traffic between a fleet of EC2 instances and an Application Load Balancer (ALB). The ALB is configured with a TLS listener. Which step should the engineer take to ensure end-to-end encryption?

A.Configure the target group to use HTTP protocol
B.Configure the target group to use HTTPS protocol and install a certificate on each EC2 instance
C.Use security group rules to enforce encryption
D.Terminate TLS at the ALB and use HTTP to instances
AnswerB

Configuring the target group for HTTPS forces the ALB to negotiate a TLS session with each EC2 instance, so backend traffic is encrypted as well. Each instance must present a valid certificate that the ALB trusts, typically installed on the instance's web server or TLS terminator, to complete the handshake. This provides encryption in transit across both the client-to-ALB and ALB-to-instance segments.

Why this answer

To enforce end-to-end encryption between the ALB and EC2 instances, the target group must use HTTPS protocol. This requires each EC2 instance to have a TLS certificate installed so that traffic from the ALB to the instances is encrypted. Option A is incorrect because HTTP does not encrypt traffic.

Option C is incorrect because security groups control network access but do not enforce encryption. Option D is incorrect because terminating TLS at the ALB and using HTTP to instances would leave the traffic between ALB and instances unencrypted.

1076
Multi-Selecteasy

A DevOps engineer wants to monitor the health of an Auto Scaling group and receive notifications when instances are launched or terminated. Which TWO AWS services can be used together to achieve this?

Select 2 answers
A.AWS CloudTrail.
B.AWS Config.
C.Amazon EventBridge.
D.Amazon SNS.
E.AWS Lambda.
AnswersC, D

Amazon EventBridge is a serverless event bus that can natively consume Auto Scaling group state changes such as EC2 instance launch, terminate, and lifecycle hook notifications. Using event patterns that filter on the aws.autoscaling source and detail types like EC2 Instance Launch Successful, EventBridge matches relevant events in near real time and routes them to targets such as SNS topics for email/SMS alerts. It is the correct service because it provides built-in event ingestion, filtering, and routing without requiring custom code or external monitoring agents, making it ideal for health and lifecycle monitoring.

Why this answer

The correct answers are C (Amazon EventBridge) and D (Amazon SNS). Amazon EventBridge can capture Auto Scaling lifecycle events (such as instance launch and termination) and route them to Amazon SNS, which sends notifications (e.g., email or SMS). AWS CloudTrail (A) logs API calls but does not trigger real-time notifications.

AWS Config (B) records configuration changes but is not designed for event-driven notifications. AWS Lambda (E) could be used as a target, but it is not required because EventBridge can directly invoke SNS.

1077
MCQeasy

A company uses AWS Secrets Manager to store database credentials. The security team wants to automatically rotate secrets every 30 days. The database is an Amazon RDS for PostgreSQL instance. The team has configured automatic rotation with a Lambda function that updates the password in RDS and Secrets Manager. However, after the first rotation, the application starts getting database connection errors. The application uses a connection string with the secret ARN and retrieves the secret from Secrets Manager at startup using the AWS SDK. Which of the following is the most likely cause of the connection errors?

A.The Lambda function is not configured with a sufficient timeout and is being throttled.
B.The application caches the secret at startup and does not refresh it after rotation.
C.The Lambda function does not have permission to update the secret in Secrets Manager.
D.The RDS instance has automatic password rotation enabled, which conflicts with Secrets Manager rotation.
AnswerB

Caching the secret prevents the application from using the new password.

Why this answer

If the application caches the secret at startup, it will not retrieve the updated password after rotation, causing connection errors. Option A is incorrect because a Lambda timeout or throttling would prevent the rotation from completing, but the rotation succeeded (new password set), so the issue is on the application side. Option C is incorrect because if the Lambda lacked permissions to update the secret, the rotation would have failed entirely, not just after the first rotation.

Option D is incorrect because Amazon RDS does not have built-in automatic password rotation; Secrets Manager manages the rotation, so there is no conflict.

1078
MCQhard

A company runs a web application on EC2 instances behind an Application Load Balancer. They use Amazon CloudFront for content delivery. The DevOps team notices that some requests are returning HTTP 503 errors intermittently. After checking the CloudFront and ALB logs, they find that the errors originate from the ALB. What is the most likely cause?

A.The SSL certificate on the ALB is expired.
B.The security group for the ALB is blocking traffic from CloudFront.
C.CloudFront is configured to forward an HTTP method that the ALB does not support.
D.The ALB is experiencing a surge in traffic and is scaling up, but during the scaling activity, some requests are rejected.
AnswerD

An ALB returns 503 Service Unavailable when it cannot handle incoming requests due to scaling activity or when all targets are unhealthy. During a traffic surge, the ALB nodes scale up by provisioning additional capacity, and during this scaling activity the ALB may temporarily reject or fail to accept new requests, causing clients to receive 503 responses. This matches the scenario described, making it the correct explanation for the issue.

Why this answer

When an Application Load Balancer (ALB) experiences a sudden surge in traffic that exceeds its current capacity, it may temporarily reject requests with HTTP 503 errors while it scales up. During the scaling activity, the ALB's target group might not have enough healthy registered targets to handle the load, causing the ALB to return 503 responses until new instances are provisioned and pass health checks. This matches the intermittent nature of the errors described in the scenario.

Exam trap

The trap here is that candidates often confuse 503 errors with SSL certificate issues or security group misconfigurations, but the intermittent nature of the errors and the fact that they originate from the ALB (not CloudFront) points directly to capacity scaling limitations rather than configuration errors.

How to eliminate wrong answers

Option A is wrong because an expired SSL certificate on the ALB would cause SSL/TLS handshake failures (e.g., ERR_CERT_DATE_INVALID) and result in 502 Bad Gateway errors from CloudFront, not 503 errors from the ALB. Option B is wrong because if the security group for the ALB were blocking traffic from CloudFront, the ALB would not receive the requests at all, and CloudFront would return 502 errors (or connection timeouts) instead of the ALB returning 503 errors. Option C is wrong because CloudFront forwarding an unsupported HTTP method would cause the ALB to return a 405 Method Not Allowed error, not a 503 Service Unavailable error.

1079
MCQmedium

A Lambda function processes SQS messages but sometimes times out after 15 seconds. The function performs a database call that occasionally takes longer. What is the best way to handle this without losing messages?

A.Decrease the SQS visibility timeout to retry faster.
B.Split the batch into smaller batches using partial batch response.
C.Increase the Lambda timeout and increase the SQS visibility timeout, and add a dead-letter queue.
D.Reduce the Lambda reserved concurrency to limit invocations.
AnswerC

The correct remediation is to first raise the Lambda timeout to a value that comfortably covers the actual processing duration for a batch, then set the SQS visibility timeout to at least that same timeout so the queue does not redeliver a message while the function is still processing it. Adding a dead-letter queue to the source SQS provides a safety net: after the configured retries (maxReceiveCount), messages that still fail are diverted to the DLQ, preserving them for analysis instead of silently expiring. This combination directly resolves the timeout issue and handles residual failures cleanly.

Why this answer

Increasing the Lambda timeout allows the function more time to complete the database call, increasing the SQS visibility timeout prevents messages from becoming visible before the function finishes, and adding a dead-letter queue captures messages that still fail after all retries. Option A is wrong because decreasing the visibility timeout would cause messages to reappear sooner, potentially leading to duplicate processing or loss. Option B is wrong because splitting the batch does not address the timeout issue; partial batch response is for handling partial failures within a batch, not for timeout extension.

Option D is wrong because reducing reserved concurrency would limit the number of concurrent executions but does not prevent timeouts; it might cause more throttling.

1080
Multi-Selecteasy

A company is designing a CI/CD pipeline for a serverless application using AWS CodePipeline. Which TWO actions are valid ways to deploy an AWS Lambda function?

Select 2 answers
A.Use AWS CloudFormation to update the Lambda function's stack.
B.Use Amazon S3 to trigger the Lambda function deployment.
C.Use AWS CodeBuild to directly deploy the Lambda function.
D.Use AWS CodeCommit to push the Lambda code.
E.Use AWS CodeDeploy to deploy the Lambda function with traffic shifting.
AnswersA, E

CloudFormation is an infrastructure-as-code service that declares the entire serverless application stack, including the Lambda function, IAM role, event source mappings, and environment variables. Updating the stack applies code and configuration changes in a deterministic order and supports rollback on failure, making it a valid CI/CD deployment step. It treats the Lambda function as a managed resource, and can be invoked via CodePipeline or directly. This is a correct approach because it ensures drift-free, auditable releases.

Why this answer

AWS CloudFormation can manage Lambda function deployments as part of a stack update. By defining the Lambda function resource in a CloudFormation template, CodePipeline can trigger a stack update that creates or updates the function, ensuring infrastructure-as-code best practices and consistent deployments.

Exam trap

The trap here is that candidates often confuse build or source control actions (CodeBuild, CodeCommit) with deployment actions, or mistake event-driven invocations (S3 triggers) for deployment mechanisms, leading them to select options that are valid for other purposes but not for deploying Lambda functions.

1081
MCQeasy

A company runs a web application on EC2 instances behind an ALB. To improve resilience, they want to automatically replace failed instances and maintain a minimum number of instances. Which AWS service should be used?

A.Amazon EC2 Auto Scaling
B.AWS CloudFormation
C.AWS Elastic Beanstalk
D.AWS Systems Manager
AnswerA

Amazon EC2 Auto Scaling is the service that continuously monitors the health of EC2 instances using EC2 status checks and, when configured, Elastic Load Balancing health checks. If an instance fails these checks, Auto Scaling automatically terminates it and launches a replacement instance to maintain the desired or minimum fleet size. This health-based replacement is an inherent capability of an Auto Scaling group, making it the correct answer for automatically replacing unhealthy instances.

Why this answer

Auto Scaling is designed to automatically replace failed instances and maintain a desired capacity, improving resilience.

1082
MCQmedium

A development team is using AWS CodeCommit as a source repository and AWS CodePipeline to automate their CI/CD pipeline. The pipeline includes a build stage that runs on AWS CodeBuild. The team wants to automatically trigger the pipeline when changes are pushed to the 'develop' branch of the CodeCommit repository. Which configuration change should be made to the pipeline?

A.Enable S3 event notifications on the repository to invoke the pipeline.
B.Add a manual approval action before the build stage.
C.Configure the source action to use CodeCommit as the source provider and specify the 'develop' branch.
D.Create a CodeBuild webhook on the CodeCommit repository.
AnswerC

Configuring the source action with CodeCommit as the source provider and specifying the 'develop' branch is exactly how CodePipeline implements automatic change detection for a CodeCommit repository. The action references the repository and branch; on each update to that branch, CodePipeline uses an automatically managed CloudWatch Events rule (or event polling) to trigger a new pipeline execution. This is the recommended native integration, and it ensures every commit to the 'develop' branch starts the pipeline without custom webhooks or manual steps.

Why this answer

CodePipeline's source action can be configured to use CodeCommit as the source provider, and by specifying the 'develop' branch in the source action configuration, the pipeline will automatically start a new execution whenever a change is pushed to that branch. This is the native and recommended way to trigger a pipeline from a CodeCommit repository branch change, without needing additional webhooks or event notifications.

Exam trap

The trap here is that candidates often confuse CodeBuild webhooks (which trigger a build directly) with CodePipeline's native event-driven triggers, leading them to select Option D, even though CodePipeline does not use webhooks for CodeCommit sources.

How to eliminate wrong answers

Option A is wrong because S3 event notifications are not applicable to CodeCommit repositories; CodeCommit uses Git events, not S3 bucket events, and CodePipeline integrates directly with CodeCommit via its source action, not through S3 notifications. Option B is wrong because adding a manual approval action before the build stage would block the pipeline from automatically triggering; it would require manual intervention to proceed, defeating the purpose of automatic triggering on branch pushes. Option D is wrong because CodeBuild webhooks are used to trigger a CodeBuild project directly from a repository, not to trigger a CodePipeline; CodePipeline manages its own polling or event-based triggers for CodeCommit, and creating a separate webhook on CodeCommit would be redundant and not integrated with the pipeline's execution.

1083
MCQmedium

A company uses AWS CodePipeline with a multi-branch strategy. The pipeline deploys a Lambda function using CloudFormation. The DevOps engineer notices that when a new branch is created, the pipeline executes but the CloudFormation stack fails because the stack name already exists. What is the MOST efficient way to resolve this issue?

A.Modify the pipeline to use a dynamic stack name parameter, such as the branch name.
B.Hardcode a different stack name for each branch in the pipeline.
C.Delete the existing stack before each deployment.
D.Use the CloudFormation 'Override' parameter to reuse the same stack.
AnswerA

Using a dynamic stack name parameter, such as inserting the branch name into the stack name (e.g., `MyApp-${Branch}`), lets each branch deploy to a unique CloudFormation stack. This isolation prevents resource name collisions when multiple branches are deployed concurrently, supports per-branch rollback and lifecycle management, and eliminates the need to manually reconfigure the pipeline when a new branch is created.

Why this answer

Using a dynamic stack name parameter, such as the branch name, ensures each branch creates a unique CloudFormation stack. This avoids naming conflicts while allowing independent infrastructure per branch. In CodePipeline, you can pass the branch name as a variable (e.g., #{SourceVariables.BranchName}) to the CloudFormation deploy action, making the stack name unique without manual intervention.

Exam trap

The trap here is that candidates may think hardcoding stack names per branch (Option B) is acceptable, but they overlook the operational overhead and lack of automation; AWS expects you to use dynamic parameters to handle multi-branch pipelines efficiently.

How to eliminate wrong answers

Option B is wrong because hardcoding a different stack name for each branch is not scalable or maintainable; it requires manual updates every time a new branch is created, defeating the purpose of a multi-branch pipeline. Option C is wrong because deleting the existing stack before each deployment would destroy the production or main branch stack, causing downtime and loss of stateful resources; it also violates the principle of isolated environments per branch. Option D is wrong because CloudFormation does not have an 'Override' parameter to reuse the same stack; the stack name must be unique within an account and region, and reusing it would still cause a conflict if the stack already exists.

1084
MCQeasy

A developer is using AWS CodeBuild to compile code. The build takes a long time because dependencies are downloaded each time. What can the developer do to reduce build time?

A.Split the build into multiple parallel build actions.
B.Use multiple build environments to distribute the work.
C.Enable caching in the build project to store dependencies in Amazon S3.
D.Use a larger compute type for the build project.
AnswerC

Enabling S3 caching in a CodeBuild project stores the dependency cache (e.g., Maven's .m2, npm's node_modules, or Python's pip cache) in an Amazon S3 bucket between builds, so the build only downloads changed or missing packages instead of re-fetching the full dependency set each time. This directly reduces the time spent on network I/O, which is often the dominant cost for builds with many third-party libraries. By setting the 'cache' type to S3 and specifying a bucket, subsequent builds restore the cache at the start, making the compilation faster. This is the recommended approach because it targets the common bottleneck of dependency resolution.

Why this answer

Enabling caching in AWS CodeBuild allows the build project to store frequently downloaded dependencies (e.g., Maven, npm, pip packages) in an Amazon S3 bucket. On subsequent builds, CodeBuild retrieves the cached dependencies from S3 instead of re-downloading them from the internet, which significantly reduces build time. This is the most direct and efficient solution for the described problem of repeated dependency downloads.

Exam trap

The trap here is that candidates often confuse scaling compute resources (Option D) or parallelizing work (Option A) with solving a network-bound dependency download problem, failing to recognize that caching is the only option that directly eliminates redundant downloads.

How to eliminate wrong answers

Option A is wrong because splitting the build into multiple parallel build actions does not address the root cause of repeated dependency downloads; it only parallelizes independent build steps, which may reduce overall wall-clock time but does not eliminate the redundant download overhead. Option B is wrong because using multiple build environments distributes the work across different compute instances but does not cache dependencies; each environment would still download dependencies from scratch, so the total download time remains unchanged. Option D is wrong because using a larger compute type (e.g., more CPU/memory) may speed up the build process itself but does not prevent the repeated download of dependencies; the network-bound download step remains a bottleneck regardless of compute size.

1085
MCQeasy

A DevOps engineer is designing a CI/CD pipeline for a microservices application. The team wants to ensure that infrastructure changes are reviewed and approved before deployment. The code is stored in AWS CodeCommit, and the pipeline uses AWS CodePipeline and AWS CloudFormation. What is the BEST way to implement an approval process for infrastructure changes?

A.Use CodeCommit approval rules to require a pull request before any change is merged.
B.Configure IAM policies to require MFA before any CloudFormation stack update.
C.Use CodeBuild to run a script that sends an approval request via Amazon SNS and waits for a response.
D.Add a manual approval step in CodePipeline between the build and deploy stages.
AnswerD

A manual approval action in CodePipeline is a first-class, natively integrated gate that pauses the pipeline execution at a defined stage boundary (e.g., after build, before deploy). When the action runs, CodePipeline sends an SNS notification to the designated approver topic, and the execution remains in a Waiting state until an authorized user explicitly approves or rejects it via the console, CLI, or SDK. This is the intended AWS pattern for a human review gate because it is fully managed, has no custom polling logic, and automatically resumes the pipeline only upon approval — making it superior to any ad-hoc script or external approval mechanism.

Why this answer

AWS CodePipeline supports a manual approval action that can be added between stages (e.g., between build and deploy) to require human approval before proceeding. This allows the team to review infrastructure changes before deployment. Option A is incorrect because CodeCommit approval rules apply to pull requests for code changes, not to pipeline executions or infrastructure deployments.

Option B is incorrect because IAM policies requiring MFA control who can update stacks, but do not create an approval gate; they enforce authentication, not approval workflows. Option C is incorrect because while you could use a custom CodeBuild action to send an SNS message and wait, this is not the best approach; CodePipeline natively provides manual approval steps, which are simpler and more appropriate.

1086
MCQmedium

A DevOps engineer runs the command shown in the exhibit to view stack events. The stack update failed. What is the most likely cause of the failure?

A.The IAM role for the Lambda function is missing required permissions.
B.The Lambda function specifies a runtime that is not available in the region.
C.The Lambda function code exceeds the maximum size limit.
D.The S3 bucket containing the template is not accessible.
AnswerB

The stack update failed because the Lambda function specifies a runtime that is not available in the region. AWS Lambda runtimes are region-specific; some runtimes may not be supported in all regions, causing a validation error when CloudFormation attempts to create or update the function.

Why this answer

The stack update failed because the Lambda function specifies a runtime that is not available in the region. AWS Lambda runtimes are region-specific; some runtimes (e.g., deprecated or newly introduced ones) may not be supported in all regions. When CloudFormation attempts to create or update a Lambda function with an unsupported runtime, it returns a validation error, causing the stack operation to fail.

Exam trap

The trap here is that candidates often assume all Lambda runtimes are globally available, but AWS regions can have different runtime support timelines, especially for new or deprecated runtimes, leading to a stack update failure that is not about permissions, size, or template access.

How to eliminate wrong answers

Option A is wrong because missing IAM permissions for the Lambda function would cause a different error (e.g., access denied when invoking the function or accessing resources), not a runtime validation failure during stack update. Option C is wrong because exceeding the Lambda function code size limit (250 MB unzipped, including layers) would produce a specific error about deployment package size, not a runtime-related error. Option D is wrong because if the S3 bucket containing the template were inaccessible, the stack update would fail earlier with an S3 access error (e.g., 403 Forbidden) before reaching the Lambda resource creation stage.

1087
Multi-Selectmedium

A company runs a stateful web application on EC2 instances behind an ALB. The application stores session data in memory. The company wants to make the application stateless to improve resilience. Which TWO changes should the company make?

Select 2 answers
A.Increase the instance memory to store more sessions
B.Disable sticky sessions on the ALB
C.Enable sticky sessions (session affinity) on the ALB
D.Store session data in Amazon ElastiCache for Redis
E.Use an NLB instead of an ALB
AnswersB, D

Disabling sticky sessions on the ALB is a necessary precondition for a horizontally scalable, fault-tolerant design. With stickiness off, the ALB can route any request to any healthy target, so if an instance fails, the next request can be served by a different instance — assuming the session state is stored externally (for example, in ElastiCache or DynamoDB). This makes the application effectively stateless at the instance level, which also allows Auto Scaling to add or remove instances without worrying about breaking client sessions on a particular host.

Why this answer

To make the application stateless, the company should disable sticky sessions on the ALB (option B) and store session data in Amazon ElastiCache for Redis (option D). Disabling sticky sessions ensures that requests can be routed to any instance, and storing session data externally removes the dependency on in-memory state on individual instances, improving resilience. Option A is incorrect because increasing instance memory does not solve the statefulness issue.

Option C is incorrect because enabling sticky sessions would maintain state on instances. Option E is incorrect because using an NLB does not address session state management.

1088
MCQmedium

A company has deployed a containerized application on Amazon ECS with Fargate. The application is fronted by an Application Load Balancer (ALB). The DevOps team is using CloudWatch Container Insights to monitor the ECS cluster. They notice that the 'MemoryUtilized' metric for the service is consistently above 80%, and the 'CPUUtilized' is around 50%. The ALB's 'TargetResponseTime' is increasing over time. The team wants to resolve the performance issue. Which action should the team take?

A.Increase the memory limit for the ECS task definition to allow the container to use more memory.
B.Increase the CPU limit for the ECS task definition to improve performance.
C.Increase the number of ALB targets by adding more availability zones.
D.Increase the desired count of the ECS service to distribute the load across more tasks.
AnswerA

The ECS task definition's memory limit is a hard limit enforced by Docker; when the container's memory utilization consistently exceeds 80%, it is likely approaching or hitting that ceiling, leading to OOM kills or severe performance degradation. Increasing the memory limit lets the container allocate more heap or working set, directly relieving the memory bottleneck. This is a vertical scaling action, and you must also ensure the EC2 instance has enough free memory to support the increased limit.

Why this answer

The high memory utilization (above 80%) is likely causing performance degradation due to memory pressure. Increasing the memory limit for the ECS task definition allows the container to use more memory, which can reduce swapping and improve response times. Option B (increase CPU) is not the best action because CPU utilization is only 50%, so CPU is not the bottleneck.

Option C (increase ALB targets) does not address the container's memory constraints. Option D (increase desired count) may distribute load but each task is still memory-constrained; fixing the memory limit is more direct.

1089
MCQhard

A company's application on Amazon ECS experiences intermittent failures when the task attempts to access an S3 bucket. The task role has the correct S3 permissions. What is the most likely cause?

A.The task is using the wrong IAM role
B.The S3 bucket is in a different region
C.The S3 bucket has public access blocked
D.The S3 bucket policy explicitly denies access from the task's VPC
AnswerD

When an S3 bucket policy explicitly denies s3:GetObject for a condition like aws:SourceVpc, that explicit deny overrides any grant provided by IAM policies. Because the ECS task's traffic originates from inside a VPC, the deny condition matches and S3 returns AccessDenied despite the role having correct permissions. This is a classic case where a correct IAM role is not enough, and bucket policy deny statements must be reviewed for VPC conditions.

Why this answer

If the S3 bucket policy denies access from the task's VPC or source, it can cause intermittent failures.

1090
MCQhard

Refer to the exhibit. Why does the build fail?

A.The CodeBuild role does not have permission to create CloudFront invalidations.
B.The S3 bucket policy denies write access to the CodeBuild role.
C.The CodeBuild project is not associated with the correct service role.
D.The CloudFront distribution ID is incorrect.
AnswerA

The error message in the build log explicitly returns AccessDenied for the CreateInvalidation action, which means the IAM role assumed by CodeBuild does not include a statement allowing cloudfront:CreateInvalidation on the target distribution. Even though the role is correctly associated and used, it lacks this specific identity-based permission, so the aws cloudfront create-invalidation API call fails. This is an IAM policy gap, not a misconfiguration of the project or the distribution.

Why this answer

The CodeBuild role lacks the cloudfront:CreateInvalidation permission. The error message clearly indicates AccessDenied for that action.

1091
MCQmedium

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

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

Adding an Amazon Inspector scan action as a test stage in CodePipeline is correct because Inspector is natively integrated as a pipeline action that can scan application artifacts such as container images and Lambda functions for software vulnerabilities and unintended network exposure. The action can be configured to fail the pipeline if findings meet a defined severity threshold, providing an automated, shift-left security gate that runs during the deployment process itself rather than after resources are live.

Why this answer

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

Trusted Advisor provides best practice checks, not vulnerability scanning.

1092
MCQhard

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

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

The ECS deployment circuit breaker is a native ECS feature that continuously monitors the health of a service deployment by watching for failed health checks, crashes, or task startup failures. If it detects that the new version is unhealthy, it automatically cancels the deployment and rolls back the service to the previous stable revision, without manual intervention. This makes it the only option that directly addresses deployment failures as part of the ECS service update path.

Why this answer

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

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

1093
Multi-Selecthard

Which THREE considerations are important when designing a CI/CD pipeline for a microservices architecture using AWS CodePipeline? (Choose three.)

Select 3 answers
A.All microservices should be deployed using a single pipeline to ensure consistency.
B.Include automated integration tests that validate service-to-service interactions.
C.Use manual approval gates at every stage to ensure quality.
D.Each microservice should have its own pipeline to enable independent deployment.
E.Implement blue/green deployments to reduce downtime and allow quick rollback.
AnswersB, D, E

Automated integration tests that exercise real interactions between services (for example, using contract tests or a dedicated test environment) catch API mismatches, schema changes, and network configuration errors before production. By running these tests early in the CI/CD pipeline, you shift left defect detection, reduce the cost of fixes, and increase confidence that independently deployed services will interoperate correctly.

Why this answer

In a microservices architecture, automated integration tests are essential to validate that service-to-service interactions (e.g., API calls, event-driven communication) work correctly after changes. AWS CodePipeline can run these tests in a dedicated stage using AWS CodeBuild or third-party tools, catching integration failures before deployment to production.

Exam trap

The trap here is that candidates often confuse consistency (Option A) with the need for independent pipelines, or overestimate the value of manual approvals (Option C) in a CI/CD context, failing to recognize that microservices thrive on autonomy and automation.

1094
MCQeasy

A DevOps team receives a CloudWatch alarm that an RDS DB instance's CPU utilization has exceeded 90% for 5 minutes. The application is experiencing latency. What is the best immediate step to mitigate the issue?

A.Analyze slow query logs and optimize queries.
B.Enable Multi-AZ deployment for failover.
C.Modify the RDS instance to a larger instance class.
D.Add a read replica to offload read traffic.
AnswerC

Modifying the RDS instance to a larger instance class is the correct immediate response because it directly adds vCPU, memory, and often dedicated EBS bandwidth to handle the current workload. Amazon RDS supports scaling instance classes with minimal downtime, especially for Multi-AZ deployments where a failover masks the restart. This scale-up action provides the compute headroom needed to bring CPU utilization back to acceptable levels and is the standard first step when a CPU alarm indicates that the instance is simply undersized for the traffic.

Why this answer

When an RDS instance's CPU utilization exceeds 90% for 5 minutes and the application is experiencing latency, the immediate step is to scale up the instance to a larger class to provide more CPU capacity. This directly addresses the resource bottleneck without requiring time-consuming analysis or architectural changes, making it the fastest mitigation for an ongoing incident.

Exam trap

The trap here is that candidates often confuse reactive scaling (immediate mitigation) with proactive optimization or architectural changes, leading them to choose slow query analysis or read replicas, which are valid but not immediate fixes for a CPU bottleneck.

How to eliminate wrong answers

Option A is wrong because analyzing slow query logs and optimizing queries is a long-term corrective action, not an immediate mitigation step during an active incident where latency is already occurring. Option B is wrong because enabling Multi-AZ deployment provides high availability and automatic failover, but does not increase CPU capacity or resolve performance issues caused by high utilization. Option D is wrong because adding a read replica offloads read traffic but does not reduce CPU utilization on the primary instance, which is the source of the latency.

1095
MCQeasy

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

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

Enabling S3 Versioning is the correct first-line protection because it retains every version of an object, including the original, whenever an overwrite (PUT) or delete (DELETE) occurs. With versioning, an overwritten object's previous version is preserved as a non-current version, and a DELETE action only inserts a deletemarker, leaving all prior versions intact. You can recover accidental changes by simply fetching a previous version, making it the foundational mechanism that enables other features like lifecycle rules, MFA Delete, and point-in-time restores.

Why this answer

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

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

1096
MCQeasy

A DevOps team is using AWS CloudFormation to manage infrastructure. They need to ensure that stack updates are reviewed and approved by a senior engineer before being executed. Which feature should they implement?

A.Stack policies
B.Drift detection
C.Change sets
D.Stack sets
AnswerC

Change sets provide an itemized, read-only prediction of the exact modifications CloudFormation will apply to a stack when an updated template or parameter set is executed, listing each resource as being added, removed, or replaced without actually altering the stack. They are generated by calling CreateChangeSet, allowing the team to inspect the impact in a CI/CD pipeline and then explicitly execute the change set only after human approval. This makes change sets the correct mechanism for implementing a controlled pre-update review and approval workflow.

Why this answer

Change sets allow you to preview the proposed changes to a CloudFormation stack before executing them. This enables a senior engineer to review and approve the changes, ensuring that only validated updates are applied. Without change sets, updates would be applied immediately without a review step.

Exam trap

The trap here is that candidates may confuse change sets with stack policies, assuming both control updates, but stack policies only protect specific resources from modification, not the update approval process itself.

How to eliminate wrong answers

Option A is wrong because stack policies are used to prevent specific stack resources from being updated or deleted during a stack update, not to enforce a review-and-approval workflow. Option B is wrong because drift detection identifies whether a stack's actual resources have diverged from the template, but it does not control or review update execution. Option D is wrong because stack sets allow you to deploy stacks across multiple accounts and regions, but they do not provide a mechanism for reviewing and approving individual stack updates.

1097
Multi-Selectmedium

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

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

After Systems Manager applies OS patches to a managed instance, you must capture that patched state into a new Amazon Machine Image. Because launch configurations are immutable, you cannot edit the existing launch configuration's AMI ID; you must create a new launch configuration that references the patched AMI so any instance launched from it starts with the verified, patched baseline.

Why this answer

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

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

1098
MCQeasy

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

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

Changing environment properties in the Elastic Beanstalk console is the standard configuration-management action for existing environments. Elastic Beanstalk treats property updates as a configuration change, not an application-version deployment, so it applies them through a rolling update that replaces instances in batches while continuously serving traffic. The platform automatically orchestrates health checks between batches, so there is no downtime and no need to rebuild the environment or upload a new artifact.

Why this answer

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

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

1099
MCQeasy

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

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

With a 5-minute period, 3 evaluation periods, and 3 datapoints to alarm, the alarm enters ALARM state only when every one of the three most recent 5-minute data points breaches the threshold. This means the metric must be continuously in breach for 15 minutes, filtering out transient spikes and providing a reliable signal of a sustained problem. It is the appropriate setting for production alarms that should page responders only after a consistent degradation.

Why this answer

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

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

1100
MCQmedium

A company uses AWS CodeDeploy for blue/green deployments to an Auto Scaling group. The deployment fails because the new instances do not pass health checks. The DevOps engineer discovers that the health check URL returns a 503 error. What is the MOST likely cause?

A.The target group health check path is '/health' but the application does not serve that endpoint
B.The CodeDeploy agent on the new instances is not running
C.The security group for the ALB does not allow inbound traffic on port 80
D.The Auto Scaling group health check type is set to EC2 instead of ELB
AnswerA

A 503 response from the ALB health check means the target instance accepted the TCP connection and returned an HTTP response, but the response status code was not a success (2xx/3xx). If the health check path is '/health' and the application does not define that route, the web server returns a 503 error because no handler matches the request. To resolve this, the health check path must be changed to an existing endpoint or the application must implement an endpoint that returns 200 OK on '/health'.

Why this answer

The health check URL returning a 503 error indicates that the application is not responding to the health check endpoint. Since the target group health check path is configured as '/health' but the application does not serve that endpoint, the ALB considers the instances unhealthy, causing CodeDeploy to fail the deployment. This is the most direct cause because the health check is failing at the application layer, not due to infrastructure issues.

Exam trap

The trap here is that candidates may confuse a 503 error with a network-level failure (like a security group blocking traffic) rather than recognizing it as an application-layer response indicating the health check endpoint is missing or misconfigured.

How to eliminate wrong answers

Option B is wrong because if the CodeDeploy agent were not running, the deployment would likely fail earlier (e.g., during the Install event) or the agent would not report success, but the health check failure (503) specifically indicates the application is running but not responding correctly. Option C is wrong because if the security group for the ALB did not allow inbound traffic on port 80, the health check would likely time out or return a connection refused error, not a 503 (Service Unavailable) which is an HTTP response from the application. Option D is wrong because the Auto Scaling group health check type (EC2 vs ELB) affects how ASG replaces unhealthy instances, but it does not directly cause the health check URL to return a 503; the 503 error is a symptom of the application not serving the correct endpoint.

1101
MCQmedium

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

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

KMS key policies are resource-based policies attached directly to the customer master key, and they are evaluated for every KMS API action against that key. The policy can include a Condition block that references SAML-derived session attributes, such as a session tag mapped from an attribute in the SAML assertion, to allow kms:Decrypt only when the expected attribute value is present. This is the correct approach because it centralizes the decryption restriction at the key resource itself, ensuring that any principal attempting to use the key must satisfy the condition regardless of their IAM permissions.

Why this answer

KMS key policies are resource-based policies that can use IAM condition keys. To enforce a requirement based on a SAML assertion, you must first configure the IAM role's trust policy to map the SAML attribute to a session tag using sts:TagSession. Then, the KMS key policy can include a condition such as aws:PrincipalTag/attribute_name to allow kms:Decrypt only when that session tag matches the expected value.

This ensures compliance at the key level, independent of S3 bucket policies. Note that saml:sub and other SAML condition keys are not supported in KMS key policies; they are only valid in IAM trust policies.

Exam trap

A common mistake is to think that S3 bucket policies can control KMS decryption or that KMS key policies can directly inspect SAML assertions. KMS key policies only see the principal (the IAM role or user) and its attributes/tags. To enforce a SAML attribute, you must first map it to a session tag in the role trust policy, then condition on that tag in the KMS key policy.

How to eliminate wrong answers

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

1102
Multi-Selecthard

Which THREE actions should a DevOps engineer take to ensure that AWS CloudFormation stacks are securely managed? (Choose three.)

Select 3 answers
A.Set a DeletionPolicy on the stack to retain resources when the stack is deleted.
B.Use a service role with least privilege when creating the stack.
C.Use IAM policies to restrict CloudFormation actions to specific users and roles.
D.Define a StackSetPolicy to control permissions across accounts.
E.Apply a stack policy to prevent updates to sensitive resources during stack updates.
AnswersB, C, E

A service role is an IAM role that CloudFormation assumes to make API calls on your behalf when creating, updating, or deleting stacks. By specifying a service role with least privilege, you ensure CloudFormation only has the permissions required to provision the intended resources, limiting the impact if a resource definition is malicious or misconfigured. This also enables separation of duties because users can create stacks without holding direct resource permissions, and all actions are attributed to the service role.

Why this answer

Using a service role with least privilege ensures that CloudFormation operates with only the permissions necessary to create, update, and delete resources, rather than inheriting the user's broader permissions. This decouples the user's IAM permissions from the stack's runtime actions, reducing the risk of privilege escalation and unintended resource modifications.

Exam trap

The trap here is that candidates confuse DeletionPolicy (a resource retention setting) with a security control, or they invent a 'StackSetPolicy' option that sounds plausible but does not exist in AWS, leading them to select incorrect answers that seem security-related but are technically invalid.

1103
MCQmedium

A company uses AWS WAF to protect a web application behind an Application Load Balancer. The security team notices an increase in false positives blocking legitimate traffic. Which action should be taken to reduce false positives while maintaining security?

A.Remove the rate-based rule that is causing false positives.
B.Replace AWS WAF with AWS Shield Advanced.
C.Adjust the rate-based rule threshold to a higher value.
D.Change the rule action from 'Block' to 'Count'.
AnswerC

Increasing the rate-based rule's threshold is the appropriate response because the rule currently flags legitimate traffic when it should only block genuinely anomalous request floods. AWS WAF rate-based rules count requests that match a rule's conditions from a single source IP over a 1- or 5-minute evaluation window; if your legitimate users share an office IP or traverse a NAT gateway, their aggregate requests can exceed a threshold set too close to peak traffic. By raising the threshold above your historical maximum legitimate request volume per IP, you preserve protection against distributed or bot-driven floods while eliminating false positives from normal usage spikes.

Why this answer

Adjusting the rate-based rule threshold to a higher value allows more legitimate traffic while still blocking excessive requests. Option A: Removing the rule would weaken security. Option B: AWS Shield Advanced is a DDoS protection service, not a replacement for fine-tuning WAF rules.

Option D: Changing action to 'Count' logs requests but does not block them, reducing security.

Exam trap

Candidates often think that changing rule action to 'Count' is a good compromise, but it only logs and does not block, thus reducing security. The correct approach is to adjust the threshold.

1104
MCQmedium

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

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

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

Why this answer

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

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

1105
Multi-Selectmedium

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

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

Reviewing the canary's CloudWatch Logs is the correct first step because each canary run emits a dedicated log stream containing step-by-step execution details, error and stack traces, HTTP response bodies, and console output from the canary script. Since the canary has already failed, these logs are the definitive source for pinpointing the root cause—whether it's an assertion failure, a timeout, an invalid response, or an unexpected HTTP status.

Why this answer

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

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

1106
Matchingmedium

Match each AWS CloudFormation concept to its description.

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

Concepts
Matches

Collection of AWS resources managed as a single unit

JSON or YAML document describing AWS resources

Preview of changes before applying to a stack

Enables stack creation across multiple accounts and regions

Identifies differences between stack and actual resource configurations

Why these pairings

Change Set previews stack changes; Stack is a resource collection; Stack Set manages stacks across accounts; Template is a JSON/YAML description.

1107
MCQhard

Which AWS service is a fully managed source control service?

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

AWS CodeCommit is a fully managed source-control service that hosts private Git repositories, supporting branches, commits, pull requests, and merge operations with IAM-based access control. It matches the description of a source-control service because it is the central repository where developers store, version, and collaborate on code. Its native Git compatibility and tight AWS integration enable seamless use with other DevOps services, but its core identity is version control, not building or deploying.

Why this answer

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

Exam trap

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

1108
Multi-Selecteasy

A DevOps engineer is tasked with auditing all AWS API calls made in the account for compliance purposes. The engineer needs to ensure that the audit logs are tamper-proof and stored cost-effectively. Which TWO services should the engineer use?

Select 2 answers
A.AWS Config
B.AWS CloudTrail
C.Amazon S3 with Object Lock enabled
D.Amazon CloudWatch Logs
E.AWS KMS
AnswersB, C

AWS CloudTrail is the principal service that logs all management, data, and insight API calls across an AWS account, capturing identity, request context, and response details. It is correct for this scenario because you need API-call logging, but to make the resulting log files truly tamper-proof you must configure CloudTrail to deliver them to an S3 bucket with Object Lock enabled. CloudTrail also supports log file integrity validation, yet that only detects tampering, whereas Object Lock prevents it.

Why this answer

AWS CloudTrail (Option B) is the service that records all API calls made in an AWS account, providing an audit trail. To ensure these logs are tamper-proof and stored cost-effectively, Amazon S3 with Object Lock enabled (Option C) is used. Object Lock prevents logs from being deleted or overwritten, meeting compliance requirements.

Option A (AWS Config) records resource configuration changes, not API calls. Option D (Amazon CloudWatch Logs) is for application and system logs, not AWS API call logs. Option E (AWS KMS) manages encryption keys but does not provide tamper-proof storage for logs.

1109
Multi-Selecthard

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

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

Using a customer-managed KMS key with a cross-account key policy is correct because CodePipeline stores build artifacts in S3, which must be encrypted. By default, AWS-managed keys are scoped to a single account, so to share artifacts with a target account you must use a customer-managed key and explicitly grant the target account's principals decrypt permission via a cross-account key policy. This provides secure, auditable cross-account artifact transfer without exposing the key material, and it lets you enforce encryption at rest with full control over key rotation and access.

Why this answer

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

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

1110
Multi-Selecthard

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

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

Conditional writes enable optimistic concurrency by allowing the application to assert a precondition—such as an item version or updated timestamp—before the write commits. If the condition evaluates to false because another concurrent write modified the item, DynamoDB rejects the request without overwriting, forcing the application to re-read and retry. This prevents silent data loss from last-writer-wins and is the appropriate DynamoDB-native way to enforce a safe update workflow in a multi-region setup.

Why this answer

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

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

1111
MCQmedium

A DevOps team is designing a CI/CD pipeline for a microservices application. Each microservice has its own CodeCommit repository and must be built and deployed independently. The team wants to minimize manual configuration and ensure that adding a new microservice automatically creates the corresponding pipeline stages. Which approach should the team use?

A.Create a separate AWS CodePipeline for each microservice manually using the AWS Management Console.
B.Use the AWS Cloud Development Kit (CDK) to define a pipeline that dynamically discovers repositories.
C.Use a single AWS CodePipeline with multiple stages, each triggered by a different branch of the same repository.
D.Define a CloudFormation template that creates a pipeline for a given repository and invoke it automatically when a new repository is created using EventBridge and Lambda.
AnswerD

The correct approach uses a parameterized AWS CloudFormation template that defines a complete CodePipeline (source, build, deploy) for a given repository, and combines it with an EventBridge rule that detects the `CreateRepository` API call from CodeCommit (via CloudTrail) and triggers a Lambda function. That Lambda function validates the input and invokes `CreateStack` (or `UpdateStack`) with the repository name as a parameter, automatically provisioning a dedicated pipeline for each new microservice as soon as the repo is created. This delivers event-driven, infrastructure-as-code automation, ensuring every pipeline is identical, versioned, and created without human interaction, thereby meeting the scalability and consistency goals of the team.

Why this answer

It uses an event-driven approach: EventBridge detects the creation of a new CodeCommit repository, triggers a Lambda function that invokes a CloudFormation template to create a corresponding CodePipeline. This fully automates pipeline provisioning for new microservices without manual intervention, aligning with the requirement to minimize manual configuration.

Exam trap

The trap here is that candidates may choose Option B (CDK) thinking it provides dynamic discovery, but CDK is a compile-time tool that cannot react to runtime events like repository creation, whereas EventBridge and Lambda provide true event-driven automation.

How to eliminate wrong answers

Option A is wrong because manually creating a separate CodePipeline for each microservice via the console violates the requirement to minimize manual configuration and does not scale. Option B is wrong because the AWS CDK cannot dynamically discover repositories at runtime; it requires explicit repository references in the code and does not automatically react to new repository creation events. Option C is wrong because using a single pipeline with multiple stages triggered by different branches of the same repository assumes all microservices share a single repository, contradicting the requirement that each microservice has its own CodeCommit repository and must be built and deployed independently.

1112
MCQhard

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

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

The CloudWatch Embedded Metric Format encodes custom metric values inside a structured JSON log event; when the Fargate task's awslogs driver sends that log to CloudWatch Logs, CloudWatch automatically extracts the declared metrics into the specified namespace for graphing and alarms. This requires no separate daemon, sidecar, or SDK call—developers only add a serialization layer to application logging, making it the minimal-code path you asked for.

Why this answer

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

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

1113
MCQhard

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

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

This is correct because an HTTP request sets the aws:SecureTransport context key to false, and the Deny statement is scoped to exactly that condition. The policy likely contains an Allow for the S3 action on the folder, but the explicit Deny for non-secure transport takes precedence under AWS's evaluation logic. As a result, the user's GET request over HTTP is denied, while the same request sent over HTTPS would be allowed if the other permissions match.

Why this answer

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

1114
MCQhard

A company runs a critical application on Amazon ECS with Fargate. The application is deployed across multiple Availability Zones and uses an Application Load Balancer (ALB) as the front-end. During a recent incident, users experienced intermittent connectivity failures. The DevOps team suspects that tasks are being stopped due to resource exhaustion. Which combination of metrics and actions should the team use to diagnose and prevent recurrence?

A.Monitor CPU and memory utilization metrics in CloudWatch; increase the task size (CPU and memory) in the task definition.
B.Set up CloudWatch Logs for the application and check for out-of-memory errors; then increase the number of tasks.
C.Monitor NetworkPacketsIn and NetworkPacketsOut metrics in CloudWatch; increase the number of tasks.
D.Monitor the ALB error metrics (5xx count) and scale the ECS service based on request count.
AnswerA

Monitor CPU and memory utilization in CloudWatch to detect resource exhaustion. Increasing task size (CPU and memory) provides more resources per task, preventing OOM or CPU throttling without changing task count.

Why this answer

CPU and memory utilization metrics in CloudWatch directly indicate resource exhaustion, which is the suspected cause of tasks being stopped. Increasing the task size (CPU and memory) in the task definition provides more resources per task, preventing the OOM killer or CPU throttling from stopping tasks, without changing the number of tasks or scaling logic.

Exam trap

The trap here is that candidates confuse horizontal scaling (increasing task count) with vertical scaling (increasing task size), assuming that adding more tasks resolves resource exhaustion when the actual issue is insufficient resources per task.

How to eliminate wrong answers

Option B is wrong because while CloudWatch Logs can show out-of-memory errors, increasing the number of tasks does not address resource exhaustion per task—it only distributes load across more tasks, which may still fail if each task is under-provisioned. Option C is wrong because NetworkPacketsIn and NetworkPacketsOut measure network throughput, not CPU or memory exhaustion; high network metrics do not cause tasks to be stopped due to resource exhaustion. Option D is wrong because ALB 5xx errors and request count scaling address load balancing and traffic spikes, not the root cause of tasks being stopped due to insufficient CPU or memory per task.

1115
MCQmedium

A company uses AWS CodeBuild to build and test code. The build process requires access to a private PyPI repository hosted on an internal network. The CodeBuild project is configured with a VPC. However, the build fails with a timeout error when trying to connect to the PyPI repository. The security group for the CodeBuild project allows outbound HTTPS to 0.0.0.0/0. What is the most likely cause?

A.CodeBuild does not support VPC connectivity.
B.The VPC subnet has a NAT gateway that routes traffic to the internet instead of the internal network.
C.The security group for the PyPI repository does not allow inbound traffic from the CodeBuild security group.
D.The VPC subnet does not have a route to the internal network.
AnswerC

The security group associated with the CodeBuild project's ENI acts as the source for all traffic leaving the build environment. For the build to successfully fetch packages from an internal PyPI repository, the repository's security group must have an inbound rule that permits HTTPS (or the appropriate port) from the CodeBuild security group ID. If this inbound rule is missing, the repository silently drops the request, causing timeouts or connection refused errors during dependency installation. This is the most common cause of such failures when routing and NACL settings are already configured correctly.

Why this answer

The private PyPI repository is hosted on an internal network accessible via the VPC. The CodeBuild project is configured with a VPC and its security group allows outbound HTTPS to 0.0.0.0/0. However, the repository's security group must also allow inbound HTTPS traffic from the CodeBuild security group.

If that inbound rule is missing, the connection will be blocked, causing a timeout. Option A is incorrect because CodeBuild fully supports VPC connectivity. Option B is incorrect because a NAT gateway would route traffic to the internet, but the repository is internal; this could cause a timeout, but it's less likely than a missing inbound rule.

Option D is incorrect because if the subnet had no route to the internal network, the build would likely fail with a different error (e.g., no route to host) rather than a timeout; however, the most likely cause in practice is the missing inbound rule on the repository side.

1116
MCQeasy

A security engineer reviews the CloudTrail log entry above and notices that a security group was modified to allow SSH access from anywhere. The engineer wants to ensure that such changes are automatically detected and remediated in the future. What should the engineer do?

A.Configure CloudTrail to send logs to CloudWatch Logs and create a metric filter that alerts on AuthorizeSecurityGroupIngress events with 0.0.0.0/0.
B.Create an IAM policy that denies the ec2:AuthorizeSecurityGroupIngress action if the source IP is 0.0.0.0/0.
C.Create an AWS Config rule that checks security group rules and triggers an AWS Systems Manager Automation document to revoke the ingress rule.
D.Enable Amazon GuardDuty to detect and block such changes in real time.
AnswerC

This is the only option that provides automatic detection and remediation. An AWS Config managed or custom rule can evaluate each security group and mark it NON_COMPLIANT if it contains an ingress rule with 0.0.0.0/0. You can attach that rule to a Systems Manager Automation document, which uses aws:executeAwsApi to call RevokeSecurityGroupIngress and remove the offending rule, or trigger an AWS Lambda function; this remediation runs automatically on each configuration change. Thus it directly satisfies the requirement to revert unauthorized changes.

Why this answer

AWS Config can continuously evaluate security group rules against a custom or managed rule (e.g., restricted-ssh) and, upon detecting a noncompliant rule allowing 0.0.0.0/0 on port 22, trigger an AWS Systems Manager Automation document that automatically revokes the offending ingress rule. This provides both detection and remediation without manual intervention, meeting the requirement for automated detection and remediation.

Exam trap

The trap here is that candidates often confuse detection-only services (like CloudWatch alarms or GuardDuty) with services that can also perform automated remediation (like AWS Config with Systems Manager Automation), leading them to choose options that only alert but do not fix the issue.

How to eliminate wrong answers

Option A is wrong because while CloudTrail logs to CloudWatch Logs with a metric filter can alert on AuthorizeSecurityGroupIngress events with 0.0.0.0/0, this only provides notification (detection) but does not automatically remediate the change. Option B is wrong because an IAM policy that denies ec2:AuthorizeSecurityGroupIngress based on source IP 0.0.0.0/0 is not possible—IAM policies cannot inspect the contents of the API request parameters like the CIDR block; they operate on the action and resource ARN, not on the specific values of the request. Option D is wrong because Amazon GuardDuty is a threat detection service that analyzes VPC Flow Logs, DNS logs, and CloudTrail events for malicious activity, but it cannot block or remediate security group changes in real time; it only generates findings.

1117
MCQmedium

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

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

The SSM Agent maintains a control-plane communication channel over HTTPS to the Systems Manager regional endpoints, either through the public internet, a NAT gateway, or interface VPC endpoints. If outbound access is blocked by security groups, network ACLs, or route tables, the instance cannot register with Systems Manager, receive patch commands, or report status, yet the agent may continue running locally without logging an explicit error. Therefore, verifying that the instance can resolve and connect to endpoints like ssm.<region>.amazonaws.com on port 443 is the first diagnostic step.

Why this answer

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

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

1118
MCQmedium

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

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

The correct approach is to add a second ALB listener for HTTPS port 443 with an ACM certificate in the same AWS region, and configure the existing HTTP listener (port 80) with a default action to redirect all traffic to HTTPS using a 301 response. This terminates TLS at the load balancer, encrypting the client-to-ALB connection, while a security group rule restricting inbound traffic to port 443 further enforces the policy. ACM automatically renews the certificate as long as DNS validation is configured, making it a fully managed, low-maintenance solution.

Why this answer

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

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

1119
Multi-Selectmedium

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

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

CloudWatch Logs Insights can query multiple log groups simultaneously.

Why this answer

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

Exam trap

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

1120
MCQhard

A company uses CloudFormation to manage infrastructure. They have a nested stack that creates an Amazon RDS instance. When updating the parent stack, the RDS instance is unexpectedly replaced even though no changes were made to its properties. The engineer suspects a 'Drift' detection issue. What is the most likely reason for the replacement?

A.The RDS instance has drifted from the template definition.
B.The deletion policy is set to 'Retain'.
C.The logical ID of the RDS resource was changed in the nested stack template.
D.The stack policy prevents updates to the RDS instance.
AnswerC

A change in logical ID causes CloudFormation to create a new resource and delete the old one.

Why this answer

If the logical ID of a resource in the nested stack template is changed, CloudFormation treats it as a new resource and replaces the old one. Option A is incorrect because drift detection does not cause replacement; it only detects changes. Option B is incorrect because a 'Retain' deletion policy prevents deletion but does not prevent replacement.

Option D is incorrect because a stack policy may prevent updates but would not cause replacement; it would either allow or block the update.

1121
MCQhard

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

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

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

Why this answer

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

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

1122
MCQmedium

A company uses AWS Lambda to process messages from an SQS queue. They need to ensure that if the Lambda function fails, the message is not lost and can be processed again. Which configuration is required?

A.Set the visibility timeout to less than the Lambda function timeout.
B.Enable SQS redrive policy to retry messages.
C.Configure a dead-letter queue (DLQ) on the SQS queue.
D.Set the Lambda event source mapping to not delete messages from the queue on failure.
AnswerD

The Lambda event source mapping for an SQS queue governs message deletion: it only deletes a message after the function returns a success response. By ensuring the mapping does not delete messages on failure (which is the standard behavior unless the function reports success), the failed message remains in the source queue. On subsequent polls, the event source mapping receives it again and invokes the function, giving the desired retry behavior. This is the correct way to let Lambda retry processing of a failed message.

Why this answer

The Lambda event source mapping for SQS can be configured to not delete messages from the queue if the function fails. This ensures that the message remains in the queue and becomes visible again after the visibility timeout expires, allowing it to be retried. Without this setting, Lambda automatically deletes messages upon successful processing, but on failure, the default behavior is to delete them as well, which would cause message loss.

Exam trap

The trap here is that candidates often confuse the dead-letter queue (DLQ) as the mechanism for retrying messages, when in fact it only stores messages after all retry attempts are exhausted, and the key to ensuring retries on failure is the event source mapping's delete behavior.

How to eliminate wrong answers

Option A is wrong because setting the visibility timeout to less than the Lambda function timeout would cause the message to become visible again before the function finishes, leading to duplicate processing, not preventing message loss. Option B is wrong because an SQS redrive policy moves messages to a dead-letter queue after a specified number of receive attempts, but it does not retry messages; it only redirects them after exhaustion of retries. Option C is wrong because configuring a dead-letter queue on the SQS queue is a best practice for capturing messages that cannot be processed after all retries, but it does not ensure that the message is retried on failure; it only stores failed messages after retries are exhausted.

1123
MCQeasy

A company uses AWS CloudFormation to deploy infrastructure. During a recent deployment, the stack failed to create an Amazon RDS DB instance because of a parameter validation error. The DevOps engineer fixed the parameter and wants to resume the stack creation without recreating the resources that were already successfully created. The stack template is parameterized and uses nested stacks. What is the MOST efficient way to resume the stack creation?

A.Use the CloudFormation stack update operation with the corrected parameter.
B.Manually create the RDS instance with the corrected parameter and update the stack to import it.
C.Delete the entire stack and redeploy with the corrected parameter.
D.Use the 'ContinueUpdateRollback' feature to rollback the failed stack and then redeploy.
AnswerA

Calling the UpdateStack API (or the update operation in the console) on a stack in CREATE_FAILED state is the correct recovery path. CloudFormation only re-evaluates the resources that depend on the changed parameter, so the failed RDS instance is created while already-created resources remain untouched and no downtime is introduced. Any other approach either destroys existing resources or is not applicable to a creation failure.

Why this answer

CloudFormation stack updates can be used to fix the issue. By updating the stack with the corrected parameters, CloudFormation will only modify the failed resource and not recreate already created resources.

1124
MCQhard

A company runs a critical application on Amazon ECS with Fargate. They use blue/green deployments via AWS CodeDeploy. During a recent deployment, the new task set failed health checks and CodeDeploy automatically rolled back. However, the old task set also became unhealthy shortly after rollback. What could explain this?

A.The CloudWatch alarm that triggered the rollback also stopped the old task set.
B.CodeDeploy did not drain connections from the Application Load Balancer before terminating the old task set.
C.The ECS service auto-scaling policy reduced the desired count of the old task set during the deployment.
D.The new application version changed the database schema, which broke the old version after rollback.
AnswerD

When the new version applied a forward-only database schema migration, the schema changed irreversibly for the running environment. CodeDeploy rolled back the ECS task set to the old code, but that old code cannot understand the new schema, causing errors, failed health checks, and a broken application. This is the recognized cause: database changes are not automatically rolled back, so they break the previous version. The fix is to implement reverse migrations or use an expansion-contraction pattern.

Why this answer

A backward-incompatible database schema change (e.g., a column removal or renaming) applied by the new application version can corrupt or invalidate the data that the old version relies on. When CodeDeploy rolls back to the old task set, the old application cannot function correctly with the altered schema, causing it to fail health checks. This is a classic rollback failure scenario where the deployment changes shared state (the database) that persists beyond the task set lifecycle.

Exam trap

The trap here is that candidates assume rollback always restores full functionality, overlooking that shared mutable state (like a database schema) can persist across deployments and break the old version after rollback.

How to eliminate wrong answers

Option A is wrong because CloudWatch alarms that trigger a rollback do not stop the old task set; they only initiate the rollback process, which CodeDeploy handles by shifting traffic back to the original task set. Option B is wrong because CodeDeploy with ECS blue/green deployments uses the 'original' task set's listener rule weight to shift traffic back during rollback; it does not terminate the old task set until the deployment succeeds, and connection draining is handled by the ALB's deregistration delay, not by CodeDeploy. Option C is wrong because ECS Service Auto Scaling policies do not reduce the desired count of the old task set during a deployment; CodeDeploy manages the desired count of both task sets independently, and auto-scaling is suspended or operates on the active service, not on the old task set being preserved for rollback.

1125
MCQhard

A company uses AWS Elastic Beanstalk with a custom platform. They need to update the platform version to include a new security patch. Which approach should be used to create a new custom platform version?

A.Use the Elastic Beanstalk CLI to rebuild the platform with the new AMI.
B.Launch a new EC2 instance, apply the patch, and create an AMI, then update the platform version.
C.Modify the existing platform version's AMI ID using the Elastic Beanstalk console.
D.Create a new platform version using the aws elasticbeanstalk create-platform-version command with an updated platform definition file.
AnswerD

The correct procedure is to increment the version number in your platform definition file and then run the AWS CLI command `aws elasticbeanstalk create-platform-version`, which uploads the new packer template and associated configuration to build a fresh, immutable platform version. This new version can then be used as the `PlatformArn` in your environment's configuration, allowing the patched AMI to be deployed without affecting existing environments that reference the old version. This workflow is the documented way to apply changes to a custom platform.

Why this answer

AWS Elastic Beanstalk custom platforms are defined using a platform definition file (a YAML or JSON file that specifies the AMI, Chef recipes, and other configuration). To create a new platform version with an updated security patch, you must update this platform definition file (e.g., to reference a new base AMI with the patch) and then run the `aws elasticbeanstalk create-platform-version` CLI command. This command packages the definition file and uploads it to Elastic Beanstalk, which then builds and registers the new platform version.

The other options either bypass the custom platform framework or are not supported operations.

Exam trap

The trap here is that candidates assume they can directly modify an existing platform version or use manual EC2 operations, but Elastic Beanstalk custom platforms require a formal versioning process through the platform definition file and the `create-platform-version` API.

How to eliminate wrong answers

Option A is wrong because the Elastic Beanstalk CLI does not have a command to 'rebuild the platform with a new AMI'; the CLI is used for application management, not for modifying custom platform definitions. Option B is wrong because manually launching an EC2 instance, patching it, and creating an AMI does not integrate with Elastic Beanstalk's custom platform versioning system; you must use the platform definition file and the `create-platform-version` API to register a new version. Option C is wrong because the Elastic Beanstalk console does not allow you to modify the AMI ID of an existing platform version; platform versions are immutable once created.

Page 14

Page 15 of 20

Page 16