Courseiva

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

767 questions total · 11pages · All types, answers revealed

Page 1 of 11

Page 2
1
MCQmedium

A financial services company uses AWS CloudFormation to deploy a three-tier web application. The stack includes an Amazon RDS for PostgreSQL database. The database master password is stored in AWS Secrets Manager, and the CloudFormation template uses a dynamic reference to retrieve it during stack creation. The team recently rotated the database password in Secrets Manager. When they attempt to update the stack to change other parameters, the update fails with the error: 'Value of property MasterUserPassword must be a string.' The team is using the following template snippet for the password: 'MasterUserPassword': '{{resolve:secretsmanager:MySecret:SecretString:password}}'. The stack was originally created with AWS CloudFormation. What is the most likely cause of the failure?

A.The secret was rotated before the stack was created, causing a mismatch.
B.The template syntax is incorrect; it should use '{{resolve:secretsmanager:MySecret:SecretString:password}}' with different quotes.
C.Dynamic references in CloudFormation are only resolved at stack creation, not during updates. The team must use a different method to reference the rotated password.
D.The secret is in a different region than the stack.
AnswerC

CloudFormation does not re-resolve dynamic secrets on stack updates.

Why this answer

Dynamic references in CloudFormation are resolved only at stack creation, not during updates. When the secret is rotated, the stack update does not re-evaluate the dynamic reference, causing the password to be invalid and resulting in the error. Option A is incorrect because the error is not due to rotation before creation but due to the update not re-resolving the reference.

Option B is incorrect because the template syntax is correct. Option D is incorrect because the region of the secret is not relevant to this error.

2
MCQmedium

Refer to the exhibit. A DevOps engineer runs the AWS CLI command shown to retrieve the RequestCount metric for an ELB. The output shows datapoints with Sum values. What is the total number of requests received by the load balancer during the entire hour?

A.18600 requests
B.1500 + 2000 = 3500 requests
C.36000 requests
D.Cannot be determined from the data
AnswerA

Summing all 12 datapoints (each representing 5-minute sums) gives the total requests for the hour.

Why this answer

18600 requests. The AWS CLI command retrieves the RequestCount metric with a period of 300 seconds (5-minute intervals). Each datapoint's Sum value represents the total number of requests received in that 5-minute window.

To find the total requests for the entire hour, sum all 12 datapoints. The exhibit shows datapoints like 1500, 2000, ... 1800, and their total is 18600. Option B (3500) is incorrect because it only sums two datapoints instead of all twelve.

Option C (36000) is incorrect because it likely multiplies a single datapoint by 12 without considering the actual values. Option D is incorrect because the total is determinable by summing the datapoints.

3
Multi-Selectmedium

A company runs a microservices application on Amazon ECS with Fargate. The services need to be resilient to AZ failures. Which TWO actions should the company take? (Choose two.)

Select 2 answers
A.Configure the ECS service to spread tasks across multiple Availability Zones
B.Enable Service Auto Scaling to maintain desired count across AZs
C.Use a Network Load Balancer in each AZ for the service
D.Use a placement group to ensure tasks are launched on the same underlying hardware
E.Place all tasks in a single Availability Zone to minimize cross-AZ latency
AnswersA, B

Spreading across AZs provides fault tolerance.

Why this answer

To ensure resilience to Availability Zone failures, the company should spread tasks across multiple AZs (Option A) so that if one AZ fails, the tasks in other AZs continue to serve traffic. Additionally, enabling Service Auto Scaling (Option B) helps maintain the desired task count across AZs by automatically replacing tasks in failed AZs. Option C is incorrect because a single Network Load Balancer can route traffic across all AZs; placing one per AZ is unnecessary and adds complexity.

Option D is irrelevant since placement groups apply to EC2 instances, not Fargate tasks. Option E is the opposite of resilience—placing all tasks in one AZ creates a single point of failure.

4
MCQeasy

A company wants to visualize the performance of their application running on EC2. They need to create a dashboard that shows CPU utilization, memory usage, and disk I/O. Which AWS service should they use?

A.Amazon CloudWatch Dashboards.
B.AWS CloudTrail.
C.AWS Systems Manager.
D.Amazon QuickSight.
AnswerA

CloudWatch Dashboards can display EC2 metrics including CPU, memory, and disk I/O when the CloudWatch agent is installed.

Why this answer

Amazon CloudWatch Dashboards can display metrics from EC2 and the CloudWatch agent, including memory and disk metrics. Option B is wrong because AWS CloudTrail is for auditing API calls, not for visualization. Option C is wrong because AWS Systems Manager is for management and automation, not for creating dashboards.

Option D is wrong because Amazon QuickSight is for business intelligence, not infrastructure monitoring.

5
MCQhard

An e-commerce application runs on Amazon ECS with Fargate. The operations team notices that the application's latency increases during peak hours. The engineer needs to correlate high CPU usage with increased request latency to identify the root cause. Which approach should be used?

A.Use CloudWatch Logs Insights to query container logs
B.Enable Container Insights and ServiceLens to correlate metrics and traces
C.Configure CloudWatch Synthetics canaries to measure latency
D.Set up a Prometheus server on an EC2 instance to scrape container metrics
AnswerB

Container Insights provides CPU metrics; ServiceLens integrates X-Ray traces.

Why this answer

Container Insights for Amazon ECS with Fargate collects CPU, memory, and other metrics, while ServiceLens integrates CloudWatch metrics with AWS X-Ray traces to provide end-to-end visibility. This correlation allows the engineer to identify high CPU usage and its impact on request latency. Option A is incorrect because CloudWatch Logs Insights only analyzes log data, not metrics or traces.

Option C is incorrect because CloudWatch Synthetics canaries monitor endpoint availability and performance from outside, but do not provide internal CPU metrics. Option D is incorrect because setting up a Prometheus server on an EC2 instance adds operational overhead and does not integrate with ECS Fargate natively; Container Insights and ServiceLens are the recommended AWS-native solution.

6
MCQeasy

A DevOps engineer needs to manage configuration files for multiple applications across several EC2 instances. The configuration values are sensitive (e.g., database passwords) and must be encrypted at rest and in transit. Which AWS service should be used to store and retrieve these configuration values?

A.AWS Systems Manager Parameter Store (SecureString)
B.AWS CloudFormation template parameters
C.Amazon DynamoDB with encryption
D.Amazon S3 with server-side encryption
AnswerA

Parameter Store provides secure, hierarchical storage for configuration data with encryption.

Why this answer

AWS Systems Manager Parameter Store supports secure string parameters that are encrypted at rest using AWS KMS. It integrates with EC2 instances via the SSM Agent for secure retrieval in transit, making it ideal for sensitive configuration values like database passwords. Option A is correct.

Option B (CloudFormation template parameters) are not designed for storing secrets and are passed at stack creation time, not dynamic retrieval. Option C (DynamoDB with encryption) is a NoSQL database, not a configuration store. Option D (S3 with SSE) is object storage, not optimized for parameter management or EC2 integration.

7
MCQhard

A company runs a critical e-commerce application on AWS. They use AWS CodePipeline to manage deployments. The pipeline has a source stage (CodeCommit), a build stage (CodeBuild), and a deploy stage (CodeDeploy to an Auto Scaling group). Recently, a deployment caused a 5-minute outage because the new application version had a bug that caused the health checks to fail. The Auto Scaling group marked instances as unhealthy and replaced them, but during the replacement, traffic was routed to the remaining instances, which also failed health checks, causing a full outage. The company wants to implement a deployment strategy that prevents any traffic from being routed to unhealthy instances and automatically rolls back if the deployment fails. They also want to minimize deployment time and cost. Which solution should the DevOps team implement?

A.Add a manual approval step in CodePipeline before deploy
B.Use CodeDeploy in-place deployment with automatic rollback enabled
C.Use CodeDeploy blue/green deployment with automatic rollback enabled
D.Increase the health check grace period in the Auto Scaling group
AnswerC

Blue/green creates a new environment, tests it, and shifts traffic only if healthy; rollback is automatic

Why this answer

The correct solution is to use a blue/green deployment with CodeDeploy and automatic rollback enabled. In a blue/green deployment, a new Auto Scaling group (green) is created alongside the existing one (blue). Traffic is shifted to the green group only after all health checks pass.

If health checks fail, the deployment is automatically rolled back by terminating the green group, ensuring no traffic is routed to unhealthy instances. This prevents any outage. Option B (in-place deployment with rollback) updates instances in place, which can cause downtime if instances fail health checks, as the Auto Scaling group replaces them sequentially, potentially routing traffic to unhealthy instances.

Option A (manual approval) slows down deployment and does not automate rollback based on health checks. Option D (increasing health check grace period) only delays detection of failures and does not prevent traffic from being routed to unhealthy instances.

8
MCQmedium

A DevOps engineer notices that an EC2 instance running a critical web application has been terminated unexpectedly. The instance was part of an Auto Scaling group. Which step should the engineer take FIRST to investigate the root cause?

A.Review AWS CloudTrail logs for TerminateInstances API calls.
B.Look at the EC2 console's 'Termination Protection' setting.
C.Check the application logs on the instance's attached EBS volume (detached and attached to another instance).
D.Verify the Auto Scaling group's scaling policies and scheduled actions.
AnswerA

CloudTrail logs all API calls and can identify the source of termination.

Why this answer

The first step in incident response is to gather information. CloudTrail logs all API calls, including TerminateInstances, and can identify who or what terminated the instance. Option B is wrong because examining the application logs does not reveal the termination cause.

Option C is wrong because scaling policies would not cause termination without CloudWatch. Option D is wrong because the termination reason is not available in the console without checking logs.

9
MCQhard

Refer to the exhibit. A security team reviews this CloudTrail log entry. Which finding is most concerning?

A.The event occurred in us-east-1.
B.The instance was terminated by an assumed role.
C.The source IP is from a public IP.
D.The user did not authenticate with MFA.
AnswerD

Correct; lack of MFA reduces security.

Why this answer

The session was created without MFA (mfaAuthenticated: false). This is a security concern because the role allows console access and the user did not use MFA, increasing risk of unauthorized access. The termination is the action, but the lack of MFA is a security gap.

10
MCQeasy

A company uses AWS OpsWorks for configuration management. They want to automate the installation of a custom agent on new EC2 instances. Which OpsWorks feature should they use?

A.Use a custom Chef recipe in the layer's configuration to run the installation.
B.Define the agent installation in the layer's built-in configuration.
C.Use custom JSON to pass the installation commands.
D.Create a cookbook repository and upload the agent installation script.
AnswerA

Custom recipes run on instance setup.

Why this answer

AWS OpsWorks allows you to define custom Chef recipes that run during specific lifecycle events (e.g., Setup) on new instances. By adding a custom recipe to the layer's configuration, you can automate the installation of a custom agent. Option B is incorrect because the layer's built-in configuration is for default OpsWorks settings, not custom agent installation.

Option C is incorrect because custom JSON passes attribute data to recipes but does not execute installation commands directly. Option D is incorrect because storing scripts in a cookbook repository does not automatically run them; you must assign the recipe to the layer's lifecycle events.

11
MCQhard

A company runs a stateful web application on EC2 instances behind an Application Load Balancer. The application uses sticky sessions (session affinity) based on cookies. During a deployment, the Auto Scaling group launches new instances, but users experience session loss. What is the most likely cause?

A.The Auto Scaling group's lifecycle hooks are not configured.
B.The stickiness duration is set too low.
C.The target group's deregistration delay is too short.
D.The target group's health check interval is too long.
AnswerC

A short delay causes the ALB to stop sending traffic to the instance before sessions are drained.

Why this answer

Sticky sessions rely on the instance ID to route requests. During a deployment, Auto Scaling launches new instances and terminates old ones. The target group's deregistration delay controls how long the ALB waits before forcibly closing connections to deregistering instances.

If this delay is too short, in-flight requests and sessions are abruptly terminated, causing users to lose their sessions. Options A, B, and D are incorrect: lifecycle hooks (A) are for custom actions, not directly related to session loss; stickiness duration (B) affects how long a session sticks to an instance but does not cause loss during deployment; and health check interval (D) affects availability but not session persistence.

12
MCQeasy

A company uses AWS CodePipeline to automate the deployment of a static website hosted on Amazon S3. The pipeline includes a source stage that pulls from a CodeCommit repository and a deploy stage that uses CodeBuild to sync the files to an S3 bucket. The team noticed that the website is not updating after a successful pipeline run. The CodeBuild logs show that the 'aws s3 sync' command completed successfully. However, the website still shows the old content. What is the MOST likely cause?

A.The CodeBuild project does not have permission to write to the S3 bucket.
B.The S3 bucket is not configured for static website hosting.
C.The website is fronted by Amazon CloudFront, which is caching the old content.
D.The S3 bucket policy is blocking public access to the updated objects.
AnswerC

CloudFront caches content; a cache invalidation is needed to serve the new files.

Why this answer

The most likely cause is that the website is fronted by Amazon CloudFront, which caches the old content. Even though the 'aws s3 sync' command successfully updates the objects in the S3 bucket, CloudFront continues to serve the cached version until the cache TTL expires or a cache invalidation is performed. Option A is incorrect because the CodeBuild project must have write permissions to the S3 bucket for the sync command to succeed; if it lacked permissions, the sync would fail.

Option B is incorrect because the S3 bucket is already configured for static website hosting (implied by the website being accessible). Option D is incorrect because the bucket policy does not affect the ability to serve updated objects; public access is likely already granted for the website to be served. Therefore, the caching behavior of CloudFront is the reason the website shows old content.

13
MCQeasy

A DevOps engineer receives an alert that an Amazon ECS service is failing to start tasks. The service uses the Fargate launch type. The task definition includes a container that requires port 8080. The security group associated with the service allows inbound traffic on port 8080. What should the engineer check NEXT?

A.Verify that the VPC subnets have a route to a NAT Gateway or Internet Gateway.
B.Confirm that the task definition's container image exists in ECR.
C.Check if the task definition has sufficient CPU and memory allocated.
D.Review the security group rules for outbound traffic.
AnswerA

Fargate tasks need outbound internet access to pull images.

Why this answer

Fargate tasks require network connectivity to pull container images from ECR (or Docker Hub) and to send logs to CloudWatch. Without a route to a NAT Gateway (for private subnets) or an Internet Gateway (for public subnets), the task cannot pull the image and fails to start. Option B is incorrect: while the image must exist, the immediate symptom of tasks failing to start when the image is missing would be an 'image not found' error, not a generic failure; the security group already allows inbound traffic on port 8080, but outbound connectivity is the issue.

Option C is incorrect: insufficient CPU/memory would cause tasks to enter a 'CPU exhausted' or 'memory exhausted' state, not prevent them from starting entirely. Option D is incorrect: the security group allows inbound traffic, but the issue is about egress connectivity for the task to reach the image registry.

14
MCQeasy

A DevOps team is using AWS CloudFormation to manage infrastructure. They want to reuse the same template across multiple environments (dev, test, prod) with minor parameter variations. Which CloudFormation feature should they use to pass environment-specific values without modifying the template?

A.Conditions
B.Outputs
C.Mappings
D.Parameters
AnswerD

Parameters enable passing environment-specific values into the template.

Why this answer

(Parameters). Parameters allow you to input custom values into a CloudFormation template at stack creation or update time, making them ideal for passing environment-specific settings (e.g., different instance sizes or AMI IDs) without altering the template itself. Mappings (C) are static lookup tables that cannot be changed per stack instance, Conditions (A) control whether resources are created but do not pass values, and Outputs (B) are for retrieving stack attributes after creation.

Therefore, D is the appropriate feature for this use case.

15
MCQhard

A DevOps team is debugging a production incident where an Application Load Balancer (ALB) is returning 503 errors for some requests. The target group instances are healthy. What is the most likely cause?

A.The security group for the ALB does not allow inbound traffic on port 443
B.Health checks are misconfigured to use an incorrect path
C.The deregistration delay setting on the target group is too long
D.Cross-zone load balancing is disabled
AnswerC

A long deregistration delay can cause the ALB to route requests to instances that are draining, resulting in 503.

Why this answer

The deregistration delay setting controls how long the ALB continues to send requests to an instance that is being deregistered. If this delay is too long, the ALB may route traffic to an instance that has already stopped accepting connections, resulting in 503 errors even though the health checks pass. Option A is incorrect because a missing security group rule would prevent any traffic from reaching the ALB, causing connection timeouts rather than 503 errors.

Option B is incorrect because the instance health checks are passing (as stated), so the health check path must be correct. Option D is incorrect because disabling cross-zone load balancing affects traffic distribution but does not cause 503 errors.

16
MCQeasy

The CloudWatch alarm 'HighCPU' has transitioned to ALARM state. What does the alarm history indicate about the metric that triggered it?

A.The metric value remained below the threshold.
B.The metric value was exactly 80.0 at the time of the alarm.
C.The metric value of 90.0 exceeded the threshold of 80.0.
D.The alarm was triggered after 3 consecutive datapoints breached the threshold.
AnswerC

The history clearly states the threshold was crossed with a value of 90.0.

Why this answer

The alarm history shows that a single datapoint with a value of 90.0 exceeded the threshold of 80.0, causing the alarm to transition to ALARM state. Option A is incorrect because the metric value (90.0) did not remain below the threshold. Option B is incorrect because the value was 90.0, not exactly 80.0.

Option D is incorrect because the alarm history indicates that only one datapoint breached the threshold, not three consecutive datapoints.

17
Matchingmedium

Match each AWS deployment strategy to its description.

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

Concepts
Matches

Two identical environments; traffic switches after validation

Incremental rollout to a small subset before full release

Updates instances in batches to minimize downtime

Replaces entire instances with new ones; no in-place changes

Deploys to all instances simultaneously (fastest but riskier)

Why these pairings

Blue/Green uses separate environments, Rolling replaces instances gradually, Canary tests with a subset first, and All-at-once updates all at once. Common confusions include swapping Blue/Green with Canary or Rolling.

18
MCQmedium

A team is using AWS CodeDeploy to deploy an application to EC2 instances. They want to ensure that if a deployment fails, the instances are automatically rolled back to the previous version. What should they configure?

A.Add a BeforeBlockTraffic hook to the AppSpec file to run a rollback script.
B.Set the deployment configuration to 'CodeDeployDefault.OneAtATime' for a gradual deployment.
C.Configure the deployment group to use the same Auto Scaling group for rollback.
D.Enable automatic rollback in the deployment group settings.
AnswerD

Automatic rollback redeploys the previous revision on failure.

Why this answer

CodeDeploy supports automatic rollback configuration. When enabled, if a deployment fails, CodeDeploy automatically redeploys the last successful revision. Option A is wrong because a hook is a lifecycle event, not a rollback mechanism.

Option B is wrong because a deployment group contains instances but does not have a rollback setting. Option C is wrong because a deployment configuration specifies traffic routing and failure thresholds, not automatic rollback.

19
MCQhard

A company uses AWS CodeBuild to compile and test their Java application. The build takes about 20 minutes. They have enabled Amazon S3 cache to store the Maven repository to speed up subsequent builds. However, they notice that the build time has not improved significantly. The buildspec file includes the 'cache' section with 'paths' pointing to '/root/.m2'. The CodeBuild project has cache type set to 'S3' and a valid bucket. The build logs show that the cache is being downloaded and uploaded, but the Maven dependencies are still being downloaded from the internet each time. What is the most likely cause?

A.The cache is too large and takes as long to download as the build itself.
B.The S3 bucket is in a different region than the CodeBuild project.
C.The buildspec file does not include the 'cache' section correctly.
D.The Maven dependencies are not being stored in the local repository path specified in the cache.
AnswerD

If Maven is configured to download dependencies to a different location, the cache won't capture them.

Why this answer

The cache is configured to store the Maven local repository at '/root/.m2', but Maven by default stores dependencies in the home directory of the user running the build (e.g., '/root/.m2'). However, the build may be running as a different user or Maven may be configured to use a different local repository path (e.g., via settings.xml or the 'maven.repo.local' property). If the dependencies are not being written to '/root/.m2', the cache will not capture them, and dependencies will be re-downloaded.

Option A is incorrect because the cache is being downloaded and uploaded, but the issue is that the cache does not contain the dependencies. Option B is incorrect because S3 bucket region does not prevent cache download/upload, and logs show cache is being transferred. Option C is incorrect because the buildspec includes the cache section correctly, as shown by the cache operations in logs.

20
MCQmedium

A company is running a production application on Amazon ECS with AWS Fargate. The application has unpredictable traffic patterns and occasionally experiences increased latency. The DevOps team needs to configure scaling based on a custom metric that tracks the number of active user sessions in real time. Which solution will allow the team to scale the ECS service based on this custom metric?

A.Use AWS Auto Scaling to scale the ECS service based on the custom metric.
B.Create a CloudWatch dashboard to visualize the metric and manually adjust the service count.
C.Publish the custom metric to Amazon CloudWatch, then create a target tracking scaling policy in Application Auto Scaling for the ECS service.
D.Use an AWS Lambda function to directly update the desired count of the ECS service based on the metric.
AnswerC

This is the recommended approach for scaling ECS services using custom metrics.

Why this answer

To scale an ECS service based on a custom metric like active user sessions, you can publish the metric to Amazon CloudWatch and then create a target tracking scaling policy in Application Auto Scaling for the ECS service. Application Auto Scaling uses the CloudWatch metric to automatically adjust the desired count. Option A is incorrect because AWS Auto Scaling is for EC2 Auto Scaling, not for ECS services; Application Auto Scaling is the correct service.

Option B is incorrect because manual adjustment based on a dashboard does not provide automated scaling. Option D is incorrect because while a Lambda function could be used to update the desired count, it introduces unnecessary complexity and is not the recommended approach; using Application Auto Scaling with CloudWatch is the standard solution.

21
Multi-Selectmedium

A company uses AWS CodeBuild to build and test code. The build jobs need to access a private S3 bucket to download dependencies. Which THREE steps are required to securely grant access?

Select 3 answers
A.Configure the S3 bucket policy to allow access from the CodeBuild service principal
B.Set up a VPC endpoint for S3
C.Create an IAM role with a policy that allows s3:GetObject on the bucket
D.Create a KMS key and grant CodeBuild access to it
E.Attach the IAM role to the CodeBuild project in the service role field
AnswersA, C, E

The bucket policy must explicitly allow the role to access the bucket, unless the role has cross-account permissions.

Why this answer

To grant CodeBuild access to an S3 bucket, you need an IAM role that allows the required actions, attach it to the CodeBuild project, and also ensure the bucket policy allows the role. KMS key is not required if SSE-S3 is used. VPC endpoint is optional.

22
MCQmedium

A company is using Amazon CloudWatch Synthetics to monitor the availability of a web application. The canary runs every 5 minutes from multiple locations. Recently, the canary has been failing intermittently with HTTP 503 errors, but the application team reports that the application is healthy. Which step should the DevOps engineer take to identify the cause of the false positives?

A.Increase the canary timeout setting to allow more time for the application to respond.
B.Add more canary locations to increase coverage.
C.Review the canary's CloudWatch Logs to check for network errors or timeouts.
D.Increase the canary run frequency to every 1 minute.
AnswerC

Logs might reveal that the failure is due to network or client-side issues, not the application.

Why this answer

Checking the canary's CloudWatch Logs might reveal that the failure is due to a network timeout or other client-side issue, not the application. Option A is wrong because increasing canary frequency would generate more data but not identify the cause. Option B is wrong because increasing timeout might mask the issue.

Option D is wrong because adding more locations would not pinpoint the cause if the issue is client-side.

23
MCQeasy

A DevOps engineer is troubleshooting a production issue where an Application Load Balancer (ALB) is returning 503 errors. The ALB targets are EC2 instances in an Auto Scaling group behind the ALB. The engineer checks the ALB access logs in Amazon S3 and finds that the ALB is healthy. However, the 503 errors persist. Which configuration should the engineer check next?

A.Enable AWS Shield Advanced to protect the ALB from DDoS attacks.
B.Verify that the SSL certificate associated with the ALB is not expired.
C.Check the security groups for the EC2 instances to ensure they allow traffic from the ALB on the listener port.
D.Check the ALB's target group health check settings and verify that the health check path is correct.
AnswerC

Security groups blocking traffic from the ALB can cause 503 errors.

Why this answer

503 errors often indicate that the ALB cannot establish a connection to the targets. The most common cause is that the security groups attached to the EC2 instances are not allowing inbound traffic from the ALB on the listener port. Option A is incorrect because AWS Shield Advanced is a DDoS protection service; the ALB being healthy in logs suggests no DDoS attack is causing the 503 errors.

Option B is incorrect because an expired SSL certificate would cause different errors (e.g., 502 or handshake failures), not 503. Option D is incorrect because checking health check settings is a valid troubleshooting step, but since the engineer already verified the ALB is healthy in access logs (meaning the ALB itself is operational), the immediate next step should be to verify security groups, which are a common cause of connectivity issues.

24
MCQmedium

After deploying a new application version using AWS CodeDeploy, an EC2 instance fails the deployment. The deployment group is configured with an in-place deployment. The engineer sees the error 'ScriptMissing' in the CodeDeploy logs. What should the engineer check?

A.The deployment group's deployment configuration
B.The file path defined in the appspec.yml for the lifecycle hook
C.The security group attached to the instance
D.The AMI used for the EC2 instance
AnswerB

The appspec.yml specifies scripts; if the script file is not at the specified path, the error occurs.

Why this answer

The 'ScriptMissing' error in CodeDeploy indicates that the script file specified in the appspec.yml for a lifecycle event hook is not found at the expected path. The engineer should verify the file path defined in the appspec.yml to ensure it points to an existing executable script on the instance.

25
MCQeasy

A DevOps engineer needs to ensure that all API calls made to AWS are logged for compliance. The logs must be stored in S3 for at least 7 years. Which AWS service should they use?

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

CloudTrail records all AWS API calls and can deliver logs to S3 for long-term retention.

Why this answer

AWS CloudTrail is the correct service because it records all API calls made to AWS, including the identity, source IP, and timestamp, and can deliver log files to an S3 bucket for long-term retention. The requirement to store logs for at least 7 years aligns with CloudTrail's ability to integrate with S3 lifecycle policies for archival or deletion after a specified period.

Exam trap

The trap here is that candidates often confuse CloudTrail with CloudWatch Logs or AWS Config, thinking that any logging service can capture API calls, but only CloudTrail is designed specifically for auditing AWS API activity.

How to eliminate wrong answers

Option A is wrong because VPC Flow Logs capture network traffic metadata (IP addresses, ports, protocols) for VPCs, not API calls to AWS services. Option B is wrong because AWS Config records resource configuration changes and evaluates compliance rules, but it does not log API calls. Option C is wrong because Amazon CloudWatch Logs is designed for real-time monitoring and log storage from applications and AWS services, but it is not the primary service for auditing AWS API calls; CloudTrail is the dedicated service for that purpose.

26
MCQhard

A company wants to enforce that S3 buckets are not publicly accessible. Which AWS service can continuously monitor and automatically remediate non-compliant buckets?

A.AWS Config
B.Amazon Macie
C.AWS Security Hub
D.AWS Trusted Advisor
AnswerA

Config can evaluate rules and trigger remediation actions.

Why this answer

AWS Config can evaluate S3 bucket policies against managed rules like 's3-bucket-public-read-prohibited' and 's3-bucket-public-write-prohibited'. It can automatically remediate non-compliant buckets using AWS Systems Manager Automation or custom remediation actions. Option A is correct.

Amazon Macie is for sensitive data discovery, not for continuous monitoring of public access. AWS Security Hub aggregates security findings but does not automatically remediate. AWS Trusted Advisor provides checks but requires manual remediation.

27
MCQeasy

A company uses AWS Secrets Manager to store database credentials for a legacy application running on an on-premises server. The application retrieves the secret via the AWS SDK. Recently, the database password was rotated in Secrets Manager, but the application continued to use the old password and failed to connect. The application code is correct and uses the latest SDK. The IAM role attached to the server has the secretsmanager:GetSecretValue permission. What is the MOST likely cause?

A.The IAM role does not have permission to list secrets
B.The application is using the wrong secret ID
C.The secret rotation Lambda function is failing
D.The application is caching the secret and not refreshing it after rotation
AnswerD

Secrets Manager SDK caches credentials by default; the application may need to force refresh or wait for cache expiry.

Why this answer

The most likely cause is that the application is caching the secret and not refreshing it after rotation. By default, the AWS SDK for Secrets Manager caches secrets in memory for a configurable TTL (default 1 hour). Even though the secret is rotated in Secrets Manager, the application will continue to use the cached old secret until the cache expires or is explicitly refreshed.

Option A is incorrect because the IAM role has the required permission (secretsmanager:GetSecretValue) and listing secrets is not necessary for retrieval. Option B is unlikely because the application would fail immediately if using the wrong secret ID, not only after rotation. Option C is about the rotation Lambda function, but the application's failure to connect after rotation does not indicate the Lambda function itself is failing; rotation may have succeeded but the application is not fetching the new version.

28
Multi-Selectmedium

A company is deploying a serverless application using AWS Lambda, Amazon API Gateway, and Amazon DynamoDB. The application must be resilient to regional outages. Which THREE steps should the company take to achieve multi-Region resilience? (Choose THREE.)

Select 3 answers
A.Use Amazon CloudFront with multiple origins pointing to each Region's API Gateway.
B.Configure Route 53 with a failover routing policy to direct traffic to the secondary Region if the primary fails.
C.Use DynamoDB global tables to replicate data across Regions.
D.Deploy Lambda@Edge functions to handle requests at edge locations.
E.Deploy a second API Gateway and Lambda function in another Region.
AnswersB, C, E

Route 53 failover routing enables traffic redirection.

Why this answer

Amazon Route 53 with a failover routing policy allows the company to route traffic to a secondary Region when health checks detect a failure in the primary Region. This provides DNS-level failover, which is a fundamental component of multi-Region resilience for HTTP-based applications.

Exam trap

The trap here is that candidates often confuse CloudFront's origin failover capability (which requires manual configuration of origin groups) with automatic multi-Region failover, or they mistakenly believe Lambda@Edge can serve as a full application backend across Regions, when in fact it is limited to edge processing and cannot replace regional Lambda deployments.

29
MCQmedium

An EC2 instance shows as 'running' in the AWS console, but the system status check is 'impaired'. What is the most likely cause?

A.The instance's security group rules are blocking traffic.
B.The EBS root volume is corrupted.
C.The instance's operating system is not responding.
D.The underlying physical host has experienced a failure.
AnswerD

System status checks monitor the health of the physical host; impairment indicates host issues.

Why this answer

System status checks indicate problems with the underlying physical host, such as loss of network connectivity, power loss, or hardware failure. Option A is incorrect because security group rules affect network traffic but do not impact system status checks. Option B is incorrect because a corrupted EBS root volume would be detected by instance status checks, not system status checks.

Option C is incorrect because the operating system not responding would be reflected in instance status checks, which monitor OS-level issues.

30
MCQhard

Refer to the exhibit. The S3 bucket policy is applied to a bucket. An application attempts to upload an object to the bucket using HTTP (not HTTPS). What will happen?

A.The upload fails because the condition matches HTTP requests
B.The upload succeeds if the bucket also has an allow policy for the user
C.The upload succeeds because there is no explicit allow statement
D.The upload fails because the bucket policy does not allow any access
AnswerA

Deny applies when SecureTransport is false.

Why this answer

The bucket policy includes an explicit deny for all S3 actions when aws:SecureTransport is false (i.e., HTTP). This deny overrides any allow policies, so the upload fails. Option A is correct because the condition matches HTTP requests.

Option B is incorrect because the explicit deny overrides any allow. Option C is incorrect because the deny is explicit, so the condition is evaluated. Option D is incorrect because the policy only denies HTTP, not HTTPS.

31
MCQhard

A company runs a stateless web application on AWS Lambda behind an Application Load Balancer (ALB). During a deployment, the team updates the Lambda function to a new version. Some users report seeing the old version of the application for several minutes after the deployment. What is the MOST likely cause?

A.The Lambda function versions are not immutable, causing a gradual rollout.
B.Lambda@Edge is overriding the function version at the edge locations.
C.Amazon CloudFront is caching the old response and has not been invalidated.
D.The ALB target group is still pointing to the old Lambda function version due to connection draining.
AnswerD

Connection draining and warm-up can cause ALB to serve old versions until all connections are drained.

Why this answer

When an ALB is used with Lambda, the ALB invokes a specific Lambda function version or alias. If the deployment updates the Lambda function but the ALB target group alias is not updated atomically, or if connection draining keeps old connections active, some requests may still be routed to the old version. This can cause users to see the old application for several minutes.

Option A is wrong because Lambda versions are immutable, so gradual rollout is not related. Option B is wrong because Lambda@Edge is not used in this setup (the application runs behind an ALB, not CloudFront). Option C is wrong because CloudFront is not mentioned in the architecture—the traffic goes directly from ALB to Lambda.

32
Multi-Selecthard

A DevOps engineer is designing a centralized logging solution for 10 AWS accounts. Logs must be stored in a central S3 bucket with encryption and access logging. Which THREE services/resources are required to meet these requirements?

Select 3 answers
A.AWS Config.
B.AWS CloudTrail.
C.AWS KMS customer managed key.
D.Amazon CloudWatch Logs.
E.Amazon S3 server access logs.
AnswersB, C, E

CloudTrail can deliver logs to a central S3 bucket.

Why this answer

To meet the requirements, three services are needed: AWS CloudTrail for logging API activity across accounts and delivering logs to a central S3 bucket; AWS KMS customer managed key to encrypt the logs at rest in S3; and Amazon S3 server access logs to record requests made to the central S3 bucket for auditing. Option A (AWS Config) is not required for centralized logging; it focuses on resource configuration compliance, not log delivery. Option D (Amazon CloudWatch Logs) is not directly required for storage in S3, as CloudTrail can deliver directly to S3 without CloudWatch Logs.

33
MCQmedium

Refer to the exhibit. A DevOps engineer applies the IAM policy shown to an S3 bucket to enforce server-side encryption. However, users report that some uploads succeed without encryption. What is the most likely reason?

A.The resource ARN is incorrect; it should be the bucket ARN.
B.The policy only allows the action but does not deny actions that do not meet the condition.
C.The action should be s3:PutEncryptedObject instead of s3:PutObject.
D.The policy uses StringEquals instead of StringNotEquals.
AnswerB

Without an explicit Deny, other policies may allow uploads without encryption.

Why this answer

The IAM policy shown only allows the s3:PutObject action when the encryption condition is met, but it does not include a Deny statement to explicitly block uploads that do not satisfy the condition. In AWS IAM, an Allow statement alone does not prevent actions that fail the condition; it simply grants permission when the condition is true. Without a corresponding Deny, users with other permissions (e.g., from a broader policy) can still upload objects without encryption, as the Allow does not override other effective allows.

Exam trap

The trap here is that candidates assume an Allow statement with a condition implicitly denies requests that don't meet the condition, but AWS IAM requires an explicit Deny to block non-compliant actions.

How to eliminate wrong answers

Option A is wrong because the resource ARN in the policy (arn:aws:s3:::example-bucket/*) is correct for object-level operations like s3:PutObject, which require the object ARN (bucket/*), not just the bucket ARN. Option C is wrong because s3:PutEncryptedObject is not a valid AWS S3 action; the correct action is s3:PutObject, and encryption is enforced via conditions, not a separate action. Option D is wrong because using StringEquals is appropriate here to require the encryption header to equal 'AES256'; StringNotEquals would incorrectly allow uploads that do not specify encryption or specify a different value.

34
MCQmedium

Refer to the exhibit. A DevOps engineer ran the above AWS CLI command after a CloudFormation stack update. What does the status 'ROLLBACK_COMPLETE' indicate?

A.The stack update is in progress.
B.The stack was deleted successfully.
C.The stack was created successfully.
D.The stack update failed and CloudFormation reverted to the previous stack.
AnswerD

ROLLBACK_COMPLETE indicates a failed update with rollback.

Why this answer

The 'ROLLBACK_COMPLETE' status indicates that the CloudFormation stack update operation failed, and CloudFormation automatically reverted the stack to its previous stable state. This is a built-in safety mechanism: if any resource fails to update, CloudFormation triggers a rollback to undo all changes made during the update, ensuring the stack returns to its last known good configuration.

Exam trap

The trap here is that candidates confuse 'ROLLBACK_COMPLETE' with a successful operation or a deletion, when in fact it specifically means the update failed and the stack was reverted to its prior state.

How to eliminate wrong answers

Option A is wrong because 'ROLLBACK_COMPLETE' is a terminal state, not an in-progress state; an update in progress would show 'UPDATE_IN_PROGRESS' or 'UPDATE_ROLLBACK_IN_PROGRESS'. Option B is wrong because a successful deletion would show 'DELETE_COMPLETE', not 'ROLLBACK_COMPLETE'. Option C is wrong because a successful creation would show 'CREATE_COMPLETE', not 'ROLLBACK_COMPLETE'.

35
Matchingmedium

Match each AWS security and identity service to its function.

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

Concepts
Matches

Manages users, groups, roles, and permissions

Creates and manages encryption keys

Rotates and manages secrets like database credentials

DDoS protection service

Web application firewall

Why these pairings

IAM handles access control, AWS Organizations manages multi-account structure, and AWS Shield protects against DDoS attacks. The distractors incorrectly swap these definitions.

36
MCQmedium

A team uses AWS CloudFormation to manage a VPC with multiple subnets. They want to ensure that when a stack is updated, the update does not accidentally replace the VPC or any subnet. Which CloudFormation property should they set on the resources?

A.CreationPolicy
B.DependsOn
C.UpdateReplacePolicy
D.DeletionPolicy
AnswerC

UpdateReplacePolicy specifies what to do if a resource is replaced during an update; setting 'Retain' prevents deletion of the original resource.

Why this answer

The 'DeletionPolicy' attribute with 'Retain' keeps the resource if the stack is deleted, but does not prevent replacement during update. To prevent replacement, use 'UpdateReplacePolicy' with 'Retain', or design the template to avoid replacement. However, the most direct way is to use 'UpdateReplacePolicy'.

Option C is correct because it specifically handles update replacement.

37
MCQhard

Refer to the exhibit. An IAM policy is attached to a group. A user in the group tries to terminate an EC2 instance with the tag 'Environment=production' in us-east-1. What will happen?

A.The action is denied because the Deny statement explicitly denies the action for production instances.
B.The action is allowed because there is no explicit Deny for the user.
C.The action is denied only if the instance is in the us-east-1 region.
D.The action is allowed because the Allow statement grants ec2:TerminateInstances.
AnswerA

Correct. The Deny statement explicitly denies TerminateInstances for production instances, and explicit Deny overrides any Allow.

Why this answer

The Deny statement explicitly denies ec2:TerminateInstances for instances with the tag 'Environment=production', and an explicit Deny overrides any Allow. Option B is wrong because the Deny applies to the user via group membership. Option C is wrong because the Deny is not region-specific; it applies globally.

Option D is wrong because the Allow statement is overridden by the explicit Deny.

38
MCQeasy

A company uses AWS CloudTrail to record API calls across multiple accounts and regions. The security team needs to be alerted immediately when an IAM user creates a new access key. Which combination of services should be used to achieve this with minimal latency?

A.Send CloudTrail logs to CloudWatch Logs, create a metric filter, and set up a CloudWatch Alarm to publish to an SNS topic.
B.Enable S3 event notifications on the CloudTrail S3 bucket to trigger a Lambda function.
C.Use Amazon EventBridge to match the CloudTrail event and invoke an AWS Lambda function that sends an email.
D.Configure a Lambda function to poll the CloudTrail API every minute and check for new access keys.
AnswerA

This is the standard low-latency alerting pattern for CloudTrail events.

Why this answer

CloudTrail can stream logs to CloudWatch Logs, where a metric filter can be configured to match the 'CreateAccessKey' API call. This metric filter triggers a CloudWatch Alarm, which publishes to an SNS topic for immediate notification, providing minimal latency. Option B is incorrect because S3 event notifications on the CloudTrail bucket notify on object creation, but CloudTrail delivers log files in batches (e.g., every 5 minutes), causing delays beyond the required minimal latency.

Option C is incorrect because while Amazon EventBridge can match CloudTrail events in near real-time, the question's intended solution (and the one that best fits 'minimal latency') is the metric filter + alarm pattern; however, EventBridge is a valid alternative, but the correct answer as per options is A. Option D is incorrect because polling the CloudTrail API every minute is inefficient, introduces latency, and does not provide real-time alerting.

39
Matchingmedium

Match each AWS compute or container service with its description.

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

Concepts
Matches

Container orchestration service supporting Docker

Managed Kubernetes service

Serverless compute engine for containers

Serverless, event-driven compute service

Automatically adjusts EC2 capacity based on demand

Why these pairings

Correct matches: EC2 for virtual servers, ECS for Docker containers, EKS for Kubernetes, Lambda for serverless computing. Common confusions include mistaking EC2 as serverless or mixing up ECS and EKS.

40
MCQhard

A company uses an Application Load Balancer (ALB) to distribute traffic to a set of EC2 instances in an Auto Scaling group. During an incident, the DevOps team notices that the ALB is returning 503 errors. The instances are healthy according to the target group health checks. What is the MOST likely cause?

A.The ALB has no listeners configured.
B.The security group for the ALB is blocking traffic from the clients.
C.The ALB is throttling requests due to a surge.
D.The ALB's surge queue is full, causing it to reject requests.
AnswerD

When health checks pass but 503s persist, it is often due to the ALB's surge queue being full.

Why this answer

503 errors from an ALB typically indicate that the target group has no healthy instances, or all instances are marked unhealthy. However, the question says instances are healthy according to health checks, so the issue might be that the ALB itself is at capacity (e.g., surge queue full). The most common cause when health checks are passing but 503s persist is that the ALB's connection surge queue is full, often due to too many connections or slow targets.

Option A is wrong because an ALB with no listeners would return 502 or 504, not 503. Option B is wrong because security group rules usually cause timeouts, not 503. Option C is wrong because 503 is not a typical throttling response; throttling returns 429.

41
MCQmedium

During an incident, an engineer needs to quickly revoke access to a compromised IAM user. Which action should be taken FIRST?

A.Attach an AWS managed policy that explicitly denies all actions (e.g., AWSDenyAll).
B.Delete the IAM user immediately.
C.Disable the user's signing certificates.
D.Rotate the user's access keys.
AnswerA

A deny-all policy takes immediate effect, revoking all permissions.

Why this answer

Attaching a deny-all policy (e.g., AWSDenyAll) to the IAM user immediately revokes all permissions, including existing sessions, without risk of breaking dependencies. Deleting the user (B) may fail if the user is referenced by resources or logs, and it does not block existing sessions immediately. Disabling signing certificates (C) only affects programmatic access via CLI/SDK, leaving console sessions active.

Rotating access keys (D) invalidates old keys but does not affect existing sessions that already have credentials; sessions remain active until they expire. Therefore, the first action should be to apply a deny-all policy to instantly block all actions.

42
Multi-Selectmedium

A DevOps team is designing a monitoring solution for a multi-tier web application running on AWS. The application consists of an Application Load Balancer, EC2 instances in an Auto Scaling group, and an RDS database. Which TWO approaches provide centralized logging and monitoring across all tiers?

Select 2 answers
A.Enable AWS CloudTrail for all accounts and regions.
B.Configure all services to send logs to Amazon S3 and use Amazon Athena for ad-hoc querying.
C.Use AWS Config rules to monitor configuration changes across resources.
D.Enable VPC Flow Logs to capture network traffic.
E.Deploy the unified CloudWatch agent on all EC2 instances to collect system and application logs.
AnswersB, E

S3 can serve as a central log repository, and Athena can query logs across tiers using SQL.

Why this answer

Options B and E are correct. Option B: Sending logs to Amazon S3 and using Athena for ad-hoc queries allows centralized log storage and analysis across all tiers (ALB, EC2, RDS). Option E: Deploying the unified CloudWatch agent on EC2 instances collects system and application logs, sending them to CloudWatch Logs for centralized monitoring.

Option A is wrong because CloudTrail only records API calls, not application logs. Option C is wrong because AWS Config monitors resource configuration changes, not operational logs. Option D is wrong because VPC Flow Logs capture only network traffic metadata, not application logs.

43
MCQmedium

A company runs a microservices architecture on Amazon ECS with Fargate. Services communicate via an internal Application Load Balancer. Recently, one service became unavailable due to a memory leak, causing cascading failures in downstream services. What design change would MOST effectively improve resilience and limit the blast radius?

A.Increase the memory limit for each ECS task to accommodate memory leaks.
B.Implement circuit breaker patterns in the service discovery and client libraries to stop calling unhealthy services.
C.Enable connection draining on the ALB to allow in-flight requests to complete.
D.Implement automatic scaling policies for ECS services based on memory utilization.
AnswerB

Circuit breakers isolate failures and prevent cascading.

Why this answer

Implementing a circuit breaker pattern in service discovery and client libraries stops requests to unhealthy services, preventing cascading failures and limiting blast radius. Option A is wrong because increasing memory limits only delays the inevitable failure and does not prevent downstream services from being affected. Option C (connection draining) only affects in-flight requests during deregistration, not active health issues.

Option D (auto scaling) helps but does not stop requests from being sent to a failing service; scaling cannot fix a memory leak.

44
MCQmedium

An application running on Amazon ECS Fargate is experiencing intermittent 503 errors. The task definition sets a soft limit of 512 CPU units and 1024 memory. The errors occur when traffic spikes. Which change is most likely to resolve the issue?

A.Increase the soft CPU limit to 1024 units.
B.Change the soft memory limit to a hard limit.
C.Increase the desired task count in the service.
D.Increase the soft memory limit to 2048 MiB.
AnswerD

Provides more memory, reducing out-of-memory errors.

Why this answer

Increasing the soft memory limit provides more memory to the container, reducing the likelihood of out-of-memory errors causing 503s. Option A is wrong because increasing CPU units may help if the issue is CPU-bound, but memory is more likely the cause of 503 errors. Option B is wrong because increasing desired count helps with load distribution but not if each task is resource-constrained.

Option C is wrong because changing to hard limit may cause the task to be killed if it exceeds memory.

45
MCQmedium

A DevOps engineer needs to securely store and automatically rotate database credentials for a web application running on Amazon ECS. Which solution should be used?

A.Use AWS KMS to generate and rotate a data key for encrypting the credentials in a file on ECS.
B.Store the credentials in AWS Systems Manager Parameter Store as a SecureString. Use a Lambda function to rotate them.
C.Store the credentials in AWS Secrets Manager and configure rotation. Grant the ECS task IAM role permission to retrieve the secret.
D.Use AWS Certificate Manager to store the credentials as a certificate.
AnswerC

Secrets Manager supports automatic rotation and ECS can retrieve secrets.

Why this answer

AWS Secrets Manager can store database credentials and automatically rotate them on a schedule. The ECS task can retrieve the credentials using the Secrets Manager secret. Option C is correct.

Option A (AWS KMS) is for encryption keys, not credential rotation. Option B (SSM Parameter Store) can store secrets but does not support automatic rotation. Option D (AWS Certificate Manager) is for SSL/TLS certificates.

46
MCQmedium

A DevOps engineer needs to encrypt data at rest in an Amazon S3 bucket that stores sensitive customer information. The company requires that the encryption key be managed by AWS and rotated automatically. Which encryption option should be used?

A.Server-side encryption with customer-provided keys (SSE-C)
B.Server-side encryption with AWS KMS managed keys (SSE-KMS) using a customer-managed key
C.Client-side encryption with an AWS KMS managed key
D.Server-side encryption with Amazon S3 managed keys (SSE-S3)
AnswerD

SSE-S3 uses AWS-managed keys with automatic rotation.

Why this answer

SSE-S3 uses AWS-managed keys and automatically rotates them, meeting the requirement. Option A (SSE-C) requires customer-managed keys and no automatic rotation. Option B (SSE-KMS with customer-managed key) does not automatically rotate unless configured.

Option D (client-side encryption) does not use AWS-managed keys.

47
MCQmedium

A large enterprise is using AWS CloudFormation to manage their infrastructure. They have a master template that orchestrates nested stacks for different components: VPC, application, and database. The VPC stack creates subnets, route tables, and security groups. The application stack creates EC2 instances and an Application Load Balancer. The database stack creates an RDS instance. The master template uses parameters to pass configuration values. Recently, when updating the application stack, the update failed because the security group ID from the VPC stack changed, and the application stack references the old security group ID. The team wants to ensure that when the VPC stack is updated, dependent stacks are automatically updated to use the new outputs. Which approach should they take?

A.Use the Fn::ImportValue intrinsic function in the application stack to import the security group ID from the VPC stack's exports.
B.Use the Fn::GetAtt intrinsic function in the application stack to directly reference the security group from the VPC stack.
C.Hardcode the security group ID in the application template to avoid changes.
D.Configure the master template to automatically update all nested stacks whenever any output changes.
AnswerA

Fn::ImportValue allows stacks to reference exported outputs from other stacks.

Why this answer

Using Fn::ImportValue to import exported outputs from the VPC stack ensures that the application stack always gets the latest security group ID. When the VPC stack is updated, it exports the new security group ID, and the application stack automatically references the updated value during its next update. Option B (Fn::GetAtt) is incorrect because it can only reference resources within the same stack or directly from nested stacks (if the master template uses Fn::GetAtt to access outputs of nested stacks), but in this scenario, the stacks are separate nested stacks managed by the master template, and cross-stack references are best handled via exports/imports.

Option C (hardcoding) is error-prone and not scalable. Option D is incorrect because CloudFormation does not automatically update nested stacks; the master template must be updated to trigger updates to dependent stacks, and using exports/imports ensures proper dependency resolution.

48
MCQmedium

A company wants to centralize IAM user management across multiple AWS accounts. The company currently uses individual IAM users in each account. What is the BEST practice for centralized access control?

A.Use AWS Organizations and AWS IAM Identity Center (AWS SSO) to manage users centrally.
B.Create the same IAM users in each account with identical permissions.
C.Create IAM roles in each account and allow cross-account access from a central account.
D.Use IAM federation with an external identity provider and assign permissions based on SAML attributes.
AnswerA

IAM Identity Center provides centralized user management and SSO.

Why this answer

AWS Organizations with IAM Identity Center (AWS SSO) enables centralized user management and single sign-on across multiple AWS accounts, eliminating the need to manage individual IAM users in each account. Option B is incorrect because creating the same IAM users in each account leads to duplication and inconsistent permissions. Option C is incorrect because cross-account roles still require local IAM users or federated identities to assume those roles, and do not provide centralized user management.

Option D is incorrect because IAM federation with an external IdP centralizes authentication but does not inherently manage users across accounts unless combined with AWS Organizations and IAM Identity Center.

49
Multi-Selectmedium

A company is designing a secure CI/CD pipeline. Which TWO actions should be taken to protect secrets (e.g., API keys) used in the pipeline? (Choose TWO.)

Select 2 answers
A.Encrypt secrets with AWS KMS and store the encrypted value in the source code
B.Store secrets in AWS Secrets Manager
C.Use IAM roles to grant the CI/CD service access to secrets
D.Store secrets in plaintext in the buildspec file
E.Pass secrets as environment variables in the build
AnswersB, C

Secrets Manager provides secure storage and rotation.

Why this answer

AWS Secrets Manager stores and rotates secrets securely. IAM roles should be used to grant access to secrets without hardcoding. Storing secrets in buildspec or environment variables is insecure.

Using KMS to encrypt secrets is good, but the question asks for TWO best practices: using Secrets Manager and IAM roles.

50
Multi-Selecteasy

A startup runs a stateless web application on AWS Elastic Beanstalk with a single environment. The application uses an Amazon RDS for MySQL database instance. The startup is preparing for a marketing campaign that is expected to increase traffic by 10x. The CTO is concerned about the application's ability to handle the load and wants to ensure high availability and resilience. The current architecture has a single RDS instance (db.t3.medium) and a single Elastic Beanstalk environment with one EC2 instance (t3.medium). The startup has a limited budget but wants to improve resilience without over-provisioning. Which combination of actions should the DevOps engineer recommend? (Choose THREE.)

Select 3 answers
A.Add an Amazon ElastiCache cluster to cache frequent database queries.
B.Use dedicated instances for the EC2 instances to ensure consistent performance.
C.Switch the Elastic Beanstalk environment to a load-balanced, auto-scaled environment with a minimum of 2 instances across 2 Availability Zones.
D.Enable Multi-AZ deployment for the RDS instance to provide a standby in another AZ.
E.Add Amazon RDS Proxy in front of the RDS instance to handle connection pooling.
AnswersC, D, E

Provides compute resilience and scalability.

Why this answer

Switching to a load-balanced, auto-scaled environment with a minimum of 2 instances across 2 Availability Zones improves availability and resilience by distributing traffic and providing failover capacity. Option D is correct because enabling Multi-AZ for RDS provides a standby replica in a different Availability Zone, ensuring automatic failover and high availability for the database. Option E is correct because Amazon RDS Proxy manages database connections efficiently, reducing connection overhead and improving scalability during traffic spikes.

Option A (ElastiCache) is an additional cost that may not be necessary if caching is not a primary concern; the focus should be on core resilience first. Option B (dedicated instances) adds unnecessary cost and does not directly address high availability or resilience.

Exam trap

A common pitfall is to over-invest in caching (ElastiCache) or instance performance (dedicated instances) before ensuring basic redundancy. The key is to first achieve multi-AZ deployment for both compute and database layers.

51
MCQeasy

The CloudFormation template in the exhibit deploys an S3 bucket with a bucket policy. After deployment, the DevOps team discovers that the bucket is publicly accessible. Which change should be made to prevent public access while allowing only authenticated users from a specific AWS account to read objects?

A.Enable AWS Organizations to block public access
B.Change the Principal to the AWS account ID of the allowed account
C.Change the Principal to "*" and add a condition for aws:SourceIp
D.Set the bucket's 'BlockPublicAccess' property to true
AnswerB

Restricts access to a specific account.

Why this answer

Changing the Principal to a specific AWS account ID ensures that only that account's IAM users/roles can access the bucket, preventing public access. Option A is incorrect because AWS Organizations does not directly block public access at the bucket level; it can set service control policies but not a bucket policy. Option C is incorrect because using Principal "*" with a condition for aws:SourceIp still allows any user with that IP (including unauthenticated) to access, and it does not restrict to a specific AWS account.

Option D is incorrect because setting BlockPublicAccess to true would block all public access, including the intended access from the specific account, which is not the goal.

52
MCQeasy

A DevOps team is deploying a new web application on AWS Elastic Beanstalk. They want to monitor the application's health and receive notifications when the environment's health status changes to 'Degraded' or 'Severe'. What is the simplest way to achieve this?

A.Use the Elastic Beanstalk management console to manually check the health status twice a day.
B.Create a CloudWatch alarm on the 'EnvironmentHealth' metric published by the Elastic Beanstalk environment.
C.Write a custom script that polls the Elastic Beanstalk DescribeEnvironmentHealth API and sends an email using Amazon SES.
D.Configure an AWS CloudTrail trail to monitor Elastic Beanstalk API calls and create a CloudWatch alarm on the trail.
AnswerB

Elastic Beanstalk publishes health metrics to CloudWatch; an alarm can trigger notifications.

Why this answer

The simplest way is to create a CloudWatch alarm on the 'EnvironmentHealth' metric that Elastic Beanstalk automatically publishes to CloudWatch (Option B). This allows you to receive notifications when health status changes to 'Degraded' or 'Severe'. Option A is not automated; manual checking is not effective.

Option C adds unnecessary complexity with custom scripts and SES. Option D is incorrect because CloudTrail monitors API calls, not health status.

53
Multi-Selectmedium

A company uses AWS CloudTrail to log API calls. The security team needs to be alerted when an IAM user performs a ConsoleLogin event from an IP address outside the corporate network. Which TWO steps should be taken to achieve this? (Choose TWO.)

Select 2 answers
A.Create a CloudWatch Events rule that matches ConsoleLogin and publishes to an SNS topic.
B.Create an AWS Config rule to detect ConsoleLogin.
C.Configure S3 event notifications on the CloudTrail bucket.
D.Use CloudWatch Logs Insights to query for ConsoleLogin events.
E.Enable CloudTrail to log management events.
AnswersA, E

Real-time alerting based on event pattern.

Why this answer

CloudTrail logs management events like ConsoleLogin, and a CloudWatch Events rule can match that event and trigger an SNS notification for alerting. Option E is correct because CloudTrail must be enabled to log management events (which is the default, but must be ensured). Option B is wrong because AWS Config rules evaluate resource configurations, not API calls like ConsoleLogin.

Option C is wrong because S3 event notifications are for object creation in S3, not for CloudTrail log delivery events. Option D is wrong because CloudWatch Logs Insights is a query tool for analyzing logs, not for real-time alerting; alerting requires CloudWatch Events or metric filters with alarms.

54
MCQmedium

A company uses AWS CodeDeploy to deploy a web application to an Auto Scaling group of Amazon EC2 instances. The deployment fails with the error 'The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems.' The application is deployed to the instances using an in-place deployment. The instances are running Amazon Linux 2. What should the DevOps engineer check first?

A.Check the security group rules for the EC2 instances.
B.Check the application's port availability.
C.Verify that the AWS CodeDeploy agent is installed and running on each EC2 instance.
D.Verify that the IAM instance profile associated with the instances has the correct permissions.
AnswerC

Without the agent, the instance cannot receive deployment instructions.

Why this answer

The error message indicates that individual instances failed deployment, which is most commonly caused by the AWS CodeDeploy agent not running or not being installed on the EC2 instances. For an in-place deployment on Amazon Linux 2, the CodeDeploy agent must be installed and actively running to receive and execute deployment commands from the CodeDeploy service. If the agent is missing or stopped, the instance cannot participate in the deployment, leading to the 'too many individual instances failed' error.

Exam trap

The trap here is that candidates often jump to IAM permissions (Option D) as the first troubleshooting step, but the error message's reference to 'individual instances failed' directly points to the agent not running on the instances, which is a more immediate and common cause than permission issues.

How to eliminate wrong answers

Option A is wrong because security group rules control network traffic to/from the instances, but they do not affect the CodeDeploy agent's ability to communicate with the service or execute deployment scripts; the agent uses HTTPS outbound to the CodeDeploy endpoints, which is typically allowed by default. Option B is wrong because port availability relates to the application's ability to serve traffic after deployment, not to the deployment process itself; the error occurs during deployment, not after the application starts. Option D is wrong because while the IAM instance profile must have correct permissions for the agent to call CodeDeploy APIs, the error message specifically points to individual instance failures, which is more directly tied to the agent's presence and operational status; incorrect permissions would typically cause a different error (e.g., 'AccessDeniedException') rather than a generic instance failure.

55
Multi-Selecteasy

A DevOps engineer is designing a monitoring solution for a multi-tier web application hosted on AWS. The application consists of an Application Load Balancer (ALB), a fleet of EC2 instances in an Auto Scaling group, and an Amazon RDS database. The engineer needs to monitor the health of each component and receive alerts when any component becomes unhealthy. Which of the following CloudWatch metrics should the engineer monitor? (Select THREE.)

Select 3 answers
A.RDS's ReadLatency metric.
B.Application Load Balancer's RequestCount metric.
C.EC2's StatusCheckFailed metric.
D.Application Load Balancer's HealthyHostCount metric.
E.RDS's DatabaseConnections metric.
AnswersC, D, E

Detects instance-level issues like hardware or software problems.

Why this answer

(EC2's StatusCheckFailed metric) is correct because it directly indicates whether an EC2 instance is healthy (e.g., hardware or OS issues). Option D (ALB's HealthyHostCount metric) is correct because it shows the number of registered targets that are considered healthy. Option E (RDS's DatabaseConnections metric) is correct because it can indicate if the database is overwhelmed or unavailable (e.g., reaching max connections).

Option A (RDS's ReadLatency) is incorrect because it measures performance, not health directly; a database can have high read latency but still be operational. Option B (ALB's RequestCount metric) is incorrect because it measures traffic volume, not the health of targets.

56
MCQhard

An application running on an EC2 instance in a private subnet needs to access an S3 bucket. The instance has an IAM role with S3 access. However, the application is failing with timeout errors. The security group allows all outbound traffic, and the NACL allows outbound ephemeral ports. What is the most likely cause?

A.No VPC endpoint for S3
B.Missing route in the route table to an Internet Gateway
C.IAM role does not have correct trust policy
D.Missing HTTP proxy configuration
AnswerA

A VPC endpoint enables private connectivity to S3 from a private subnet.

Why this answer

A VPC endpoint for S3 (Gateway or Interface) is needed for private subnet access to S3 without NAT. Without a VPC endpoint, the EC2 instance in a private subnet cannot reach S3, resulting in timeout errors. The security group and NACL settings are permissive, so they are not the issue.

Option B is incorrect because the instance is in a private subnet; routing to an Internet Gateway is not necessary and would require a NAT device. Option C is incorrect because the IAM role has the necessary S3 permissions. Option D is incorrect because no HTTP proxy is required for S3 access.

57
MCQeasy

A DevOps engineer sets up a CloudWatch dashboard to monitor an application's performance. The application runs on EC2 instances in an Auto Scaling group. The engineer wants to display the average CPU utilization across all instances in the group. Which CloudWatch metric and statistic should be used?

A.CPUUtilization metric with the Sum statistic, filtered by Auto Scaling group.
B.CPUUtilization metric with the Average statistic, filtered by Auto Scaling group.
C.StatusCheckFailed metric with the Average statistic, filtered by Auto Scaling group.
D.NetworkOut metric with the Average statistic, filtered by Auto Scaling group.
AnswerB

Average statistic with the Auto Scaling group dimension gives the average CPU across all instances.

Why this answer

The CPUUtilization metric with the Average statistic across the Auto Scaling group provides the desired average. Option A is wrong because the Sum statistic would total the CPU across instances, not average. Option C is wrong because NetworkOut is not CPU-related.

Option D is wrong because StatusCheckFailed is a different metric.

58
Multi-Selecthard

A DevOps engineer is managing a CI/CD pipeline using AWS CodePipeline with multiple stages: Source (CodeCommit), Build (CodeBuild), Test (CodeBuild), and Deploy (CodeDeploy). The engineer wants to add manual approval steps before the Test and Deploy stages. Additionally, the pipeline should automatically roll back the deployment if the Deploy stage fails. Which two actions should the engineer take to implement these requirements? (Choose two.)

Select 2 answers
A.Add an Approval action in the Test stage before the Test build action.
B.Insert a new stage between Build and Test, and add an Approval action to that stage.
C.In the CodeDeploy deployment group configuration, enable automatic rollback for deployment failure.
D.Add a Lambda function in the pipeline that triggers a rollback if the Deploy stage fails.
E.Configure the pipeline's Deploy stage to have a 'Rollback' action that runs on failure.
AnswersB, C

Why this answer

Manual approval actions in AWS CodePipeline must be added as a separate stage, not within an existing stage. By inserting a new stage between Build and Test and adding an Approval action, the pipeline pauses before the Test stage, allowing manual review. Option C is correct because CodeDeploy deployment groups support automatic rollback on deployment failure, which can be enabled in the deployment group configuration to revert to the last known good revision.

Exam trap

The trap here is that candidates often think approval actions can be inserted within an existing stage (like before a build action) or that rollback can be implemented as a pipeline action, rather than understanding that approvals require a separate stage and rollback is a deployment group configuration in CodeDeploy.

Why the other options are wrong

A

Approval actions are separate stages, not part of the same stage as build.

D

CodePipeline does not have a native rollback; rely on CodeDeploy's rollback feature.

E

CodePipeline does not support a rollback action type.

59
MCQhard

A company's security team notices that an IAM user has permissions to terminate EC2 instances but should only be allowed to stop them. The current policy allows ec2:TerminateInstances. What is the most secure way to prevent termination while allowing stop?

A.Use an SCP to deny ec2:TerminateInstances for the entire account.
B.Modify the existing policy to include ec2:StopInstances and remove ec2:TerminateInstances.
C.Add a Deny statement for ec2:TerminateInstances with a condition for the user's ARN.
D.Attach a separate managed policy that denies ec2:TerminateInstances to the user.
AnswerC

Explicitly denies termination for that user while allowing stop via other policies.

Why this answer

The most secure because adding a Deny statement for ec2:TerminateInstances with a condition for the user's ARN explicitly blocks the termination action, regardless of any other policies that might allow it. Option A is wrong because an SCP affects the entire account, not just the user, and may be too broad. Option B is wrong because simply modifying the policy to include ec2:StopInstances and remove ec2:TerminateInstances does not prevent termination if the user has other policies that grant ec2:TerminateInstances.

Option D is wrong because attaching a separate Deny policy is effective but less direct and more complex than adding a Deny in the same policy.

60
MCQeasy

A company uses AWS CodePipeline to automate builds and deployments. The pipeline has a source stage (Amazon S3) and a build stage (AWS CodeBuild). The build stage is failing with the error: 'Error: Unable to download artifact from S3: Access Denied'. The artifacts are stored in an S3 bucket that is encrypted with AWS KMS. The CodeBuild service role has permissions to read from the S3 bucket and use the KMS key. The team checks that the S3 bucket policy and the KMS key policy allow the CodeBuild role. What is the most likely cause of the failure?

A.The S3 bucket does not have versioning enabled, so CodeBuild cannot retrieve the artifact.
B.The KMS key policy does not grant 'kms:Decrypt' permission to the CodeBuild service role.
C.The CodePipeline service role does not have permission to pass the artifact to CodeBuild.
D.The artifact is stored in the same S3 bucket used by CodePipeline for its artifacts, causing a conflict.
AnswerB

Correct: CodeBuild needs decrypt permission to read encrypted artifacts.

Why this answer

CodeBuild needs 'kms:Decrypt' permission to decrypt the artifact encrypted with AWS KMS. The error 'Access Denied' when downloading the artifact from S3 indicates that the CodeBuild service role can access the S3 bucket but cannot decrypt the KMS-encrypted object. Option A is incorrect because bucket versioning is not required for CodeBuild to retrieve artifacts; versioning is optional.

Option C is incorrect because the pipeline service role does not interact directly with the artifact download; CodeBuild uses its own role. Option D is incorrect because using the same bucket for pipeline artifacts and source artifacts is allowed and does not cause access denied errors.

61
Multi-Selecteasy

A company wants to design a highly available web application using AWS services. The application must be resilient to the failure of an entire AWS Region. Which THREE components should the architecture include? (Choose THREE.)

Select 3 answers
A.An Application Load Balancer (ALB) deployed in one Region.
B.Amazon Route 53 with a failover routing policy.
C.Auto Scaling groups in each Region with appropriate instance types.
D.Amazon EC2 instances in a single Region.
E.Amazon RDS Multi-AZ deployment with a cross-Region read replica.
AnswersB, C, E

Failover routing directs traffic to a secondary Region if the primary fails.

Why this answer

Amazon Route 53 with a failover routing policy is correct because it enables DNS-based health checking and automatic traffic routing to a secondary region when the primary region becomes unavailable. This is essential for cross-region disaster recovery, as Route 53 can monitor endpoint health and update DNS records to direct users to the healthy region, ensuring application availability despite a full region failure.

Exam trap

The trap here is that candidates often confuse Multi-AZ deployments (which provide high availability within a single Region) with cross-Region disaster recovery, and they may incorrectly assume that a single-Region ALB or EC2 instances can survive a full Region failure without a multi-Region architecture.

62
MCQeasy

A company wants to centrally manage and audit access to AWS KMS keys across multiple accounts. Which AWS feature should be used?

A.AWS Config aggregated rules
B.Cross-account IAM roles
C.AWS CloudTrail with organization trail
D.AWS Organizations tag policies
AnswerC

Organization trails aggregate logs from all accounts.

Why this answer

AWS CloudTrail with an organization trail can log all API calls, including KMS key usage, across multiple accounts in an AWS Organization. This provides centralized audit logging for KMS key access. Option A (AWS Config aggregated rules) can evaluate resource compliance but does not audit key usage.

Option B (Cross-account IAM roles) allows access but not centralized auditing. Option D (AWS Organizations tag policies) manage tags, not auditing. Therefore, option C is correct.

63
MCQmedium

A company runs a serverless application using AWS Lambda, Amazon API Gateway, and Amazon DynamoDB. The application is used by thousands of users. Recently, the operations team noticed an increase in 5xx errors from API Gateway. The team has enabled CloudWatch Logs for the Lambda functions and API Gateway. They see the errors are sporadic and not correlated with high traffic. The Lambda function's error count in CloudWatch is also increasing. The team wants to identify the specific requests that are failing and understand the error details. Which solution should the team implement?

A.Use CloudWatch Logs Insights to query the Lambda logs for ERROR messages and correlate with API Gateway logs
B.Enable VPC Flow Logs for the Lambda function's VPC to capture network traffic
C.Enable AWS X-Ray active tracing on the Lambda functions and API Gateway to capture detailed request traces and error details
D.Enable AWS CloudTrail to log API Gateway API calls and analyze the logs
AnswerC

X-Ray provides end-to-end visibility and error identification.

Why this answer

AWS X-Ray provides end-to-end tracing for requests through API Gateway and Lambda, capturing error details and metadata for individual requests. This allows the team to identify specific failing requests and understand error causes. Option A is wrong because CloudWatch Logs Insights can query logs, but it lacks automated tracing and correlation for distributed requests, making it less efficient.

Option B is wrong because VPC Flow Logs capture network traffic metadata, not application-level errors. Option D is wrong because CloudTrail logs API calls at the AWS account level, not application request details.

64
MCQmedium

Refer to the exhibit. The DevOps engineer runs the commands and sees the output. What is the most likely issue with the instance?

A.The underlying hardware is having issues (system status check failed).
B.The instance is healthy and no issues exist.
C.The instance is stopped.
D.The instance has a failed status check due to OS-level issues.
AnswerA

SystemStatus is impaired, indicating hardware issues.

Why this answer

The SystemStatus is 'impaired', indicating a problem with the underlying physical host (system status check failed). The InstanceStatus is 'ok', so the OS is functioning normally. Option B is incorrect because the system status check shows impairment, so there is an issue.

Option C is incorrect because the instance is running, not stopped. Option D is incorrect because the impairment is at the system level, not the OS level.

65
Multi-Selectmedium

A company runs a critical application on Amazon ECS with Fargate launch type. During an incident, the DevOps engineer notices that tasks are failing with 'CannotPullContainerError: API error (500)'. Which TWO steps should the engineer take to resolve this issue?

Select 2 answers
A.Attach an EBS volume to the Fargate task for caching.
B.Check that the ECS service role has the required permissions.
C.Ensure that the ECR repository policy allows the task execution role to pull images.
D.Increase the task memory to accommodate the image pull.
E.Verify that the task execution IAM role has the necessary permissions to pull from Amazon ECR.
AnswersC, E

Repository policy may block the pull if not configured correctly.

Why this answer

Options C and E are correct. When a Fargate task fails with 'CannotPullContainerError: API error (500)', it typically indicates an issue with pulling the container image from Amazon ECR. The task execution IAM role (E) must have the necessary permissions (ecr:GetDownloadUrlForLayer, ecr:BatchGetImage, ecr:BatchCheckLayerAvailability) to pull images from ECR.

Additionally, if the image resides in a private ECR repository, the repository policy (C) must allow the task execution role to perform those actions. Option A is wrong because Fargate does not support attaching EBS volumes; it stores image layers ephemerally. Option B is incorrect because the ECS service role is used for load balancer integration, not for pulling images.

Option D is incorrect because increasing task memory does not fix image pull errors; memory affects running tasks, not the pull process.

66
Multi-Selecteasy

A company is using AWS CodeDeploy to deploy an application to an Auto Scaling group. The deployment is failing because the new instances are not passing the health checks. The team wants to automatically roll back the deployment if health checks fail. Which THREE steps should the team take?

Select 3 answers
A.Use a deployment configuration with a high minimum healthy host percentage.
B.Create a CloudWatch alarm based on the ELB health check metric.
C.Configure the deployment group to automatically roll back when a deployment fails.
D.Configure the Auto Scaling group to use an ELB health check with a sufficient grace period.
E.Store the deployment artifacts in an S3 bucket with versioning enabled.
AnswersB, C, D

Correct: Alarm can trigger rollback.

Why this answer

Creating a CloudWatch alarm based on the ELB health check metric allows you to monitor the health of instances in the Auto Scaling group. When the alarm triggers due to failed health checks, it can be used in conjunction with an automatic rollback configuration to revert the deployment to the previous revision. This ensures that unhealthy instances are detected early and the deployment is rolled back automatically, minimizing downtime.

Exam trap

The trap here is that candidates often think that simply enabling automatic rollback on deployment failure (Option C) is sufficient, but they miss that you must also configure a CloudWatch alarm (Option B) to detect health check failures that occur after the deployment completes, because a deployment can succeed initially but then fail health checks later.

67
MCQhard

A DevOps engineer needs to ensure that an S3 bucket policy enforces encryption in transit for all access. Which policy statement should be added?

A.{"Effect":"Deny","Condition":{"StringEquals":{"aws:SecureTransport":"true"}}}
B.{"Effect":"Allow","Condition":{"Bool":{"aws:SecureTransport":"false"}}}
C.{"Effect":"Allow","Condition":{"Bool":{"aws:SecureTransport":"true"}}}
D.{"Effect":"Deny","Condition":{"Bool":{"aws:SecureTransport":"false"}}}
AnswerD

Denies access when SecureTransport is false, effectively requiring HTTPS.

Why this answer

To enforce encryption in transit, use a condition that denies access unless the request uses 'aws:SecureTransport' set to 'true'. This requires a Deny effect with the condition.

68
MCQhard

An organization uses AWS Elastic Beanstalk to deploy a web application. The deployment fails with a '502 Bad Gateway' error after the environment update. The health status shows 'Severe'. Investigation reveals that the application is not binding to the port that the nginx proxy expects. What is the most efficient way to diagnose and resolve this issue?

A.Rebuild the environment with a larger instance type to handle the load.
B.Use the Elastic Beanstalk console to update the environment's software configuration.
C.Review the application logs in CloudWatch Logs for error messages.
D.Check the application's listening port by viewing the nginx configuration files in the platform hooks and ensure the app listens on the expected port (e.g., 8080).
AnswerD

Elastic Beanstalk's nginx proxy forwards requests to the application on a specific port (usually 8080). If the app listens on a different port, it causes 502 errors.

Why this answer

The 502 Bad Gateway error in Elastic Beanstalk typically occurs when the nginx reverse proxy cannot forward requests to the application because the application is not listening on the expected port (default 8080). Checking the nginx configuration files in the platform hooks and verifying the application's listening port directly addresses the root cause, as the proxy expects the app to bind to a specific port. This is the most efficient diagnostic step because it targets the exact mismatch between the proxy and the application.

Exam trap

The trap here is that candidates assume a 502 error always indicates an application crash or resource exhaustion, leading them to check logs or scale up, rather than recognizing it as a proxy-to-application port mismatch that is best diagnosed by examining the nginx configuration and application binding.

How to eliminate wrong answers

Option A is wrong because increasing instance size addresses resource constraints (e.g., CPU/memory), not a port binding misconfiguration; a larger instance will still fail if the app doesn't listen on the expected port. Option B is wrong because updating software configuration via the console (e.g., environment properties) does not directly fix the application's listening port; the app must be coded to bind to the correct port. Option C is wrong because while CloudWatch Logs can show application errors, the most efficient first step is to check the nginx configuration and application port directly, as the 502 error is a proxy-level issue, not necessarily an application error.

69
Multi-Selecthard

A company has an IAM policy that allows users to manage their own passwords and MFA devices. The policy includes a condition that requires MFA for all API operations except for changing passwords and MFA. Which THREE statements are true about this policy? (Choose THREE.)

Select 3 answers
A.The policy creates an IAM role for MFA enforcement.
B.The policy applies to the AWS account root user.
C.The policy uses NotAction to exclude password and MFA actions.
D.The policy uses the aws:MultiFactorAuthPresent condition key.
E.The policy must be attached to IAM users or groups.
AnswersC, D, E

NotAction allows those actions without MFA.

Why this answer

Options C, D, and E are correct. The policy uses NotAction to exclude password and MFA actions from the MFA requirement, and uses the aws:MultiFactorAuthPresent condition key to require MFA for all other actions. The policy must be attached to IAM users or groups to take effect.

Option A is incorrect because the policy is an identity-based policy, not a role. Option B is incorrect because IAM policies do not apply to the root user.

70
MCQeasy

A DevOps engineer is configuring AWS Config rules to detect non-compliant security groups. The rule should trigger if any security group allows inbound SSH (port 22) from 0.0.0.0/0. Which AWS managed Config rule should be used?

A.vpc-sg-open-only-to-authorized-ports
B.ec2-security-group-attached-to-eni
C.restricted-ssh
D.incoming-ssh-disabled
AnswerC

Checks for SSH from 0.0.0.0/0.

Why this answer

'restricted-ssh' is the managed rule that checks for SSH access from 0.0.0.0/0. Option A is wrong because 'vpc-sg-open-only-to-authorized-ports' is not specific to SSH. Option B is wrong because 'ec2-security-group-attached-to-eni' checks attachment, not rules.

Option D is wrong because 'incoming-ssh-disabled' is not a managed rule.

71
MCQmedium

An IAM policy attached to a user is shown in the exhibit. The user reports that they are unable to delete an object in the 'example-bucket' bucket. What is the reason for this?

A.The resource ARN does not match the bucket name
B.The explicit Deny statement overrides the Allow
C.The user does not have permissions to perform s3:DeleteObject
D.The policy has a syntax error
AnswerB

Deny always takes precedence over Allow.

Why this answer

An explicit Deny overrides any Allow. The Deny action s3:DeleteObject explicitly denies the delete, even though the Allow all s3 actions includes delete. Option A is wrong because the resource ARN matches.

Option C is wrong because the policy allows all s3 actions, but the Deny blocks delete. Option D is wrong because the policy is valid.

72
MCQmedium

The IAM policy above is attached to a user. The user tries to stop an EC2 instance. What will happen?

A.The user is denied due to an implicit deny.
B.The user cannot stop the instance because there is no explicit allow for all instances.
C.The user cannot stop the instance because the Deny statement overrides the Allow.
D.The user can stop the instance.
AnswerD

Explicit allow for StopInstances.

Why this answer

The policy includes an explicit Allow for ec2:StopInstances on all resources, and the Deny statement only applies to ec2:TerminateInstances. Since the user is attempting to stop (not terminate) the instance, the Allow applies and there is no applicable Deny, so the action is permitted. Therefore, the user can stop the instance.

73
MCQhard

A company uses AWS CloudTrail to log API calls. An IAM user's credentials are compromised, and the attacker launches multiple EC2 instances in regions that are not typically used. The security team wants to receive near-real-time notifications of any API calls from this user. What is the MOST effective solution?

A.Create an AWS Config rule that checks for EC2 instances in unauthorized regions
B.Configure CloudTrail to deliver logs to an S3 bucket and enable S3 event notifications to SQS
C.Create a CloudTrail trail that delivers to CloudWatch Logs, then set up a CloudWatch Events rule to invoke a Lambda function that sends an SNS notification
D.Use CloudWatch Logs Insights to query CloudTrail logs every 5 minutes and send results via email
AnswerC

This provides near-real-time notification.

Why this answer

CloudTrail can deliver logs to CloudWatch Logs in near real-time. A CloudWatch Events (now Amazon EventBridge) rule can then match API calls from the compromised user and trigger a Lambda function to send an SNS notification. Option A is incorrect because AWS Config rules check configuration compliance, not real-time API calls.

Option B is incorrect because S3 event notifications are not near-real-time and are typically for object-level events, not API call monitoring. Option D is incorrect because CloudWatch Logs Insights is for querying historical logs and requires manual intervention; it does not provide near-real-time notifications.

74
MCQmedium

Refer to the exhibit. After a deployment at 10:00, the error rate increases steadily. What is the MOST likely cause?

A.An external dependency became unavailable after the deployment.
B.A bug in the new release causes errors to accumulate over time.
C.The database connection limit was reached immediately after deployment.
D.The deployment triggered a scaling event that overloaded the application.
AnswerB

The steady increase suggests a defect that worsens with time, like a memory leak or resource exhaustion.

Why this answer

The error count increases after deployment and continues to rise, suggesting a code defect or configuration issue introduced by the deployment that causes progressively more errors (e.g., memory leak, connection pool exhaustion).

75
Multi-Selecteasy

A team uses AWS CodeBuild to build a Node.js application. The buildspec.yml file is at the root of the repository. The build fails with 'Error: Cannot find module 'aws-sdk''. Which TWO actions could resolve the issue? (Choose TWO.)

Select 2 answers
A.Ensure 'aws-sdk' is listed in the 'dependencies' section of package.json.
B.Specify a different Node.js runtime version in the buildspec.
C.Add a 'pre_build' phase that runs 'npm test'.
D.Add a 'install' phase that runs 'npm install'.
E.Add a 'build' phase command to compile the code.
AnswersA, D

Without it, npm install will not install aws-sdk.

Why this answer

The 'aws-sdk' module must be declared in the 'dependencies' section of package.json for npm to install it during the build. Without this declaration, npm install will not download the module, causing the 'Cannot find module' error at runtime. Option D is correct because CodeBuild does not automatically run npm install; you must explicitly include an 'install' phase in buildspec.yml to execute 'npm install' and populate node_modules.

Exam trap

The trap here is that candidates assume CodeBuild automatically runs 'npm install' or that the 'aws-sdk' is always available in the build environment, when in fact both the dependency declaration and explicit install phase are required.

Page 1 of 11

Page 2

All pages