Courseiva

AWS Certified Developer Associate DVA-C02 (DVA-C02) — Questions 451525

724 questions total · 10pages · All types, answers revealed

Page 6

Page 7 of 10

Page 8
451
MCQhard

A company is using AWS CodeDeploy with an in-place deployment to an Auto Scaling group. The deployment fails with the error 'Deployment failed because the deployment group does not have enough instances to deploy to'. The Auto Scaling group has a minimum size of 2, maximum size of 5, and desired capacity of 2. The deployment configuration is CodeDeployDefault.AllAtOnce. What is the most likely cause?

A.The Auto Scaling group needs to have at least 3 instances to use AllAtOnce.
B.The deployment configuration is not compatible with Auto Scaling groups.
C.The instances in the Auto Scaling group are not passing health checks.
D.The deployment group has only 2 instances, and the deployment failed on one instance, causing the minimum healthy hosts threshold to be violated.
AnswerC

Correct. If instances fail health checks, they are not considered healthy, leading to zero healthy instances in the deployment group, which causes this error.

Why this answer

The error 'Deployment failed because the deployment group does not have enough instances to deploy to' occurs when there are zero healthy instances in the deployment group at the start of deployment. With CodeDeployDefault.AllAtOnce, the minimum number of healthy hosts is 0, so a single instance failure during deployment would not trigger this error. The most likely cause is that the instances in the Auto Scaling group are not passing health checks, resulting in no healthy instances available for deployment.

Option C is correct.

Exam trap

Candidates often misinterpret this error as a sizing or threshold issue, but it actually indicates that no healthy instances exist at deployment start, typically due to health check failures.

How to eliminate wrong answers

Option A is wrong because CodeDeployDefault.AllAtOnce does not require a minimum of 3 instances; it deploys to all instances simultaneously and the minimum healthy hosts threshold is 0, meaning it can work with any number of instances as long as at least one remains healthy. Option B is wrong because CodeDeployDefault.AllAtOnce is fully compatible with Auto Scaling groups; in-place deployments to Auto Scaling groups are a standard use case for CodeDeploy. Option C is wrong because the error message specifically indicates a lack of instances to deploy to, not a health check failure; while health check failures could cause instances to be terminated, the error here is about the deployment group size, not instance health status.

452
MCQmedium

A developer is using AWS AppSync to build a GraphQL API. The API needs to allow clients to receive real-time updates when data changes in a DynamoDB table. Which AppSync feature should the developer use?

A.Resolvers
B.Subscriptions
C.Queries
D.Mutations
AnswerB

AWS AppSync subscriptions are specifically designed to provide real-time, push-based data updates to clients. They leverage WebSockets to maintain a persistent connection, allowing the AppSync service to notify subscribed clients immediately when relevant data changes occur, typically triggered by a GraphQL mutation. This mechanism ensures that clients automatically receive new or modified data without needing to repeatedly poll the API.

Why this answer

Subscriptions in AWS AppSync are the feature designed for real-time updates. They use WebSocket connections to push data to clients automatically when a mutation modifies the underlying data source, such as a DynamoDB table. By configuring a subscription on a specific mutation, the developer enables clients to receive live changes without polling.

Exam trap

The trap here is that candidates often confuse mutations (which trigger the update) with subscriptions (which deliver the update), leading them to select 'Mutations' instead of 'Subscriptions'.

How to eliminate wrong answers

Option A is wrong because resolvers are functions that map GraphQL operations (queries, mutations, subscriptions) to data sources like DynamoDB; they do not themselves provide real-time push capabilities. Option C is wrong because queries are request-response operations that fetch data on demand, not real-time updates. Option D is wrong because mutations are write operations that modify data; while they can trigger subscriptions, they are not the mechanism for delivering real-time updates to clients.

453
MCQmedium

A developer is using AWS CodeBuild to build a Java application. The build succeeds locally but fails in CodeBuild with the error 'BUILD FAILED: Unable to find a Java installation.' The buildspec.yml file includes a 'runtime-versions' section specifying Java 11. The CodeBuild project uses the 'aws/codebuild/amazonlinux2-x86_64-standard:4.0' image. What is the MOST likely cause of the failure?

A.The runtime-versions section in buildspec.yml is not correctly formatted.
B.The CodeBuild project does not have sufficient permissions to download Java.
C.The buildspec.yml file is not in the root of the source directory.
D.The build commands reference a non-existent Maven dependency.
AnswerA

The runtime-versions section in buildspec.yml is crucial for specifying the language runtime environment, such as Java, that CodeBuild should provision. If this section contains incorrect YAML syntax or an unsupported version string, CodeBuild will fail to properly install or configure the specified Java Development Kit (JDK). This misconfiguration prevents the build environment from having the necessary Java runtime, leading to errors when build commands attempt to invoke Java or Maven.

Why this answer

The error 'Unable to find a Java installation' indicates that the CodeBuild environment does not have Java available at runtime. When using a standard managed image like 'aws/codebuild/amazonlinux2-x86_64-standard:4.0', Java must be explicitly declared in the 'runtime-versions' section of buildspec.yml. The most likely cause is that the 'runtime-versions' section is incorrectly formatted (e.g., using 'java: 11' instead of the correct 'java: corretto11'), causing CodeBuild to skip installing Java.

Exam trap

The trap here is that candidates assume 'java: 11' is a valid runtime identifier, but CodeBuild requires the exact runtime name (e.g., 'corretto11' or 'openjdk11'), and a formatting error in runtime-versions leads to a missing Java installation rather than a syntax error.

How to eliminate wrong answers

Option B is wrong because CodeBuild managed images already include the necessary package repositories and permissions to download and install runtimes specified in 'runtime-versions'; insufficient permissions would cause a different error (e.g., access denied to S3 artifacts). Option C is wrong because if the buildspec.yml were not in the root directory, CodeBuild would fail with a 'buildspec.yml not found' error, not a Java installation error. Option D is wrong because a non-existent Maven dependency would produce a Maven build error (e.g., 'Could not resolve dependency'), not a missing Java installation error.

454
MCQeasy

A developer needs to grant cross-account access to an S3 bucket owned by Account A to a user in Account B. Which approach is the most secure?

A.Create an IAM role in Account A with a trust policy allowing the user from Account B to assume it.
B.Share the access keys of an IAM user in Account A with the user in Account B.
C.Add a bucket policy in Account A that grants access to the user in Account B, and attach an IAM policy to the user in Account B allowing the S3 actions.
D.Attach an IAM policy to the user in Account B that grants access to the S3 bucket.
AnswerC

This is the most secure and recommended method for granting cross-account S3 access, adhering to the principle of least privilege. The bucket policy in Account A, a resource-based policy, explicitly grants permission to the specific IAM user (or role) in Account B to perform defined S3 actions on the bucket. Concurrently, an identity-based IAM policy attached to the user in Account B explicitly allows that user to perform those same S3 actions. Both policies must grant the necessary permissions for access to be successful, creating a robust and auditable access control mechanism.

Why this answer

The most secure because it combines a resource-based bucket policy in Account A that explicitly grants access to the user in Account B with an identity-based IAM policy attached to that user in Account B. This dual-policy approach ensures that the user can only access the bucket when both policies allow the action, following the principle of least privilege and avoiding the need to share long-term credentials.

Exam trap

The trap here is that candidates often assume an IAM policy in the target account alone is sufficient for cross-account S3 access, forgetting that the owning account must explicitly allow the access via a resource-based policy like a bucket policy.

How to eliminate wrong answers

Option A is wrong because creating an IAM role in Account A with a trust policy for the user in Account B would require the user to assume the role, which is a valid cross-account access method but is less direct and adds unnecessary complexity for simple S3 bucket access; it is not the most secure or straightforward approach for this specific scenario. Option B is wrong because sharing access keys of an IAM user in Account A with a user in Account B violates security best practices by exposing long-term credentials, increasing the risk of credential leakage and unauthorized access. Option D is wrong because attaching an IAM policy to the user in Account B alone cannot grant access to an S3 bucket in Account A; cross-account access requires a resource-based policy (bucket policy or ACL) in the owning account to explicitly allow the external user.

455
MCQeasy

A developer wants to debug an AWS Lambda function by viewing real-time logs. Which AWS service should the developer use?

A.Amazon CloudWatch Logs
B.AWS X-Ray
C.Amazon S3
D.AWS CloudTrail
AnswerA

Amazon CloudWatch Logs is the primary and automatic destination for AWS Lambda function execution logs. When a Lambda function runs, any output from `console.log` (Node.js), `print()` (Python), or similar logging statements in the function code is automatically streamed to a dedicated log group in CloudWatch Logs. Developers can then view these logs in real-time, filter them, and search for specific events or errors, making it essential for debugging application logic and understanding function behavior.

Why this answer

Amazon CloudWatch Logs is the correct service because AWS Lambda automatically streams all execution logs, including real-time output from console.log() statements and any errors, to CloudWatch Logs. The developer can use the CloudWatch Logs console or the `aws logs tail` command to view these logs in near real-time, enabling effective debugging of function behavior as it executes.

Exam trap

The trap here is that candidates often confuse AWS X-Ray's tracing capabilities with real-time log viewing, but X-Ray provides request-level traces and service maps, not the raw log output needed for debugging code execution.

How to eliminate wrong answers

Option B is wrong because AWS X-Ray is a distributed tracing service for analyzing and debugging request flows across microservices, not for viewing real-time log output from a single Lambda function. Option C is wrong because Amazon S3 is an object storage service and does not provide any capability for streaming or viewing real-time logs; it can store log files after they are generated but not display them live. Option D is wrong because AWS CloudTrail records API activity and management events for auditing, not the runtime logs or real-time output of a Lambda function's execution.

456
MCQhard

A developer is troubleshooting performance issues in an application that uses Amazon ElastiCache for Redis. The application experiences periodic latency spikes during peak hours. The developer checks CloudWatch metrics and sees that the 'Evictions' metric is consistently high and the 'CacheHitRate' metric is low. The cluster uses a single cache.t3.small node. Which action will most likely improve the cache hit rate and reduce latency?

A.Increase the number of replicas
B.Enable cluster mode and add more shards
C.Increase the TTL of cached items
D.Use a larger instance type
AnswerD

Upgrading to a larger instance type directly addresses memory constraints by providing a substantial increase in the node's available RAM. This vertical scaling approach immediately expands the cache's capacity, allowing more items to be stored without triggering eviction policies. It is a straightforward, non-disruptive operational change for ElastiCache, often involving a brief failover, and effectively resolves memory-related performance issues without requiring any application code modifications.

Why this answer

The symptoms—high evictions and low cache hit rate—indicate that the single cache.t3.small node is running out of memory. Using a larger instance type increases the available memory, allowing more data to be cached, reducing evictions, and improving the cache hit rate. This directly addresses the root cause of memory pressure without changing the cluster architecture or data expiration behavior.

Exam trap

The trap here is that candidates often confuse scaling out (adding replicas or shards) with scaling up (increasing instance size), but for a single-node cluster suffering from memory exhaustion, the most direct and effective solution is to increase memory capacity, not to add replicas or change the cluster mode.

How to eliminate wrong answers

Option A is wrong because increasing the number of replicas does not increase the total memory capacity of the cluster; replicas are read-only copies that improve read scalability and fault tolerance, but they share the same memory limit as the primary node, so evictions and cache hit rate remain unchanged. Option B is wrong because enabling cluster mode and adding more shards distributes data across multiple nodes, which can increase total memory, but it requires application changes to support sharding and is more complex than simply scaling up the instance size; the immediate, simplest fix for a single-node cluster under memory pressure is to increase memory. Option C is wrong because increasing the TTL of cached items only delays their expiration, but if the cache is already full and evicting items due to memory pressure, longer TTLs will not prevent evictions—they may even worsen the problem by keeping stale data in memory longer.

457
MCQeasy

A developer is using AWS CodeDeploy to deploy a revision to an EC2/On-Premises deployment group. The deployment fails because the specified deployment configuration requires a minimum of 1 healthy host, but the deployment group has 0 instances. What is the most likely cause?

A.The deployment group is not associated with any Auto Scaling group.
B.The deployment configuration requires too many healthy hosts.
C.The CodeDeploy agent is not installed on the instances.
D.The deployment group does not have any Amazon EC2 instances registered.
AnswerD

A CodeDeploy deployment group must have target Amazon EC2 instances explicitly registered with it, either individually or dynamically via an Auto Scaling group, for a deployment to proceed. If no instances are associated with or discovered by the deployment group, CodeDeploy has no endpoints to send the application revision to. Consequently, the deployment will fail immediately because there are simply no target hosts available to receive the deployment, regardless of deployment configuration or agent status. This is a foundational requirement for any deployment.

Why this answer

The deployment failed because the deployment group had zero registered instances, making it impossible to meet the minimum of 1 healthy host required by the deployment configuration. Option D is correct because the error message directly indicates that the deployment group contains no EC2 instances, so there are no hosts to deploy to.

Exam trap

The trap here is that candidates often assume the error is due to a missing CodeDeploy agent or an Auto Scaling group requirement, but the specific error message 'minimum of 1 healthy host' with '0 instances' directly points to an empty deployment group.

How to eliminate wrong answers

Option A is wrong because a deployment group does not need to be associated with an Auto Scaling group; it can contain manually registered EC2 instances or on-premises instances, and the lack of an Auto Scaling group does not cause a '0 instances' error. Option B is wrong because the deployment configuration requiring a minimum of 1 healthy host is not excessive; it is the standard minimum, and the issue is that there are zero hosts, not that the requirement is too high. Option C is wrong because the CodeDeploy agent not being installed would cause a different error (e.g., 'agent not reachable' or 'timeout') during deployment, not a failure due to zero instances in the group.

458
MCQhard

A developer is using AWS Secrets Manager to rotate database credentials automatically. The rotation fails with the error 'The secret value is not valid JSON.' What is the most likely cause?

A.The secret is in a different AWS region than the Lambda rotation function.
B.The secret value was stored as a plain string instead of a JSON object.
C.The secret name is not base64-encoded.
D.The secret does not have the correct version label.
AnswerB

AWS Secrets Manager automatic rotation functions, typically implemented as Lambda functions, are designed to parse specific key-value pairs from the secret string to perform database credential updates. When a secret value is stored as a plain string, such as 'myPassword123', the Lambda function cannot extract required components like 'username', 'password', 'host', or 'port' because the expected JSON structure is absent. This lack of structured data prevents the rotation function from successfully connecting to the database and updating the credentials, leading to a rotation failure.

Why this answer

AWS Secrets Manager requires secret values to be stored as valid JSON objects when automatic rotation is configured. If the secret is stored as a plain string (e.g., a single password string without key-value pairs), the rotation function cannot parse it, resulting in the 'The secret value is not valid JSON' error. This is because the Lambda rotation function expects to read and write a JSON structure to manage the credentials during rotation.

Exam trap

The trap here is that candidates may confuse the JSON validation error with other rotation failures, such as network issues or permission errors, but the specific error message 'The secret value is not valid JSON' directly points to the secret's format being incorrect.

How to eliminate wrong answers

Option A is wrong because the Lambda rotation function and the secret must be in the same AWS region; cross-region rotation is not supported, but this would cause a different error (e.g., 'AccessDenied' or 'ResourceNotFoundException'), not a JSON parsing error. Option C is wrong because secret names are not required to be base64-encoded; they are plain text strings that identify the secret, and base64 encoding is irrelevant to JSON validity. Option D is wrong because version labels (e.g., AWSCURRENT, AWSPREVIOUS) are managed automatically by Secrets Manager during rotation; an incorrect version label would cause a versioning error, not a JSON parsing failure.

459
MCQhard

A developer is using AWS Step Functions to orchestrate a workflow that includes a Lambda function for data transformation. The Lambda function occasionally times out after 15 seconds. The Step Function execution fails with a 'States.Timeout' error. The developer wants to retry the Lambda task up to 3 times with exponential backoff. Which configuration should the developer add to the state definition in the Amazon States Language (ASL)?

A."Retry": [ { "ErrorEquals": ["States.Timeout"], "IntervalSeconds": 1, "BackoffRate": 2, "MaxAttempts": 3 } ]
B."Retry": [ { "ErrorEquals": ["States.Timeout"], "IntervalSeconds": 2, "BackoffRate": 3, "MaxAttempts": 5 } ]
C."Retry": [ { "ErrorEquals": ["States.Timeout"], "IntervalSeconds": 1, "BackoffRate": 2, "MaxAttempts": 2 } ]
D."Retry": [ { "ErrorEquals": ["Lambda.ServiceException"], "IntervalSeconds": 1, "BackoffRate": 2, "MaxAttempts": 3 } ]
AnswerA

This configuration correctly specifies a retry mechanism for the `States.Timeout` error, which occurs when a state's execution exceeds its defined timeout. It initiates the first retry after 1 second, employing an exponential backoff strategy by doubling the interval (`BackoffRate: 2`) for subsequent attempts. The `MaxAttempts: 3` ensures that the state will be retried up to three times before ultimately failing, providing a robust handling for transient timeout conditions.

Why this answer

It defines a retry policy for the 'States.Timeout' error, which is the error that occurs when the Lambda function times out. The configuration sets a 1-second initial interval, doubles the interval on each retry (BackoffRate of 2), and allows up to 3 retries, matching the requirement exactly.

Exam trap

The trap here is that candidates may confuse the error name for a Lambda timeout ('States.Timeout') with service-specific errors like 'Lambda.ServiceException', or misconfigure the retry count or backoff rate to not match the exact requirement.

How to eliminate wrong answers

Option B is wrong because it sets MaxAttempts to 5, which exceeds the required 3 retries, and uses a BackoffRate of 3, which is not the standard exponential backoff pattern requested. Option C is wrong because it sets MaxAttempts to 2, which is fewer than the required 3 retries. Option D is wrong because it retries on 'Lambda.ServiceException', which is a different error type; the actual error from a Lambda timeout is 'States.Timeout', not 'Lambda.ServiceException'.

460
MCQmedium

A developer is deploying a containerized application to Amazon ECS with the Fargate launch type using AWS CodeDeploy for blue/green deployments. The application is behind an Application Load Balancer (ALB). What is the minimum number of ALB target groups required for a blue/green deployment?

A.1
B.2
C.3
D.4
AnswerB

Two target groups are precisely what AWS CodeDeploy requires for a blue/green deployment with Amazon ECS. One target group is associated with the currently active "blue" task set, receiving all production traffic. The second target group is then associated with the newly deployed "green" task set, allowing for validation before CodeDeploy automatically shifts traffic from the "blue" target group to the "green" target group via Application Load Balancer listener rule updates, ensuring a controlled, zero-downtime transition.

Why this answer

In a blue/green deployment with Amazon ECS (Fargate) and AWS CodeDeploy, the deployment process requires two distinct target groups: one for the 'blue' (current) environment and one for the 'green' (new) environment. CodeDeploy shifts traffic from the blue target group to the green target group during the deployment, allowing for instant rollback by switching back. A single target group cannot differentiate between the two environments, and three or more are unnecessary because the blue/green model only needs two active target groups at any time.

Exam trap

The trap here is that candidates often assume a single target group is sufficient because they think of the ALB as handling traffic routing on its own, but they miss that blue/green deployments require two separate target groups to isolate the old and new environments for traffic shifting and rollback.

How to eliminate wrong answers

Option A is wrong because a single target group cannot support blue/green deployments; it would force an in-place update, which defeats the purpose of having separate environments for traffic shifting and rollback. Option C is wrong because three target groups are not required; the blue/green model only needs one for the current version and one for the new version, with no third group needed for routing or testing. Option D is wrong because four target groups are excessive and would add unnecessary complexity; the standard blue/green deployment with ECS and CodeDeploy uses exactly two target groups.

461
MCQmedium

A Lambda function must retrieve feature flags at runtime with low latency and controlled rollout. Which AWS service is most appropriate?

A.AWS CloudFormation Parameters
B.AWS IAM Access Analyzer
C.Amazon Inspector
D.AWS AppConfig
AnswerD

AWS AppConfig is specifically designed for creating, managing, and deploying application configurations, including feature flags, at runtime. It enables developers to quickly and safely deploy configuration changes to applications hosted on EC2 instances, containers, Lambda functions, or on-premises servers. AppConfig provides controlled deployments with validation, monitoring, and automatic rollback capabilities, ensuring that feature flag updates are delivered reliably without requiring code redeployment.

Why this answer

AWS AppConfig is the correct choice because it is purpose-built for managing application configuration at runtime, including feature flags, with support for controlled rollouts (e.g., percentage-based deployments, canary releases) and low-latency retrieval via the AppConfig agent or direct API calls. It integrates with AWS Lambda to fetch configuration values on-demand without requiring a full deployment, enabling dynamic feature toggling.

Exam trap

The trap here is that candidates may confuse AWS AppConfig with AWS Systems Manager Parameter Store or AWS Secrets Manager, but AppConfig is the only service that combines runtime configuration retrieval with controlled rollout and validation, which is explicitly required for feature flags.

How to eliminate wrong answers

Option A is wrong because AWS CloudFormation Parameters are used to pass values into CloudFormation templates at stack creation or update time, not for runtime retrieval of feature flags with low latency and controlled rollout. Option B is wrong because AWS IAM Access Analyzer is a security tool that analyzes resource policies to identify unintended access, not a service for managing feature flags or application configuration. Option C is wrong because Amazon Inspector is a vulnerability management service that scans workloads for software vulnerabilities and network exposure, not a runtime configuration or feature flag service.

462
MCQeasy

A developer runs an application on Amazon EC2 that needs to securely store database credentials (username and password). The security team requires that the credentials be automatically rotated every 30 days. Which AWS service should the developer use to store and automatically rotate the credentials?

A.AWS Systems Manager Parameter Store with a SecureString parameter.
B.AWS Secrets Manager with automatic rotation enabled.
C.AWS Identity and Access Management (IAM) roles for EC2.
D.AWS Key Management Service (KMS) to store the credentials as encrypted data.
AnswerB

AWS Secrets Manager is purpose-built for managing, retrieving, and rotating database credentials, API keys, and other secrets throughout their lifecycle. Its key differentiator is native automatic rotation, which can be configured on a schedule (e.g., every 30 days) for various supported services, including Amazon RDS, Redshift, and even custom secrets via Lambda functions. This built-in capability eliminates the need for manual rotation or custom code, significantly enhancing security posture and operational efficiency.

Why this answer

AWS Secrets Manager is designed specifically for managing secrets such as database credentials, with built-in capabilities for automatic rotation according to a schedule (e.g., every 30 days). It integrates natively with supported databases (e.g., Amazon RDS, Redshift, DocumentDB) to rotate credentials without custom code, and it encrypts secrets at rest using AWS KMS. This makes it the correct choice for the developer's requirement of secure storage and automated rotation.

Exam trap

The trap here is that candidates often confuse Parameter Store's SecureString (which can store encrypted secrets but lacks built-in rotation) with Secrets Manager, overlooking the explicit requirement for automatic rotation.

How to eliminate wrong answers

Option A is wrong because AWS Systems Manager Parameter Store with a SecureString parameter can store encrypted credentials but does not support automatic rotation of the secret value; rotation would require custom automation via AWS Lambda or other services. Option C is wrong because IAM roles for EC2 provide temporary credentials for AWS API access, not for storing or rotating database credentials (username/password); they cannot be used to store secrets. Option D is wrong because AWS KMS is a key management service for encryption keys, not a secret storage service; it cannot store credentials or perform rotation.

463
MCQmedium

A company's application uses Amazon DynamoDB as its database. The application reads the same item multiple times per second and occasionally sees stale data. The DynamoDB table uses the default eventually consistent reads. What should the developer change to ensure strongly consistent reads?

A.Increase the read capacity units of the table.
B.Use DynamoDB Accelerator (DAX) to cache the item.
C.Set the ConsistentRead parameter to true in the GetItem call.
D.Use DynamoDB transactions for all read operations.
AnswerC

Setting the ConsistentRead parameter to true in a GetItem API call explicitly instructs DynamoDB to perform a strongly consistent read. This ensures that the data returned reflects all successful write operations that completed before the read request was initiated, providing the most up-to-date version of the item. While this guarantees data freshness, it may incur slightly higher latency and consume more Read Capacity Units compared to an eventually consistent read.

Why this answer

DynamoDB's default read consistency model is eventually consistent, which can return stale data if an item is updated shortly before the read. By setting the `ConsistentRead` parameter to `true` in the `GetItem` call, the developer forces a strongly consistent read, ensuring the response reflects the most recent write. This directly addresses the stale data issue without changing throughput or adding caching.

Exam trap

The trap here is that candidates often confuse throughput scaling (Option A) or caching (Option B) with consistency guarantees, or mistakenly think transactions (Option D) are required for strong consistency, when in fact a simple parameter change on the read operation is the correct and minimal fix.

How to eliminate wrong answers

Option A is wrong because increasing read capacity units (RCUs) only affects throughput and cost, not the consistency model; eventually consistent reads still return stale data regardless of RCU count. Option B is wrong because DynamoDB Accelerator (DAX) is an in-memory cache that improves read performance but does not guarantee strong consistency; it can serve stale data from its cache. Option D is wrong because DynamoDB transactions are designed for atomic, isolated multi-item operations (using `TransactGetItems` or `TransactWriteItems`), not for ensuring single-item strong consistency; using transactions for simple reads adds unnecessary overhead and cost.

464
Multi-Selectmedium

A developer is designing a system that requires processing of streaming data from IoT devices in real time. The processed data will be stored in an S3 bucket for analytics. Which AWS services should the developer use together to build this solution? (Choose TWO.)

Select 2 answers
A.Amazon Kinesis Data Firehose
B.Amazon Kinesis Data Streams
C.AWS Lambda
D.Amazon S3
E.Amazon SQS
AnswersA, B

Amazon Kinesis Data Firehose is a fully managed service designed for reliably loading streaming data into data lakes, data stores, and analytics services like Amazon S3, Amazon Redshift, or Splunk. It automatically scales to match data throughput, handles batching, compression, and encryption, and can perform basic data transformations with AWS Lambda before delivery. This service is ideal for preparing and delivering data for downstream analytics and processing without managing underlying infrastructure.

Why this answer

Amazon Kinesis Data Streams is a scalable real-time data streaming service that ingests and processes streaming data from IoT devices in real time. It allows developers to build custom applications that consume and analyze the data as it arrives. Amazon Kinesis Data Firehose is a fully managed service that reliably loads streaming data into Amazon S3 for analytics, handling buffering, compression, and partitioning.

Together, Data Streams provides real-time processing capabilities while Firehose automates delivery to S3, making them a complementary pair for this solution.

Exam trap

The trap here is that candidates often confuse Amazon Kinesis Data Streams with Amazon Kinesis Data Firehose, thinking both are interchangeable for direct S3 delivery, but Data Streams requires a separate consumer (e.g., Lambda) to write to S3, while Firehose is the managed delivery service that directly writes to S3.

465
Drag & Dropmedium

Drag and drop the steps to configure an S3 bucket for static website hosting in the correct order.

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

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

Why this order

First create the bucket, then enable static website hosting, configure index and error documents, set appropriate permissions, and finally upload content.

466
Multi-Selectmedium

A company is deploying a critical application using AWS CodeDeploy. To minimize downtime, they want to perform a blue/green deployment. Which TWO strategies should they implement?

Select 2 answers
A.Create an Elastic Load Balancer to route traffic between the blue and green environments.
B.Use an Amazon Route 53 weighted routing policy to gradually shift traffic.
C.Configure an AWS Lambda function to perform A/B testing during deployment.
D.Use an Amazon CloudFront distribution with multiple origins.
E.Ensure the new instances are registered with the target group before switching traffic.
AnswersA, E

An Elastic Load Balancer is essential to an AWS CodeDeploy blue/green deployment because CodeDeploy uses it as the traffic-control mechanism. The deployment registers the new environment's instances with a replacement target group, allows them to pass health checks, and then shifts production traffic away from the original target group. Without an ELB, there is no managed way to atomically reroute traffic and deregister the old instances.

Why this answer

Blue/green deployments with AWS CodeDeploy involve two environments: the current (blue) and the new (green). To minimize downtime, traffic must be seamlessly switched from blue to green. This is achieved by using an Elastic Load Balancer (ELB) to route traffic between the environments (option A).

Additionally, the new instances must be registered with the target group before traffic is switched (option E). Option B (Route53 weighted routing) is not the primary mechanism; CodeDeploy leverages the ELB for traffic shifting. Option C (Lambda for A/B testing) is unrelated to blue/green deployment.

Option D (CloudFront with multiple origins) can be used but is not a required strategy for CodeDeploy blue/green; it is more relevant for content delivery. Therefore, the correct strategies are A and E.

467
MCQeasy

A company is deploying a containerized application on Amazon ECS using the Fargate launch type. The deployment must ensure zero downtime. Which ECS deployment configuration should be used?

A.Rolling update with a minimum healthy percent of 50% and maximum percent of 200%
B.Set the task placement strategy to REPLICA
C.Use the DAEMON scheduling strategy with a deployment circuit breaker
D.Blue/green deployment using AWS CodeDeploy
AnswerD

Blue/green deployment using AWS CodeDeploy is the most effective strategy for achieving zero-downtime updates for containerized applications on Amazon ECS. This method involves deploying the new application version (green environment) completely separate from the current production version (blue environment). Traffic is then atomically shifted from the blue to the green environment only after the new version has been thoroughly validated, allowing for quick rollback if issues arise, thus ensuring continuous service availability without user impact.

Why this answer

Blue/green deployment using AWS CodeDeploy is correct because it creates a separate, fully functional replacement environment (green) alongside the existing one (blue), allowing traffic to be switched instantly after validation. This ensures zero downtime by avoiding in-place updates that could temporarily reduce capacity or serve errors during the transition. For ECS Fargate, CodeDeploy orchestrates the shift using an AppSpec file and can automatically roll back on health check failures.

Exam trap

The trap here is that candidates assume a rolling update with high maximum percent (like 200%) guarantees zero downtime, but they overlook that the minimum healthy percent of 50% can still cause a capacity dip, and in-place updates inherently risk serving errors during the transition, whereas blue/green deployments provide true isolation and instant traffic switching.

How to eliminate wrong answers

Option A is wrong because a rolling update with minimum healthy percent of 50% and maximum percent of 200% can cause a brief period where only 50% of the original tasks remain, potentially reducing capacity and risking downtime if traffic spikes or tasks fail during the update. Option B is wrong because setting the task placement strategy to REPLICA only controls how tasks are distributed across Availability Zones, not the deployment method, and does not inherently provide zero-downtime updates. Option C is wrong because the DAEMON scheduling strategy is not supported with the Fargate launch type (it is only for EC2), and a deployment circuit breaker only stops a failed deployment but does not prevent downtime during the update process.

468
MCQeasy

A developer is deploying a serverless application using the AWS Serverless Application Model (SAM). The developer wants to ensure that the Lambda function's environment variables are encrypted at rest. What is the most straightforward way to achieve this?

A.No action needed; SAM automatically encrypts environment variables at rest using a default KMS key.
B.Enable encryption in the SAM template using the 'Encrypt' property.
C.Modify the Lambda function's code to encrypt environment variables before deployment.
D.Create a customer managed KMS key and specify it in the SAM template.
AnswerA

AWS Lambda automatically encrypts environment variables at rest using an AWS Key Management Service (KMS) key. When deploying a serverless application with SAM, this default behavior applies, meaning the environment variables specified in your SAM template are automatically encrypted by an AWS-managed KMS key without any explicit configuration. Therefore, no additional action is required from the developer to ensure these variables are encrypted while stored.

Why this answer

AWS SAM, by default, encrypts Lambda function environment variables at rest using an AWS managed KMS key (aws/lambda). This is a built-in behavior of the Lambda service, so no additional configuration is required in the SAM template to achieve encryption at rest. The developer does not need to take any action beyond deploying the function.

Exam trap

The trap here is that candidates often assume they must explicitly enable encryption or use a custom KMS key, overlooking that Lambda automatically encrypts environment variables at rest by default with an AWS managed key.

How to eliminate wrong answers

Option B is wrong because there is no 'Encrypt' property in the SAM template for environment variables; encryption at rest is automatic and not controlled via a template property. Option C is wrong because encrypting environment variables in code before deployment is unnecessary and would require the function to decrypt them at runtime, adding complexity without benefit since Lambda already handles encryption at rest. Option D is wrong because while you can specify a customer managed KMS key for encryption, it is not the most straightforward way; the default AWS managed key works without any extra configuration.

469
Multi-Selectmedium

Which TWO IAM policy conditions can be used to enforce multi-factor authentication (MFA) for API calls?

Select 2 answers
A.Condition: { "Null": { "aws:MultiFactorAuthPresent": "false" } }
B.Condition: { "StringLike": { "iam:MFADeviceType": "Virtual" } }
C.Condition: { "ForAllValues:StringEquals": { "aws:SourceIdentity": "admin" } }
D.Condition: { "StringEquals": { "iam:ResourcePath": "/" } }
E.Condition: { "Bool": { "aws:MultiFactorAuthPresent": "true" } }
AnswersA, E

This denies access if the MFA key is absent (null), effectively requiring MFA.

Why this answer

The `Null` condition operator checks whether the `aws:MultiFactorAuthPresent` key is absent or explicitly set to `false`. When set to `false`, it denies API calls that were made without MFA, effectively enforcing MFA for all API operations. Option E is correct because the `Bool` condition operator with `true` requires that MFA was used, but it must be combined with a `Deny` effect to block unauthenticated requests; used alone in an `Allow` statement, it only permits MFA-authenticated calls without blocking non-MFA ones.

Exam trap

A common trap is thinking that using the Bool condition with true alone (e.g., "Bool": { "aws:MultiFactorAuthPresent": "true" }) is sufficient to enforce MFA. However, without a Deny effect or a Null check, this only allows MFA-authenticated calls but does not block non-MFA calls, leaving a security gap.

470
MCQeasy

A company wants to encrypt data at rest in an S3 bucket using server-side encryption. Which option provides the MOST control over the encryption key?

A.SSE-KMS (AWS KMS keys)
B.SSE-C (customer-provided keys)
C.Client-side encryption
D.SSE-S3 (S3-managed keys)
AnswerB

SSE-C (Server-Side Encryption with Customer-Provided Keys) mandates that the customer supply their unique encryption key with every PUT and GET request to S3. Amazon S3 uses this key solely for encrypting or decrypting the object data and then immediately discards it, never storing the key itself. This method provides the highest level of customer control over the encryption key's generation, storage, rotation, and lifecycle, as AWS never retains custody of the key.

Why this answer

SSE-C (customer-provided keys) gives you the most control because you manage the encryption key yourself—you provide the key in each request, and AWS discards it after use. This means you have full lifecycle control over the key material, including rotation, deletion, and access policies, without AWS ever storing the key. In contrast, SSE-KMS and SSE-S3 rely on AWS-managed or AWS-controlled key stores, reducing your direct control.

Exam trap

The trap here is that candidates confuse 'most control' with 'easiest management' and pick SSE-KMS, but the question explicitly asks for the option that provides the MOST control over the encryption key, which is SSE-C because you own and manage the key entirely.

How to eliminate wrong answers

Option A is wrong because SSE-KMS uses AWS KMS keys, where AWS manages the key store and you share control with AWS via key policies and grants, so you do not have the most control. Option C is wrong because client-side encryption encrypts data before sending it to S3, which gives you full control over the key, but the question specifically asks about server-side encryption, so this is out of scope. Option D is wrong because SSE-S3 uses S3-managed keys (AES-256) where AWS fully manages the key lifecycle, giving you the least control over the encryption key.

471
Multi-Selectmedium

Users receive AccessDenied when downloading SSE-KMS encrypted S3 objects cross-account. Which two policies may need changes?

Select 2 answers
A.CloudFront cache policy
B.S3 bucket/object access policy or IAM policy
C.KMS key policy allowing decrypt to the caller
D.Route 53 resolver rule policy
AnswersB, C

Correct for the stated requirement.

Why this answer

When accessing SSE-KMS encrypted S3 objects cross-account, the S3 bucket policy or the IAM policy must explicitly grant the s3:GetObject permission to the caller. Additionally, the KMS key policy must allow the kms:Decrypt action for the caller's AWS account or IAM role, because SSE-KMS uses a customer master key (CMK) to encrypt the object, and decryption requires KMS permissions. Without both policies, the request fails with AccessDenied even if the S3 permissions are correct.

Exam trap

The trap here is that candidates often assume only the S3 bucket policy needs updating, forgetting that SSE-KMS adds a second authorization layer via KMS key policies, which must explicitly allow the decrypt action for the cross-account caller.

472
MCQhard

A developer uses the AWS SDK to list thousands of DynamoDB items from a query. Only the first page is processed. What should be implemented?

A.Pagination using LastEvaluatedKey until no further key is returned
B.A larger Lambda memory setting only
C.A global secondary index with the same key
D.Strongly consistent reads on every request
AnswerA

DynamoDB `Scan` and `Query` operations return results in 1MB chunks. To retrieve thousands of items, the developer must repeatedly call the API, passing the `LastEvaluatedKey` from the previous response as the `ExclusiveStartKey` in the subsequent request. This pagination continues until `LastEvaluatedKey` is no longer present in the response, indicating all items matching the criteria have been retrieved. This is the standard and most efficient way to handle large result sets.

Why this answer

The DynamoDB Query API returns paginated results, with a maximum of 1 MB of data per page. The `LastEvaluatedKey` in the response indicates that more items exist. To retrieve all items, the application must check for `LastEvaluatedKey` and, if present, issue a subsequent Query request with the `ExclusiveStartKey` parameter set to that value, repeating until `LastEvaluatedKey` is no longer returned.

This is the standard pagination pattern for DynamoDB.

Exam trap

The trap here is that candidates may assume DynamoDB returns all matching items in a single response, overlooking the 1 MB pagination limit and the necessity of handling `LastEvaluatedKey` in a loop.

How to eliminate wrong answers

Option B is wrong because increasing Lambda memory only increases CPU and network bandwidth, but does not change the DynamoDB API's 1 MB page size limit or the need to handle pagination; the query would still return only the first page. Option C is wrong because a global secondary index (GSI) with the same key would not solve the pagination issue; it would simply provide an alternative query path that also returns paginated results. Option D is wrong because strongly consistent reads ensure the most up-to-date data but do not affect the number of items returned per page or the pagination mechanism; they are unrelated to the pagination problem.

473
MCQhard

A developer is troubleshooting an IAM policy that is not working as expected. The policy has an Allow effect for s3:PutObject but the user gets AccessDenied. The user also has a Deny policy attached. What is the most likely reason?

A.The resource-based policy on S3 denies access
B.The Allow policy is evaluated before the Deny policy
C.An explicit Deny in an IAM policy overrides the Allow
D.An SCP denies the action
AnswerC

This statement accurately reflects a core principle of AWS IAM policy evaluation. If an IAM policy contains an explicit Deny statement for a specific action on a resource, that Deny will always override any Allow statements that might exist in the same policy, other identity-based policies, or even resource-based policies. An explicit Deny acts as an absolute prohibition, ensuring that access is blocked even if multiple Allow statements are present.

Why this answer

AWS IAM evaluates all policies (identity-based, resource-based, and SCPs) and an explicit Deny always overrides any Allow, regardless of the order in which the policies are written. In this scenario, even though the user has an Allow effect for s3:PutObject, the attached Deny policy explicitly denies the action, resulting in an AccessDenied error. This is a fundamental rule of AWS authorization logic: an explicit Deny cannot be overridden by any Allow.

Exam trap

The trap here is that candidates often assume the order of policy evaluation (Allow before Deny) matters, but AWS explicitly states that an explicit Deny overrides any Allow, making the order irrelevant.

How to eliminate wrong answers

Option A is wrong because a resource-based policy on S3 that denies access would also cause AccessDenied, but the question states the user has a Deny policy attached, making the explicit Deny in the IAM policy the most likely reason. Option B is wrong because AWS evaluates all policies in a single pass, and the order of evaluation (Allow before Deny) does not matter; the explicit Deny always takes precedence. Option D is wrong because while an SCP could deny the action, the question specifically mentions the user has a Deny policy attached, and SCPs apply at the account or OU level, not directly to the user; the most direct cause is the attached Deny policy.

474
MCQeasy

An application running on Amazon EC2 instances behind an Application Load Balancer (ALB) intermittently returns 503 errors. The ALB health checks are failing for some instances intermittently. The developer checks the instance system logs and finds no application errors. What is the most likely cause of the health check failures?

A.The application on the instances is experiencing resource exhaustion (e.g., memory or CPU) which causes it to stop responding to health checks temporarily
B.The security group for the instances does not allow inbound traffic from the ALB on the health check port
C.The health check path is not configured correctly and the default path returns a 404 status
D.The target group is not configured with the correct protocol
AnswerA

When an application experiences intermittent resource exhaustion, such as high CPU utilization or memory pressure, it can temporarily become unresponsive to incoming requests, including health checks from an Application Load Balancer (ALB). During these transient spikes, the application might fail to respond within the health check timeout period, causing the ALB to mark the instance as unhealthy. Once resources are freed or the load subsides, the application recovers and starts responding to health checks again, leading to an intermittent pattern of healthy/unhealthy states.

Why this answer

Intermittent 503 errors from the ALB combined with intermittent health check failures and no application errors in the system logs strongly point to transient resource exhaustion (CPU or memory) on the EC2 instances. When an instance runs out of memory or CPU, the application process may become unresponsive or be killed by the OS (e.g., OOM killer), causing it to fail health checks temporarily. Once resources are freed (e.g., after a spike subsides), the application resumes responding, which explains the intermittent nature of the failures.

Exam trap

The trap here is that candidates often assume health check failures are always due to misconfiguration (security groups, paths, or protocols) and overlook transient resource exhaustion, which is a common cause of intermittent failures in production.

How to eliminate wrong answers

Option B is wrong because if the security group did not allow inbound traffic from the ALB on the health check port, health checks would fail consistently, not intermittently. Option C is wrong because a misconfigured health check path returning a 404 would cause persistent health check failures, not intermittent ones. Option D is wrong because an incorrect target group protocol (e.g., HTTP vs HTTPS) would cause all health checks to fail consistently, not intermittently.

475
MCQmedium

A developer is deploying a Lambda function that processes images uploaded to an S3 bucket. The function is triggered by S3 events. After deployment, the function does not execute when new images are uploaded. What is the MOST likely cause?

A.The S3 bucket does not have an event notification configured for the Lambda function.
B.The Lambda function memory is set too low.
C.The Lambda function does not have permission to read from the S3 bucket.
D.The Lambda function is not in the same region as the S3 bucket.
AnswerA

For an AWS Lambda function to be automatically invoked in response to an S3 object event, such as an image upload, the S3 bucket must have a specific event notification configured. This configuration explicitly links the desired S3 event type (e.g., s3:ObjectCreated:*) to the target Lambda function. Without this crucial setup, S3 will not know to send an invocation request to the Lambda service, preventing the function from ever being triggered.

Why this answer

The most likely cause is that the S3 bucket does not have an event notification configured to invoke the Lambda function. S3 event notifications must be explicitly set on the bucket to trigger a Lambda function when objects are created; without this configuration, S3 will not send any invocation request to Lambda, regardless of the function's permissions or settings.

Exam trap

The trap here is that candidates often confuse the trigger configuration (S3 event notification) with the function's permissions (IAM execution role), assuming that if the function has read access to S3, it will automatically be triggered, when in fact the event notification is a separate, mandatory setup step.

How to eliminate wrong answers

Option B is wrong because low memory affects execution performance (e.g., duration, CPU allocation) but does not prevent the function from being triggered; the trigger mechanism is independent of memory settings. Option C is wrong because the Lambda function does not need permission to read from the S3 bucket to be triggered; the S3 event notification invokes the function via a resource-based policy, and the function only needs read permissions if it explicitly calls S3 GetObject in its code. Option D is wrong because S3 event notifications can invoke Lambda functions across regions; cross-region triggers are supported as long as the Lambda function's resource-based policy allows the S3 bucket's account to invoke it.

476
MCQeasy

A developer is using AWS Certificate Manager (ACM) to provision an SSL/TLS certificate for a website hosted on CloudFront. The certificate must be renewed automatically. What is the correct action?

A.The developer must configure a Lambda function to renew the certificate.
B.The certificate cannot be used with CloudFront; ACM certificates are only for ALB.
C.ACM automatically renews the certificate if it uses DNS validation.
D.The developer must manually request a new certificate before expiration.
AnswerC

This statement is correct. AWS Certificate Manager (ACM) automatically attempts to renew certificates that were issued using DNS validation, typically starting 60 days before expiration. For this automatic renewal to succeed, the CNAME record created during the initial validation must remain in the DNS configuration, allowing ACM to re-validate domain ownership without any manual intervention from the developer.

Why this answer

ACM automatically renews certificates that use DNS validation, provided the required DNS CNAME record remains in place. CloudFront supports ACM certificates in us-east-1, and ACM handles renewal without any manual intervention or additional infrastructure like Lambda functions.

Exam trap

The trap here is that candidates assume ACM requires manual renewal or additional automation (like Lambda), but ACM's automatic renewal for DNS-validated certificates is a key managed feature tested in the DVA-C02 exam.

How to eliminate wrong answers

Option A is wrong because ACM automatically manages renewal for DNS-validated certificates; a Lambda function is unnecessary and not part of the renewal process. Option B is wrong because ACM certificates are fully supported with CloudFront (when issued in us-east-1), not limited to ALB. Option D is wrong because ACM handles automatic renewal for eligible certificates; manual re-request is only needed if validation fails or the certificate is not eligible.

477
MCQeasy

A developer needs to grant cross-account access to an Amazon S3 bucket. The developer's AWS account (Account A) owns the bucket, and a user in another account (Account B) needs to write objects to it. The developer has already added a bucket policy that grants the user in Account B permissions. What additional step is required?

A.No additional steps are needed; the bucket policy alone is sufficient.
B.The administrator of Account B must attach an IAM policy to the user that allows the required S3 actions.
C.Create a new IAM role in Account B and have the user assume the role.
D.Enable S3 ACLs on the bucket and grant write access to the Account B user.
AnswerB

To successfully grant cross-account S3 access, the administrator of Account B must attach an IAM policy to the specific user or role that will be accessing the bucket. This identity-based policy explicitly authorizes the principal within Account B to perform the desired S3 actions, such as s3:PutObject, on the target bucket in Account A. This policy works in conjunction with the resource-based bucket policy in Account A, which grants permissions to Account B's principal, ensuring that both sides of the trust relationship are established for successful access.

Why this answer

Cross-account access to S3 requires both a resource-based policy (the bucket policy in Account A) and a user-based policy (an IAM identity-based policy in Account B). The bucket policy grants permissions to the Account B user, but that user cannot perform actions unless their own account explicitly allows those actions via an IAM policy. Without this, the request is denied by the user's own account's implicit deny, even if the bucket policy permits it.

Exam trap

The trap here is that candidates often assume a bucket policy alone is enough for cross-account access, forgetting that the requesting user's account must also explicitly authorize the action via an IAM policy.

How to eliminate wrong answers

Option A is wrong because a bucket policy alone is insufficient for cross-account access; the user in Account B must also have an IAM policy that allows the S3 actions, as the user's account must explicitly authorize the request. Option C is wrong because creating an IAM role in Account B and having the user assume it is an alternative approach, but it is not required; the question asks for the additional step given that a bucket policy is already in place, and the simplest correct step is to attach an IAM policy to the user, not to create a role. Option D is wrong because S3 ACLs are legacy and not recommended; more importantly, ACLs grant access to AWS accounts or canonical user IDs, not to specific IAM users, and enabling ACLs does not replace the need for an IAM policy in Account B.

478
Multi-Selecthard

A CloudFormation stack update fails and rolls back. Which two practices help diagnose and reduce future deployment risk?

Select 2 answers
A.Review stack events and resource status reasons
B.Delete the stack immediately without checking events
C.Create and inspect change sets before high-risk updates
D.Disable rollback for all production deployments permanently
AnswersA, C

Correct for the stated requirement.

Why this answer

Reviewing stack events and resource status reasons in CloudFormation provides detailed error messages for each resource that failed during the update. This allows you to pinpoint the exact cause of the failure, such as insufficient IAM permissions, a resource limit exceeded, or a dependency conflict. Analyzing these events is essential for diagnosing issues and preventing similar failures in future deployments.

Exam trap

The trap here is that candidates may think disabling rollback is a valid troubleshooting step for production, but the exam emphasizes that rollback is a safety feature that should not be permanently disabled, as it prevents partial updates that could leave infrastructure in an inconsistent state.

479
MCQeasy

A developer is using the AWS SDK for Python (Boto3) to upload objects to an S3 bucket. The developer wants to encrypt the objects at rest using server-side encryption with AWS KMS managed keys (SSE-KMS). Which parameter should the developer include in the put_object call?

A.SSEAlgorithm: 'AES256'
B.SSEKMSKeyId: 'alias/aws/s3'
C.ServerSideEncryption: 'aws:kms'
D.ServerSideEncryption: 'AES256'
AnswerC

This is the correct parameter and value combination to enable Server-Side Encryption with AWS Key Management Service (SSE-KMS) for objects uploaded to S3. When 'ServerSideEncryption' is set to 'aws:kms', S3 uses a customer master key (CMK) from AWS KMS to encrypt the object data before storing it. This method provides enhanced security and auditability by leveraging KMS for key management, offering more control over the encryption keys than SSE-S3.

Why this answer

To use server-side encryption with AWS KMS managed keys (SSE-KMS) when uploading an object to S3 via the put_object call, you must set the ServerSideEncryption parameter to 'aws:kms'. This tells S3 to encrypt the object using a KMS key. Option C is correct because it specifies the exact value required for SSE-KMS encryption.

Exam trap

The trap here is that candidates often confuse the parameter values for SSE-S3 ('AES256') and SSE-KMS ('aws:kms'), or mistakenly think SSEKMSKeyId alone enables KMS encryption without the required ServerSideEncryption parameter.

How to eliminate wrong answers

Option A is wrong because SSEAlgorithm is not a valid parameter in the put_object call; the correct parameter is ServerSideEncryption, and 'AES256' is used for SSE-S3, not SSE-KMS. Option B is wrong because SSEKMSKeyId is an optional parameter used to specify a specific KMS key ID or alias, but it is not the parameter that enables SSE-KMS; you must first set ServerSideEncryption to 'aws:kms'. Option D is wrong because ServerSideEncryption: 'AES256' is the value for SSE-S3, not SSE-KMS; SSE-KMS requires 'aws:kms'.

480
MCQeasy

A developer needs to store application configuration data that can be read by multiple EC2 instances. The data is less than 1 KB and changes frequently. Which AWS service is BEST suited for this?

A.Amazon S3
B.AWS Systems Manager Parameter Store
C.AWS AppConfig
D.Amazon DynamoDB
AnswerC

AWS AppConfig is purpose-built for managing application configurations, enabling developers to quickly and safely deploy configuration changes to applications. It supports controlled deployments, allowing changes to be rolled out gradually to a subset of targets, and includes built-in validation and automatic rollback capabilities to prevent outages. This makes it ideal for frequent updates to feature flags, throttling limits, or other dynamic application settings, ensuring application stability.

Why this answer

AWS AppConfig is the best choice because it is designed for dynamic, frequent configuration changes that need to be deployed to multiple EC2 instances without redeploying code or restarting applications. It supports hosted configuration data (up to 1 MB) and provides controlled rollouts, validation, and monitoring, making it ideal for sub-1 KB data that changes frequently.

Exam trap

The trap here is that candidates often confuse AWS Systems Manager Parameter Store (which is for static parameters) with AppConfig (which is for dynamic, frequently changing configurations with deployment controls), leading them to choose Parameter Store despite its throughput and validation limitations.

How to eliminate wrong answers

Option A is wrong because Amazon S3 is an object storage service, not optimized for frequently changing small configuration data; it lacks built-in validation, staged rollouts, and real-time deployment controls. Option B is wrong because AWS Systems Manager Parameter Store is designed for static or infrequently changing parameters (e.g., database passwords, AMI IDs) and has a throughput limit of 40 transactions per second per region by default, making it unsuitable for high-frequency updates. Option D is wrong because Amazon DynamoDB is a NoSQL database for high-scale transactional workloads, not a configuration management service; it requires additional code for validation, rollback, and deployment orchestration, adding unnecessary complexity.

481
MCQmedium

A company is deploying a microservices application on Amazon ECS using the Fargate launch type. The application includes a service that must process messages from an Amazon SQS queue. The developer wants to ensure that the service scales based on the number of messages in the queue. Which scaling solution should the developer implement?

A.Configure DynamoDB auto scaling to adjust read capacity based on queue depth.
B.Use Amazon ECS Service Auto Scaling with a target tracking scaling policy based on the SQS queue backlog per task.
C.Configure AWS Lambda with reserved concurrency and trigger it from the SQS queue.
D.Use Application Auto Scaling with a scheduled scaling policy to increase the number of tasks during peak hours.
AnswerB

Amazon ECS Service Auto Scaling, when configured with a target tracking policy, directly scales the number of ECS tasks in a service. By targeting a specific metric like the SQS queue backlog per task, the service can dynamically adjust capacity to maintain a consistent processing rate. This ensures that as the queue depth increases or decreases, the number of tasks scales proportionally to efficiently process messages, preventing bottlenecks and optimizing resource utilization.

Why this answer

Amazon ECS Service Auto Scaling with a target tracking scaling policy based on the SQS queue backlog per task (calculated as ApproximateNumberOfMessages divided by the number of running tasks) directly correlates the number of ECS tasks to the queue depth. This ensures the service scales up when messages accumulate and scales down when the backlog clears, using a predefined or custom metric that reflects the workload.

Exam trap

The trap here is that candidates often confuse service auto scaling with scheduled scaling or assume Lambda is the only serverless option, missing that ECS with Fargate can scale based on SQS backlog using a target tracking policy.

How to eliminate wrong answers

Option A is wrong because DynamoDB auto scaling adjusts read/write capacity for a DynamoDB table, not for an ECS service or SQS queue depth, and it cannot scale compute tasks. Option C is wrong because while Lambda can be triggered from SQS, the question specifically asks for scaling the ECS service, not replacing it with Lambda; reserved concurrency controls Lambda execution capacity, not ECS task count. Option D is wrong because a scheduled scaling policy adjusts tasks based on time, not on the actual SQS queue depth, so it cannot dynamically respond to varying message volumes.

482
Multi-Selectmedium

A developer is deploying an application on Amazon ECS using Fargate. The application needs to securely access an Amazon RDS database. The developer wants to avoid hardcoding database credentials in the application code. Which THREE actions should the developer take to meet these requirements? (Choose THREE.)

Select 3 answers
A.Hardcode the credentials in the application code and encrypt the code using AWS KMS.
B.Store the database credentials in AWS Systems Manager Parameter Store or AWS Secrets Manager.
C.Reference the secrets in the task definition as environment variables using the 'secrets' parameter.
D.Grant the ECS task execution role permission to read the secrets from Parameter Store or Secrets Manager.
E.Store the credentials in Amazon Elastic Container Registry (ECR) as a tag.
AnswersB, C, D

AWS Systems Manager Parameter Store and AWS Secrets Manager are purpose-built services for securely storing and managing configuration data and secrets, respectively. Parameter Store offers secure string types encrypted with KMS, suitable for non-rotating secrets, while Secrets Manager provides advanced features like automatic secret rotation, fine-grained access control, and integration with various AWS services and databases. Utilizing these services centralizes secret management, enhances security, and simplifies compliance.

Why this answer

AWS Systems Manager Parameter Store and AWS Secrets Manager are AWS-native services designed to securely store and manage sensitive information like database credentials. By storing credentials in these services, the developer avoids hardcoding them in the application code, adhering to security best practices. The application can then retrieve the credentials at runtime using IAM roles and permissions.

Exam trap

The trap here is that candidates might think storing credentials in ECR tags or encrypting code with KMS is sufficient, but AWS explicitly requires using Parameter Store or Secrets Manager for secrets management in ECS tasks to avoid exposure in the container image or codebase.

483
MCQmedium

A DynamoDB application receives ProvisionedThroughputExceededException during predictable daily peaks. The workload is not cacheable. What should be changed?

A.Enable S3 Transfer Acceleration
B.Use on-demand capacity or configure autoscaling/scheduled scaling for the table
C.Disable CloudWatch metrics
D.Move all reads to strongly consistent mode
AnswerB

Utilizing DynamoDB's on-demand capacity mode automatically scales read and write throughput to accommodate varying workloads without requiring capacity planning. Alternatively, configuring autoscaling for the table dynamically adjusts provisioned read and write capacity units (RCUs/WCUs) based on actual traffic patterns or target utilization, preventing throttling errors during peak loads. Scheduled scaling further allows for pre-planned capacity adjustments for predictable traffic spikes, ensuring the application always has sufficient resources.

Why this answer

The ProvisionedThroughputExceededException indicates that the table's read/write capacity is insufficient during peak loads. Since the workload is predictable but not cacheable, the correct solution is to either switch to on-demand capacity mode, which automatically scales to handle any traffic level, or configure auto scaling with scheduled scaling to match the predictable peaks. This directly addresses the capacity shortfall without requiring application changes.

Exam trap

The trap here is that candidates may think disabling CloudWatch metrics reduces overhead or that strongly consistent reads improve reliability, but both actions either remove monitoring or increase capacity consumption, making the throttling worse.

How to eliminate wrong answers

Option A is wrong because S3 Transfer Acceleration is a feature for speeding up uploads to S3 over long distances, not for DynamoDB throughput issues. Option C is wrong because disabling CloudWatch metrics would remove visibility into table performance and prevent monitoring of throttling events, making troubleshooting harder. Option D is wrong because strongly consistent reads consume more read capacity units than eventually consistent reads, which would worsen the throughput problem instead of solving it.

484
MCQhard

A company uses Amazon DynamoDB as a session store for a web application. The application recently experienced a spike in traffic, causing increased read latency. The DynamoDB table has a read capacity of 5000 RCUs and uses eventual consistent reads. The application performs many GetItem calls. What should a developer do to improve read performance with minimal cost?

A.Enable DynamoDB Accelerator (DAX) for the table
B.Increase the read capacity to 10000 RCUs
C.Configure DynamoDB global tables for the application
D.Enable DynamoDB Streams and process updates asynchronously
AnswerA

DynamoDB Accelerator (DAX) is a fully managed, highly available, in-memory cache specifically designed to reduce read latency for DynamoDB tables. By caching frequently accessed session data, DAX can serve requests with microsecond response times, significantly improving the performance of read-heavy applications like web session stores. This offloads read traffic from the underlying DynamoDB table, optimizing both latency and cost efficiency by minimizing direct DynamoDB calls.

Why this answer

DynamoDB Accelerator (DAX) is an in-memory cache that reduces read latency for GetItem calls from single-digit milliseconds to microseconds. Since the application uses eventual consistent reads and performs many GetItem operations, DAX offloads reads from the table, improving performance without increasing provisioned RCUs. This is the most cost-effective solution because it avoids scaling the table's read capacity and only charges for the cache nodes used.

Exam trap

The trap here is that candidates often assume increasing provisioned capacity (Option B) is the only way to handle read spikes, overlooking the cost and performance benefits of a caching layer like DAX for read-heavy workloads.

How to eliminate wrong answers

Option B is wrong because increasing read capacity to 10000 RCUs would double the provisioned throughput cost without addressing the root cause of latency, and it does not leverage caching to reduce response times. Option C is wrong because DynamoDB global tables replicate data across regions for disaster recovery and low-latency writes, not to improve read performance within a single region; they add complexity and cost without reducing read latency for GetItem calls. Option D is wrong because DynamoDB Streams capture item-level changes for asynchronous processing (e.g., triggers or replication), but they do not cache data or accelerate read operations; they are irrelevant to improving GetItem latency.

485
MCQeasy

A developer is building a CI/CD pipeline using AWS CodePipeline. The source stage is an Amazon S3 bucket. The developer wants to automatically start the pipeline when a new file is uploaded to the S3 bucket. What should the developer do?

A.Configure the S3 bucket to send events to an SQS queue, and poll the queue from CodePipeline.
B.Create an Amazon CloudWatch Events rule that triggers on S3 object creation events and targets the pipeline.
C.Set up a periodic Lambda function that checks the S3 bucket for new files and starts the pipeline.
D.Configure the S3 bucket to send events to an SNS topic, and subscribe CodePipeline to the topic.
AnswerB

This is the correct and recommended approach. Amazon S3 can publish object creation events directly to Amazon EventBridge (formerly CloudWatch Events). An EventBridge rule can then be configured to filter these specific S3 events and directly invoke an AWS CodePipeline as its target. This establishes an efficient, event-driven mechanism to automatically start the CI/CD pipeline whenever new source artifacts are uploaded to the designated S3 bucket.

Why this answer

Amazon CloudWatch Events (now Amazon EventBridge) can directly target an AWS CodePipeline pipeline as a rule target. By creating a rule that matches S3 object creation events (e.g., `s3:ObjectCreated:*`), the pipeline is automatically triggered without any intermediate polling, custom code, or additional services. This is the native, serverless integration recommended by AWS.

Exam trap

The trap here is that candidates often confuse SNS or SQS as valid CodePipeline triggers, but AWS CodePipeline only supports CloudWatch Events/EventBridge, webhooks (for GitHub), and manual or scheduled triggers—not direct SNS subscriptions or SQS polling.

How to eliminate wrong answers

Option A is wrong because CodePipeline does not poll SQS queues; it relies on event-driven triggers via CloudWatch Events or webhooks, not queue-based polling. Option C is wrong because using a periodic Lambda function to check for new files introduces unnecessary latency, cost, and complexity; it is an anti-pattern when a native event-driven trigger exists. Option D is wrong because CodePipeline cannot be directly subscribed to an SNS topic; SNS can send notifications but cannot invoke a pipeline—only CloudWatch Events/EventBridge can target CodePipeline directly.

486
MCQmedium

A company wants to restrict access to an Amazon S3 bucket so that only requests originating from a specific Amazon VPC are allowed. The bucket is in the same AWS account as the VPC. Which configuration should the developer implement?

A.Bucket policy with condition aws:SourceVpc
B.Bucket policy with condition aws:SourceIp
C.Bucket ACL with VPC ID
D.VPC Endpoint policy
AnswerA

The `aws:SourceVpc` condition key within an Amazon S3 bucket policy is the most direct and secure method to restrict access. This condition ensures that requests to the S3 bucket are permitted only if they originate from the specified Virtual Private Cloud (VPC) ID, effectively isolating access to resources within that particular network boundary. It leverages the inherent network context of the request, providing a robust and scalable solution without needing to manage individual IP addresses.

Why this answer

The `aws:SourceVpc` condition key in an S3 bucket policy allows you to restrict access to requests originating from a specific VPC. This works in conjunction with a VPC endpoint for S3 (Gateway or Interface endpoint), which ensures that traffic from the VPC to S3 stays within the AWS network and does not traverse the public internet. The condition evaluates the VPC ID from which the request originates, providing a secure, network-level access control.

Exam trap

The trap here is that candidates often confuse `aws:SourceVpc` with `aws:SourceIp` or think a VPC Endpoint policy alone can restrict bucket access, but the bucket policy is the authoritative mechanism for inbound access control, while the endpoint policy governs outbound permissions from the VPC.

How to eliminate wrong answers

Option B is wrong because `aws:SourceIp` restricts access based on public IP addresses, but requests from a VPC using a VPC endpoint have private IPs and the source IP is not the VPC's public IP, making this condition ineffective for VPC-based access control. Option C is wrong because S3 bucket ACLs do not support VPC IDs; ACLs can only grant access to AWS accounts or predefined groups (e.g., AllUsers, AuthenticatedUsers), not to specific VPCs. Option D is wrong because a VPC Endpoint policy controls what actions principals within the VPC can perform on the S3 service, but it does not restrict access from the bucket's perspective; the bucket policy is the mechanism to enforce inbound restrictions based on the VPC.

487
MCQmedium

A developer is building a serverless application using AWS Step Functions to orchestrate multiple AWS Lambda functions. One of the Lambda functions occasionally fails due to a transient error. The developer wants the Step Functions execution to automatically retry the failed task up to three times with exponential backoff. Which configuration should the developer set in the Step Functions state machine definition?

A.Add a Retry clause in the Lambda function's configuration with a maximum retry count of 3.
B.Use the Amazon States Language (ASL) Retry field in the Task state definition.
C.Wrap the Lambda function invocation in a custom while loop within the function code.
D.Use the Amazon States Language Catch field in the Task state to redirect to a retry logic.
AnswerB

The Amazon States Language (ASL) Retry field is the definitive and recommended mechanism within AWS Step Functions for handling transient failures in Task states. This declarative approach allows developers to specify which error types to retry, the maximum number of attempts, the initial delay, and an exponential backoff rate. Implementing retries directly in the state machine definition ensures robust error handling without modifying the underlying Lambda function code.

Why this answer

The Amazon States Language (ASL) provides a native Retry field within a Task state definition that allows you to specify retry policies, including a maximum retry count and exponential backoff. This is the intended mechanism for handling transient failures in Step Functions without requiring custom code or external retry logic.

Exam trap

The trap here is that candidates confuse the Retry field (for retries) with the Catch field (for error handling) or mistakenly think retry logic belongs in the Lambda function code rather than in the state machine definition.

How to eliminate wrong answers

Option A is wrong because the Retry clause in a Lambda function's configuration (e.g., in the function's reserved concurrency or event source mapping) does not control Step Functions retries; Step Functions retries are defined in the state machine definition, not in the Lambda function itself. Option C is wrong because wrapping the Lambda invocation in a custom while loop within the function code would not integrate with Step Functions' retry mechanism and would violate the serverless orchestration pattern, as Step Functions manages retries at the state machine level. Option D is wrong because the Catch field is used to handle errors by redirecting to a different state (e.g., a fallback or error-handling state), not to implement retry logic; retries are handled exclusively by the Retry field.

488
MCQhard

A company runs a containerized application on Amazon ECS using Fargate launch type. The application needs to read and write files to a shared file system across multiple tasks. The development team wants a solution that provides high throughput and is POSIX-compliant. Which storage solution should the team use?

A.Amazon S3 with mountpoint-s3
B.Amazon EFS
C.Amazon EBS with multi-attach enabled
D.Amazon FSx for Windows File Server
AnswerB

Amazon EFS provides a fully managed, scalable, and highly available network file system (NFS) that offers full POSIX compliance. This enables multiple Amazon ECS tasks, even those running on different EC2 instances or Fargate across various Availability Zones, to concurrently read and write to the same shared file system. EFS is an ideal solution for containerized applications requiring persistent, consistent, and shared file storage that behaves like a traditional file system.

Why this answer

Amazon EFS is the correct choice because it provides a fully managed, POSIX-compliant shared file system that can be mounted concurrently by multiple Amazon ECS tasks using the Fargate launch type. EFS uses the NFSv4.1 protocol, supports high throughput (up to 10 GB/s with Bursting or Provisioned Throughput modes), and automatically scales storage capacity as files are added or removed, making it ideal for shared read/write workloads across containers.

Exam trap

The trap here is that candidates often confuse Amazon EBS Multi-Attach with a shared file system, but EBS Multi-Attach is limited to EC2 instances in the same AZ and does not support Fargate, while EFS is the only POSIX-compliant, fully managed file system that works natively with Fargate tasks across multiple Availability Zones.

How to eliminate wrong answers

Option A is wrong because Amazon S3 with mountpoint-s3 is an object storage service that uses a custom FUSE-based mount, which is not POSIX-compliant (e.g., it does not support file locking, hard links, or atomic renames) and is designed for high-latency, throughput-oriented workloads rather than low-latency shared file system access. Option C is wrong because Amazon EBS with multi-attach enabled supports only up to 16 Nitro-based EC2 instances, not Fargate tasks, and requires the volume to be attached to instances in the same Availability Zone, making it unsuitable for a serverless container environment. Option D is wrong because Amazon FSx for Windows File Server uses the SMB protocol and is not POSIX-compliant; it is designed for Windows-based workloads and does not natively support Linux containers without additional translation layers.

489
MCQhard

A company uses AWS CloudFormation to deploy infrastructure. They have a stack that creates an Amazon RDS DB instance. They want to update the DB instance class without downtime. Which update policy should they use?

A.UseLatestRestorableTime
B.AutoScalingRollingUpdate
C.UpdateReplacePolicy
D.CreationPolicy
AnswerA

UseLatestRestorableTime is not an update policy. It is a property used to restore from the latest restorable snapshot when creating a read replica or performing a restore operation. It does not affect updates to an existing DB instance class and does not minimize downtime.

Why this answer

None of the listed options is correct. AWS CloudFormation does not have a built-in update policy that avoids downtime when changing the DB instance class of an RDS instance. To modify the instance class with minimal downtime, you can use a custom approach such as creating a read replica, promoting it, and updating DNS, or modifying the DB instance directly (which typically involves brief downtime).

The options presented are either invalid or unrelated: UseLatestRestorableTime is a property for restoring from a snapshot or creating read replicas, not an update policy; AutoScalingRollingUpdate is for Auto Scaling groups; UpdateReplacePolicy controls replacement behavior; CreationPolicy controls creation signals.

Exam trap

The trap is to assume that one of the listed options is a valid CloudFormation update policy for RDS. In fact, none of the provided options is a valid update policy for changing an RDS DB instance class, and UseLatestRestorableTime is not an update policy at all. CloudFormation does not have a built-in update policy that avoids downtime for RDS instance class changes.

How to eliminate wrong answers

Option B is wrong because `AutoScalingRollingUpdate` is a policy for Auto Scaling groups, not for RDS DB instances; it updates instances in a rolling fashion but does not apply to database resources. Option C is wrong because `UpdateReplacePolicy` is not a valid CloudFormation policy; the correct attribute is `DeletionPolicy` (which controls what happens when a resource is deleted), and `UpdateReplacePolicy` does not exist. Option D is wrong because `CreationPolicy` is used to control the creation of resources (e.g., waiting for signals from EC2 instances), not for updating existing resources like RDS instances.

490
MCQhard

A company is running a containerized application on Amazon ECS with Fargate launch type. The application needs to access an Amazon S3 bucket. The company wants to follow the principle of least privilege. How should the developer provide the necessary permissions?

A.Use Amazon EFS to store access keys.
B.Assign an IAM instance profile to the Fargate tasks.
C.Create an IAM task role with S3 permissions and associate it with the ECS task definition.
D.Store AWS credentials in the container image.
AnswerC

Creating an IAM task role with S3 permissions and associating it with the ECS task definition is the recommended and most secure approach. This method grants temporary, specific permissions directly to the containers within an ECS task, allowing them to interact with AWS services like S3 without embedding static credentials. It adheres to the principle of least privilege, ensuring the application only has the necessary permissions and that credentials are automatically managed and rotated by AWS.

Why this answer

Amazon ECS with Fargate launch type uses IAM task roles to grant permissions to containers at the task level. The task role is an IAM role that the ECS task assumes, allowing the application to securely access S3 without hardcoding credentials. This follows the principle of least privilege by scoping permissions to the specific task and using temporary credentials via the AWS STS service.

Exam trap

The trap here is that candidates confuse instance profiles (used with EC2 launch type) with task roles (used with Fargate), leading them to select Option B, but Fargate tasks cannot assume an instance profile because there is no underlying EC2 instance.

How to eliminate wrong answers

Option A is wrong because Amazon EFS is a file storage service, not a credential store; it cannot be used to store or provide access keys for IAM permissions. Option B is wrong because Fargate tasks do not use instance profiles; instance profiles are used with EC2 launch type to grant permissions to the underlying EC2 instance, not to the containers. Option D is wrong because storing AWS credentials in the container image violates security best practices, as credentials would be exposed in the image layers and cannot be rotated or scoped to least privilege.

491
Multi-Selectmedium

A company wants to encrypt data at rest in an Amazon RDS for MySQL DB instance. Which of the following are true about RDS encryption? (Select THREE.)

Select 3 answers
A.Encryption at rest can be enabled on an existing unencrypted DB instance.
B.Encryption at rest can be enabled when you create the DB instance.
C.Snapshots of an encrypted instance are encrypted.
D.When encryption is enabled, automated backups are encrypted.
E.Read replicas of an encrypted instance can be unencrypted.
AnswersB, C, D

Encryption at rest is an instance-level configuration selected at the moment you create the DB instance. When you launch a new RDS database, you choose the 'Enable encryption' option and specify an AWS KMS key; from that point onward, all data on the underlying storage is AES-256 encrypted, and this setting cannot be changed after creation.

Why this answer

Encryption at rest for Amazon RDS MySQL can only be enabled when you create the DB instance (B). Once created, you cannot enable encryption on an unencrypted instance (A is false). When encryption is enabled, snapshots (C), automated backups (D), and read replicas are all encrypted.

Read replicas of an encrypted instance must also be encrypted, so E is false. Therefore, options B, C, and D are correct.

492
Multi-Selecthard

A developer is troubleshooting a slow-running Amazon RDS for PostgreSQL instance. Which TWO metrics should the developer examine in Amazon CloudWatch to identify a possible resource bottleneck?

Select 2 answers
A.CPUUtilization
B.ReadIOPS and WriteIOPS with high Average Queue Depth
C.FreeableMemory
D.NetworkThroughput
E.DatabaseConnections
AnswersA, B

When CPUUtilization is high, the database engine is busy executing queries, parsing SQL, and managing internal tasks, leaving little processing headroom for new operations. On an undersized RDS instance, consistent CPU saturation translates directly into slower query response times and even connection timeouts during peak load. This metric is the most direct signal that the instance's compute capacity is a limiting factor.

Why this answer

High CPU utilization indicates a CPU bottleneck, which can slow down query processing. Option B is correct because high ReadIOPS and WriteIOPS accompanied by a high Average Queue Depth signal an I/O bottleneck, where the storage subsystem cannot keep up with requests. Option C is incorrect because FreeableMemory alone does not directly indicate a performance bottleneck; while low memory can cause issues, it is not a primary metric for resource bottlenecks.

Option D is incorrect because NetworkThroughput is rarely a limiting factor for RDS performance; the database typically processes requests faster than network bandwidth constraints. Option E is incorrect because DatabaseConnections only indicates the number of connections, not a direct resource bottleneck; performance problems are better captured by CPU or I/O metrics.

493
Drag & Dropmedium

Drag and drop the steps to encrypt an EBS volume using AWS KMS in the correct order.

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

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

Why this order

First create a KMS key, then snapshot the unencrypted volume, copy with encryption, and create the encrypted volume.

494
MCQhard

A developer notices that an Amazon RDS for MySQL DB instance's CPU utilization is consistently above 90% during peak hours. The application uses read-heavy workloads. Which action would MOST effectively reduce CPU load without major architectural changes?

A.Implement an in-memory cache layer with Amazon ElastiCache.
B.Migrate the database to Amazon Aurora with auto-scaling.
C.Increase the DB instance size to a larger instance type.
D.Create a Multi-AZ deployment and use the standby for read queries.
AnswerA

Implementing an in-memory cache layer with Amazon ElastiCache (e.g., Redis or Memcached) is an effective strategy for reducing CPU load on a read-heavy database. By caching frequently accessed data, ElastiCache intercepts read requests before they reach the database, serving them much faster from memory. This significantly decreases the number of queries the RDS instance needs to process, directly lowering its CPU utilization and improving overall application responsiveness. It requires application-level changes to interact with the cache, but these are typically manageable.

Why this answer

The most effective solution without major architectural changes. Amazon ElastiCache provides an in-memory cache that offloads read traffic from the RDS instance, reducing CPU utilization. While it requires application modifications to integrate the cache, this is a standard practice and does not involve a full database migration or architectural overhaul.

Option B (migrate to Aurora) involves significant migration effort. Option C (increase instance size) may temporarily help but is less cost-effective and does not address the read-heavy nature. Option D is incorrect because Multi-AZ standby instances are for failover only and cannot serve read queries.

Exam trap

A common trap is assuming that a Multi-AZ standby can be used for read traffic. In AWS RDS, Multi-AZ standby is strictly for high availability and cannot serve reads. Read replicas are needed for offloading read queries.

495
Multi-Selecthard

A developer is using AWS X-Ray to trace a Lambda function that calls DynamoDB and SQS. Some traces show errors. Which TWO actions should the developer take to diagnose the issue?

Select 2 answers
A.Examine the trace details for exception messages.
B.Verify that the Lambda function's IAM role has permissions for X-Ray.
C.Check the X-Ray service map for error edges.
D.Disable X-Ray sampling to capture all requests.
E.Enable CloudFront to cache responses.
AnswersA, C

Examining X-Ray trace details is the most direct and effective method to diagnose errors within a Lambda function. Each trace provides granular information for segments and subsegments, including full stack traces, precise exception messages, error codes, and specific HTTP status codes for downstream calls. This allows a developer to pinpoint the exact failure point, whether it's within the Lambda's code logic or an issue with an external service call, such as a DynamoDB throttling exception or a permission denied error.

Why this answer

To diagnose errors in existing X-Ray traces, the developer should examine trace details (Option A) to see exception messages and stack traces for each segment, and check the service map (Option C) for error edges that indicate which service interactions failed. Option B is about enabling X-Ray permissions, which is a prerequisite for tracing but does not help diagnose errors in traces that are already captured. Option D (disabling sampling) is unnecessary because X-Ray captures errors by default regardless of sampling.

Option E (CloudFront caching) is unrelated to trace diagnostics.

Exam trap

A common trap is selecting Option B, thinking that ensuring X-Ray permissions is a diagnostic step. However, missing permissions would prevent traces from being sent at all; since traces are present, the focus should be on analyzing the existing trace data (details and service map) to find error causes.

496
MCQhard

A developer is using AWS CodeDeploy to deploy an application to an EC2 Auto Scaling group. The deployment must ensure that a minimum number of instances are always running and healthy. The developer wants to deploy to 10 instances. Which deployment configuration should the developer use?

A.CodeDeployDefault.OneAtATime
B.CodeDeployDefault.AllAtOnce
C.CodeDeployDefault.HalfAtATime
D.CodeDeployDefault.MinHealthyHostsPercentage: 90
AnswerA

This configuration ensures that only one instance is taken offline for deployment at any given time, maintaining the maximum possible number of healthy instances throughout the process. Specifically, it guarantees that N-1 instances remain healthy and serving traffic while one instance is updated and validated. This sequential approach is ideal for achieving zero-downtime deployments, minimizing service impact, and ensuring high availability for critical applications.

Why this answer

CodeDeployDefault.OneAtATime, is correct because it ensures that only one instance is updated at a time, which guarantees that a minimum number of instances (9 out of 10) remain healthy and running throughout the deployment. This configuration is ideal for maintaining high availability and meeting strict uptime requirements.

Exam trap

The trap here is that candidates often mistake 'CodeDeployDefault.MinHealthyHostsPercentage: 90' for a predefined deployment configuration. In reality, the only predefined configurations are CodeDeployDefault.OneAtATime, CodeDeployDefault.HalfAtATime, and CodeDeployDefault.AllAtOnce. 'MinHealthyHostsPercentage' is a parameter used to define custom configurations, not a standalone predefined name.

How to eliminate wrong answers

Option B (CodeDeployDefault.AllAtOnce) is wrong because it deploys to all 10 instances simultaneously, which can cause a complete outage if the deployment fails or the application has issues. Option C (CodeDeployDefault.HalfAtATime) is wrong because it deploys to 5 instances at a time, which does not guarantee that a minimum number of instances (e.g., 9) are always running; it only ensures half are updated at once, potentially leaving only 5 healthy instances. Option D (CodeDeployDefault.MinHealthyHostsPercentage: 90) is wrong because it is not a valid predefined deployment configuration in AWS CodeDeploy; it is a custom configuration option that can be set via the API or CLI, but it is not a built-in named configuration like the others.

497
MCQeasy

A company stores sensitive customer data in Amazon S3. The security policy requires that all data be encrypted at rest using server-side encryption with a customer-managed AWS KMS key. Which S3 server-side encryption option should the developer use?

A.SSE-S3
B.SSE-KMS
C.SSE-C
D.Client-side encryption
AnswerB

SSE-KMS utilizes AWS Key Management Service (KMS) to manage encryption keys, allowing customers to use either AWS-managed KMS keys or customer-managed keys (CMKs). This method provides a robust audit trail through AWS CloudTrail for key usage and enables granular access control policies on the keys themselves. It directly supports the requirement for customer-managed encryption keys by integrating with KMS, offering control over key lifecycle and permissions.

Why this answer

SSE-KMS is the correct option because it provides server-side encryption with a customer-managed AWS KMS key, allowing the company to control key rotation, access policies, and audit usage via AWS CloudTrail. This meets the security policy requirement for encryption at rest using a customer-managed key, which SSE-S3 (using AWS-managed keys) and SSE-C (using customer-provided keys) do not fulfill.

Exam trap

The trap here is that candidates often confuse SSE-KMS with SSE-S3, assuming both use AWS-managed keys, but SSE-KMS uniquely supports customer-managed keys and additional control features like key rotation and audit logging.

How to eliminate wrong answers

Option A (SSE-S3) is wrong because it uses AWS-managed keys, not customer-managed keys, so it does not meet the policy requirement for customer control over the encryption key. Option C (SSE-C) is wrong because it requires the customer to provide their own encryption keys in each request, and AWS does not manage or store the key, which contradicts the requirement for a customer-managed AWS KMS key. Option D (Client-side encryption) is wrong because it encrypts data before sending it to S3, not at rest on the server side, and does not use S3 server-side encryption at all.

498
MCQeasy

A developer is building a web application that must encrypt data in transit. Which AWS service should be used to manage SSL/TLS certificates?

A.AWS KMS
B.AWS Secrets Manager
C.AWS CloudHSM
D.AWS Certificate Manager (ACM)
AnswerD

AWS Certificate Manager (ACM) is the correct service for encrypting a web application because it fully automates the provisioning, management, and deployment of public and private SSL/TLS certificates. ACM handles the complex processes of certificate issuance, renewal, and binding to integrated AWS services like Elastic Load Balancers, CloudFront distributions, and API Gateways. This ensures secure, encrypted communication for web applications without manual intervention, simplifying certificate lifecycle management significantly.

Why this answer

AWS Certificate Manager (ACM) is the correct service because it is specifically designed to provision, manage, and deploy public and private SSL/TLS certificates for use with AWS services (e.g., Elastic Load Balancers, CloudFront, API Gateway). It handles the full lifecycle of certificates, including renewal, which directly addresses the requirement to encrypt data in transit using HTTPS.

Exam trap

The trap here is that candidates often confuse AWS KMS (used for encryption keys for data at rest) with SSL/TLS certificate management for data in transit, leading them to select KMS instead of ACM.

How to eliminate wrong answers

Option A is wrong because AWS KMS is a key management service for symmetric and asymmetric encryption keys used for data at rest, not for managing SSL/TLS certificates for data in transit. Option B is wrong because AWS Secrets Manager is designed to rotate and manage secrets such as database credentials and API keys, not SSL/TLS certificates. Option C is wrong because AWS CloudHSM provides dedicated hardware security modules for generating and storing encryption keys, but it does not manage SSL/TLS certificates or integrate directly with AWS services for automatic certificate deployment and renewal.

499
Drag & Dropmedium

Drag and drop the steps to authenticate a user using Amazon Cognito User Pools in the correct order.

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

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

Why this order

First create the user pool and app client, then authenticate to receive tokens, and use tokens for authorization.

500
MCQhard

A developer is building a REST API using Amazon API Gateway and AWS Lambda. The API receives a large number of requests with duplicate payloads from the same client within a short time window. To reduce Lambda invocations and improve performance, the developer wants to return the previously computed response for identical requests based on a unique client ID in the header. How can the developer achieve this using API Gateway features?

A.Enable API Gateway caching on the stage and configure the client ID header as a cache key parameter. Set a cache TTL of 5 minutes.
B.Configure a usage plan with a quota and throttle settings to limit requests per client ID.
C.Use request validation to reject requests that have the same client ID within 5 minutes.
D.Reduce the Lambda function's batch size to 1 and implement caching logic inside the function using an external cache like ElastiCache.
AnswerA

API Gateway caching uses cache key parameters to index responses. By including the client ID header in the cache key, different clients get separate cached responses. The TTL controls how long the response is cached.

Why this answer

API Gateway caching allows you to store responses for a configurable TTL and use the client ID header as a cache key parameter. This means that when a request with the same client ID arrives within the TTL window, API Gateway returns the cached response directly without invoking the Lambda function, reducing invocations and improving performance.

Exam trap

The trap here is that candidates may confuse API Gateway caching (which returns cached responses for identical cache keys) with usage plans or throttling (which only limit request rates) or with Lambda-level caching (which still incurs invocation costs).

How to eliminate wrong answers

Option B is wrong because usage plans with quota and throttle settings limit the rate or total number of requests, but they do not return previously computed responses for duplicate payloads; they simply reject or delay requests. Option C is wrong because request validation in API Gateway only checks the structure and presence of required headers or body fields, not the content or duplication of payloads; it cannot reject requests based on a client ID being repeated. Option D is wrong because reducing the Lambda batch size to 1 is irrelevant (Lambda functions process one event at a time by default) and implementing caching inside the function with ElastiCache would still invoke Lambda for every request, missing the goal of reducing invocations; API Gateway caching avoids Lambda invocation entirely for cached responses.

501
MCQeasy

A developer needs to securely store database credentials used by an application running on EC2. Which AWS service should be used?

A.AWS Secrets Manager
B.AWS Systems Manager Parameter Store
C.Amazon S3
D.AWS Certificate Manager (ACM)
AnswerA

AWS Secrets Manager is the optimal choice for securely storing and managing database credentials because it is purpose-built for secrets lifecycle management. It offers robust features such as automatic rotation of credentials, integration with various AWS databases like Amazon RDS, and fine-grained access control through AWS Identity and Access Management (IAM). This service ensures that credentials are automatically updated without requiring manual intervention, significantly enhancing security posture and reducing the risk of compromise.

Why this answer

AWS Secrets Manager is the correct choice because it is purpose-built for securely storing, rotating, and managing database credentials and other secrets throughout their lifecycle. It offers automatic rotation of credentials for Amazon RDS, Redshift, and DocumentDB with built-in integration, and it encrypts secrets at rest using AWS KMS. For an EC2 application, Secrets Manager can be accessed via the AWS SDK or CLI using IAM roles attached to the EC2 instance, ensuring credentials are never hardcoded or stored in plaintext.

Exam trap

The trap here is that candidates often confuse AWS Systems Manager Parameter Store with Secrets Manager because both can store secrets, but Parameter Store does not support automatic rotation for database credentials, which is a key requirement for securely managing database credentials in production.

How to eliminate wrong answers

Option B is wrong because AWS Systems Manager Parameter Store is a hierarchical store for configuration data and secrets, but it lacks native automatic rotation for database credentials and does not provide the same level of integration with RDS or other database services as Secrets Manager. Option C is wrong because Amazon S3 is an object storage service designed for storing files and static data, not for securely managing sensitive credentials with built-in rotation and access control via IAM policies. Option D is wrong because AWS Certificate Manager (ACM) is specifically for managing SSL/TLS certificates, not for storing database credentials or other secrets.

502
MCQhard

A developer is deploying a microservices application using Amazon ECS with Fargate. The application consists of multiple services that need to communicate with each other over HTTP. The developer wants to ensure that service-to-service communication is encrypted in transit and that the services can discover each other by logical service names instead of IP addresses. Which combination of AWS services should the developer use?

A.Elastic Load Balancing with AWS Systems Manager
B.Amazon Route 53 with AWS Direct Connect
C.AWS Lambda with Amazon API Gateway
D.AWS App Mesh with AWS Cloud Map
AnswerD

AWS App Mesh is a service mesh that provides application-level networking to make it easy to run microservices, offering capabilities like mutual TLS (mTLS) for secure communication, traffic routing, and observability. AWS Cloud Map is a cloud resource discovery service that allows developers to register and discover application resources, such as microservices, using custom names. Together, App Mesh leverages Cloud Map for dynamic service discovery, enabling secure, observable, and resilient inter-service communication within a microservices architecture, directly addressing the requirements for mTLS and service discovery.

Why this answer

AWS App Mesh provides a service mesh that handles service-to-service communication with encryption in transit using TLS, while AWS Cloud Map enables service discovery by logical names, allowing ECS services to resolve each other via DNS or API calls. Together, they meet the requirements for encrypted HTTP communication and logical name resolution without exposing IP addresses.

Exam trap

The trap here is that candidates often confuse service discovery with load balancing or serverless APIs, overlooking that App Mesh provides both encrypted service mesh and Cloud Map for logical name resolution, which is the exact combination needed for secure, discoverable inter-service communication.

How to eliminate wrong answers

Option A is wrong because Elastic Load Balancing handles traffic distribution but does not provide service discovery by logical names or built-in encryption for service-to-service communication, and AWS Systems Manager is for operational management, not service mesh. Option B is wrong because Amazon Route 53 can provide DNS-based service discovery, but AWS Direct Connect is a dedicated network connection to on-premises, not relevant for service-to-service encryption or discovery within ECS. Option C is wrong because AWS Lambda and Amazon API Gateway are for serverless API backends, not for managing inter-service communication and discovery in a microservices architecture on ECS.

503
MCQhard

A developer is designing a serverless application that uses Amazon API Gateway and AWS Lambda. The application needs to handle a sudden spike in traffic. The Lambda function performs CPU-intensive operations. What should the developer do to ensure the application scales without errors?

A.Set the API Gateway throttling limits to a high value.
B.Use an Amazon SQS queue to buffer requests before processing.
C.Configure the Lambda function with reserved concurrency and provisioned concurrency.
D.Increase the Lambda function timeout to the maximum value.
AnswerC

Configuring a Lambda function with reserved concurrency guarantees a specific number of concurrent executions are always available for that function, preventing other functions from consuming its capacity and ensuring it can scale. Provisioned concurrency goes further by pre-initializing a specified number of execution environments, ensuring that invocations within this limit experience significantly reduced latency by eliminating cold starts. Together, these settings provide dedicated capacity and optimize startup performance.

Why this answer

Reserved concurrency guarantees that the Lambda function has a dedicated pool of concurrency available to handle traffic spikes without being throttled by other functions in the account, while provisioned concurrency pre-warms execution environments to eliminate cold starts for CPU-intensive operations. This combination ensures that the application scales smoothly under sudden load without encountering Lambda throttling errors (HTTP 429) or latency spikes from cold starts.

Exam trap

The trap here is that candidates often confuse API Gateway throttling (which controls request rate at the API level) with Lambda concurrency management, leading them to pick Option A, when the real bottleneck is Lambda's concurrency limits and cold starts for CPU-intensive functions.

How to eliminate wrong answers

Option A is wrong because setting API Gateway throttling limits to a high value only controls the request rate at the API layer, not the Lambda concurrency; if Lambda concurrency limits are exceeded, requests will still be throttled with 429 errors regardless of API Gateway settings. Option B is wrong because using an SQS queue to buffer requests introduces asynchronous processing, which is unsuitable for a synchronous API Gateway integration that expects immediate responses; the queue would decouple the request-response cycle and cause timeouts or lost responses. Option D is wrong because increasing the Lambda function timeout to the maximum value (900 seconds) does not address concurrency limits or cold starts; it only allows the function to run longer, which does not prevent throttling errors when traffic spikes exceed the available concurrency.

504
MCQeasy

A developer is building a microservice that needs to invoke another AWS Lambda function and wait for the result to continue processing. Which Lambda invocation type must the developer use to achieve synchronous invocation?

A.RequestResponse
B.Event
C.DryRun
D.None of the above
AnswerA

When a microservice needs to invoke another AWS Lambda function synchronously, the RequestResponse invocation type is used. This causes the invoking client to pause its execution and wait for the target Lambda function to fully execute and return its response payload. The client receives the function's output, including any errors, directly, enabling real-time processing and decision-making based on the invoked function's result.

Why this answer

The RequestResponse invocation type is the correct choice for synchronous invocation of a Lambda function, where the caller waits for the function to execute and receive a response. This is the default invocation type when using the Invoke API with InvocationType set to 'RequestResponse', and it is required for microservices that need to block until the downstream Lambda returns a result.

Exam trap

The trap here is that candidates may confuse the Event invocation type (asynchronous) with synchronous behavior, or mistakenly think DryRun is a valid Lambda invocation type, leading them to select 'None of the above' when they don't recognize RequestResponse as the correct term.

How to eliminate wrong answers

Option B is wrong because the Event invocation type is asynchronous; it queues the invocation and returns immediately with an HTTP status code of 202, without waiting for the function to execute or return a result. Option C is wrong because DryRun is not a valid Lambda invocation type; it is a parameter used with other AWS services (e.g., EC2) to test permissions without executing the action. Option D is wrong because 'None of the above' is incorrect since RequestResponse is a valid and correct invocation type for synchronous invocation.

505
MCQeasy

A developer is deploying a serverless application using the AWS Serverless Application Model (SAM). The application consists of an API Gateway endpoint and an AWS Lambda function. The developer wants to define a stage name for the API Gateway deployment. Which section of the SAM template should the developer use?

A.Globals
B.Conditions
C.Outputs
D.Parameters
AnswerA

The `Globals` section in an AWS SAM template is specifically designed to define common properties that apply to all resources of a particular type within the template. For API Gateway resources, setting `Api.StageName` within the `Globals` section ensures that every API defined in the template will automatically use the specified stage name. This approach centralizes the configuration, making it efficient for a developer to apply a consistent stage name across all APIs in a serverless application.

Why this answer

The `Globals` section in an AWS SAM template allows you to define shared configuration settings that apply to all resources in the template. For API Gateway, you can set properties like `StageName` under `Globals.Api`, which will be inherited by all API Gateway resources defined in the template, ensuring consistent stage naming without repeating the configuration.

Exam trap

The trap here is that candidates often think stage names must be defined directly on the API Gateway resource (e.g., under `Properties` of `AWS::Serverless::Api`), but the `Globals` section is the correct and more efficient way to set shared API Gateway properties like `StageName` across the entire template.

How to eliminate wrong answers

Option B is wrong because the `Conditions` section is used to define conditions that control whether certain resources are created or properties are set, not to define API Gateway stage names. Option C is wrong because the `Outputs` section is used to declare values that are returned after the stack is created (e.g., API endpoint URLs), not to configure deployment properties like stage names. Option D is wrong because the `Parameters` section is used to accept custom input values at deployment time (e.g., environment names), but it does not directly define a stage name for API Gateway; you would still need to reference a parameter in the resource or Globals section to set the stage name.

506
MCQmedium

A developer notices that an AWS Lambda function is timing out after 3 seconds. The function processes messages from an SQS queue. What is the MOST likely cause of the timeout?

A.The SQS dead-letter queue is not configured.
B.The SQS queue visibility timeout is too short.
C.The Lambda function timeout is set too low.
D.The Lambda function's reserved concurrency is set to zero.
AnswerC

The default timeout is 3 seconds; increasing it resolves the timeout.

Why this answer

The Lambda function is timing out after 3 seconds, which matches the default Lambda timeout. The most likely cause is that the function timeout is set too low (3 seconds) and needs to be increased to accommodate processing time. Option B (SQS visibility timeout) affects message redelivery but not the Lambda execution timeout.

Option D (reserved concurrency set to zero) would prevent any invocations, not cause a timeout after 3 seconds. Option A (dead-letter queue not configured) does not cause timeouts; it only affects where failed messages go.

507
MCQmedium

A developer is using Amazon API Gateway to expose a Lambda function as a REST API. The Lambda function queries an Amazon RDS database. Under heavy load, the database connection pool is exhausted, causing errors. What is the BEST way to manage database connections in this serverless architecture?

A.Migrate the database to Amazon DynamoDB.
B.Increase the concurrency limit of the Lambda function.
C.Use Amazon RDS Proxy to pool and share database connections.
D.Use Amazon ElastiCache to cache database connections.
AnswerC

Amazon RDS Proxy is specifically designed to manage and pool database connections for Amazon RDS. It acts as an intermediary, maintaining a pool of established connections to the RDS database and reusing them across multiple Lambda function invocations. This significantly reduces the overhead of opening and closing connections, preventing connection exhaustion and improving application scalability and responsiveness.

Why this answer

Amazon RDS Proxy sits between Lambda and RDS, managing a pool of database connections that can be reused across multiple concurrent Lambda invocations. This prevents connection exhaustion under heavy load without requiring code changes, as the proxy handles connection multiplexing and keeps idle connections warm.

Exam trap

The trap here is that candidates confuse connection pooling with caching (ElastiCache) or assume scaling Lambda concurrency will solve the issue, when in fact it exacerbates the connection exhaustion problem.

How to eliminate wrong answers

Option A is wrong because migrating to DynamoDB changes the database paradigm entirely, which is not a connection management solution and may not be feasible for existing relational workloads. Option B is wrong because increasing Lambda concurrency would actually worsen the problem by allowing more concurrent invocations to compete for the same limited pool of database connections. Option D is wrong because ElastiCache caches data, not database connections; it cannot pool or share TCP connections to RDS.

508
MCQhard

A developer is troubleshooting an Amazon API Gateway REST API that returns 504 Gateway Timeout errors for certain requests. The backend is a Lambda function that performs a resource-intensive operation that occasionally takes up to 30 seconds. API Gateway has a default integration timeout of 29 seconds. The developer cannot reduce the execution time. What should the developer do to resolve the timeout issue?

A.Increase the API Gateway integration timeout to 30 seconds.
B.Refactor the Lambda function to use asynchronous invocation, return a 202 immediately, and have the client poll for results.
C.Enable API Gateway caching to avoid repeated calls.
D.Use multiple Lambda functions to parallelize processing.
AnswerB

Refactoring the Lambda function to use asynchronous invocation, returning a 202 immediately, and having the client poll for results is the correct approach for long-running operations. This pattern decouples the synchronous API Gateway request from the extended backend processing, allowing API Gateway to respond promptly with a 202 Accepted status. The Lambda function can then trigger an asynchronous workflow (e.g., via SQS, SNS, or directly invoking another Lambda asynchronously) and store results for the client to retrieve later through a separate polling mechanism, effectively bypassing the 29-second timeout.

Why this answer

It decouples the client from the long-running Lambda execution. By invoking the Lambda asynchronously, the API Gateway can return a 202 Accepted response immediately, well within the 29-second integration timeout. The client then polls a separate endpoint (e.g., using a presigned S3 URL or a DynamoDB status record) to retrieve the final result, completely sidestepping the timeout limitation.

Exam trap

The trap here is that candidates assume the integration timeout is configurable to any value, but AWS enforces a hard 29-second limit for REST APIs, making Option A technically impossible.

How to eliminate wrong answers

Option A is wrong because Amazon API Gateway has a hard maximum integration timeout of 29 seconds for REST APIs (and 30 seconds for HTTP APIs). You cannot increase it beyond that limit, so setting it to 30 seconds is not possible. Option C is wrong because caching only serves previously computed responses for identical requests; it does not reduce the execution time of a new, uncached request that still takes up to 30 seconds.

Option D is wrong because parallelizing the Lambda function does not reduce the total execution time of a single resource-intensive operation; the request still waits for all parallel tasks to complete, which can still exceed the 29-second timeout.

509
MCQmedium

A company wants to enforce that all uploads to an Amazon S3 bucket must be encrypted using server-side encryption. The developer needs to write an IAM policy condition that denies any s3:PutObject request that does not include the server-side encryption header. Which IAM condition key should be used?

A.s3:x-amz-server-side-encryption
B.s3:x-amz-server-side-encryption-aws-kms-key-id
C.s3:x-amz-acl
D.s3:x-amz-storage-class
AnswerA

This condition key is used in an S3 bucket policy to evaluate the "x-amz-server-side-encryption" request header. By setting its value to "AES256" or "aws:kms" using a StringEquals operator, you can effectively mandate that all incoming PUT requests must include this header, thereby enforcing server-side encryption for all uploaded objects. This ensures data at rest is protected according to the specified encryption standard.

Why this answer

The `s3:x-amz-server-side-encryption` condition key matches the `x-amz-server-side-encryption` request header, which is used to specify server-side encryption (SSE-S3 or SSE-KMS) for S3 PutObject requests. By denying requests that do not include this header, the policy enforces that all uploads must be encrypted at rest using server-side encryption.

Exam trap

The trap here is that candidates confuse the condition key for requiring encryption (`s3:x-amz-server-side-encryption`) with the key for specifying a particular KMS key (`s3:x-amz-server-side-encryption-aws-kms-key-id`), leading them to pick option B when the question only asks about enforcing the presence of any server-side encryption header.

How to eliminate wrong answers

Option B is wrong because `s3:x-amz-server-side-encryption-aws-kms-key-id` is used to enforce a specific KMS key ID for SSE-KMS, not to require the presence of any server-side encryption header. Option C is wrong because `s3:x-amz-acl` controls access control list settings, not encryption. Option D is wrong because `s3:x-amz-storage-class` controls the storage class (e.g., STANDARD, GLACIER), not encryption.

510
MCQhard

An application stores session data in DynamoDB and must expire sessions automatically after a timestamp. Which feature should be used?

A.DynamoDB global tables
B.DynamoDB transactions
C.DynamoDB export to S3
D.DynamoDB Time to Live
AnswerD

DynamoDB Time to Live (TTL) is the correct solution as it enables automatic, cost-effective deletion of items from a table after a specified timestamp. By designating a numeric attribute (e.g., `expirationTime`) as the TTL attribute, DynamoDB asynchronously removes items once their timestamp value is in the past. This directly fulfills the requirement for expiring session data, reducing storage costs and simplifying application logic by offloading cleanup tasks.

Why this answer

DynamoDB Time to Live (TTL) allows you to define a timestamp attribute per item, and DynamoDB automatically deletes items once that timestamp is reached. This is the ideal feature for expiring session data without requiring custom scan-and-delete logic, reducing cost and operational overhead.

Exam trap

The trap here is that candidates may confuse DynamoDB TTL with DynamoDB Streams or Lambda triggers for cleanup, but TTL is the native, serverless mechanism that requires no custom code for expiration.

How to eliminate wrong answers

Option A is wrong because DynamoDB global tables replicate data across regions for low-latency access and disaster recovery, not for automatic expiration of items. Option B is wrong because DynamoDB transactions provide ACID guarantees for multi-item operations, not scheduled deletion based on time. Option C is wrong because DynamoDB export to S3 is used for point-in-time backups or data lake integration, not for expiring items within the table.

511
MCQhard

A developer is debugging an issue where an IAM user cannot list objects in an S3 bucket. The user has the following IAM policy attached: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::example-bucket" } ] }. What is missing?

A.The Resource ARN is incorrect.
B.The bucket has a bucket policy that denies access.
C.The user needs to enable S3 ACLs.
D.The policy needs to also allow s3:GetObject on the objects.
AnswerD

ListBucket lists objects but doesn't allow reading them; GetObject is needed to view object details.

Why this answer

The IAM policy only grants the s3:ListBucket permission, which allows listing the objects in the bucket but not reading their contents. To actually list objects, the s3:ListBucket action is sufficient; however, the question implies the user cannot list objects at all. The missing permission is s3:GetObject, which is required to retrieve object metadata and data when using certain S3 operations like GetObject or HeadObject.

Without s3:GetObject, the user may fail to list objects if the bucket policy or ACLs require read access for the listing operation to succeed.

Exam trap

The trap here is that candidates often assume s3:ListBucket alone is enough to list objects in the console or CLI, but they overlook that the console also needs s3:GetObject to display object metadata, leading them to incorrectly choose options like bucket policy or ACLs.

How to eliminate wrong answers

Option A is wrong because the Resource ARN 'arn:aws:s3:::example-bucket' is correct for the s3:ListBucket action, which targets the bucket itself, not individual objects. Option B is wrong because the question does not mention any bucket policy, and the IAM policy alone is sufficient to grant the listed permission; a bucket policy that denies access would be an explicit denial, but the issue is about missing permissions, not an explicit deny. Option C is wrong because S3 ACLs are not required for IAM users to list objects; IAM policies and bucket policies are the primary mechanisms for access control, and ACLs are legacy and disabled by default for new buckets.

512
MCQhard

A developer is using AWS CodeBuild to build a Java application. The build fails with 'OutOfMemoryError: Java heap space'. How can the developer fix this without changing the source code?

A.Add -Xmx1024m to the buildspec commands
B.Change the build image to a smaller one
C.Set the memory parameter in the build project
D.Increase the compute type of the build project
AnswerD

Increasing the compute type of the CodeBuild project is the correct solution for a Java application encountering a heap space error. CodeBuild compute types, such as BUILD_GENERAL1_MEDIUM or BUILD_GENERAL1_LARGE, provide progressively more CPU and, crucially, more memory to the build environment. By selecting a higher compute type, the underlying container running the build will have access to a larger pool of RAM, directly addressing the "out of heap space" issue by allowing the Java Virtual Machine to allocate more memory for the build process.

Why this answer

AWS CodeBuild allows you to increase the compute type (e.g., from BUILD_GENERAL1_SMALL to BUILD_GENERAL1_MEDIUM or LARGE), which provides more memory and CPU resources. This directly addresses the 'OutOfMemoryError: Java heap space' by giving the JVM more physical memory to work with, without requiring any source code changes.

Exam trap

The trap here is that candidates confuse the JVM's -Xmx flag (a code-level fix) with the infrastructure-level memory allocation controlled by the CodeBuild compute type, and incorrectly assume a 'memory parameter' exists as a separate setting in CodeBuild.

How to eliminate wrong answers

Option A is wrong because adding -Xmx1024m to the buildspec commands modifies the build process (a command-line change), which violates the constraint of not changing the source code; also, it only adjusts the JVM heap limit, not the underlying compute resources. Option B is wrong because changing the build image to a smaller one would reduce available memory, worsening the out-of-memory error. Option C is wrong because CodeBuild does not have a configurable 'memory parameter' in the build project settings; memory is tied directly to the compute type selection.

513
Multi-Selecthard

A developer is deploying an application that uses Amazon SQS queues. The messages contain sensitive data that must be encrypted at rest. Which TWO actions should the developer take? (Choose TWO.)

Select 2 answers
A.Encrypt the messages client-side before sending to SQS.
B.Store the messages in an S3 bucket with default encryption instead of using SQS.
C.Configure the SQS queue to use a customer managed KMS key.
D.Enable server-side encryption (SSE) for the SQS queue using AWS KMS.
E.Use AWS CloudHSM to generate and store the encryption keys.
AnswersC, D

Configuring an SQS queue to use a Customer Managed Key (CMK) from AWS Key Management Service (KMS) is a correct approach to enable server-side encryption (SSE) for messages at rest. This option provides enhanced control over the encryption key, allowing developers to define specific key policies, manage key rotation schedules, and audit all key usage through AWS CloudTrail. SQS will then use this CMK to encrypt messages upon receipt and decrypt them automatically when consumers retrieve them, meeting the requirement for encryption at rest.

Why this answer

Configuring an SQS queue to use a customer managed KMS key gives you control over the key lifecycle, including rotation and access policies, while still leveraging AWS KMS for server-side encryption. Option D is also correct because enabling server-side encryption (SSE) for SQS using AWS KMS encrypts messages at rest automatically, without requiring client-side changes. Together, these two actions ensure that sensitive data in SQS messages is encrypted at rest using KMS, meeting the requirement.

Exam trap

The trap here is that candidates often think client-side encryption (Option A) is required for encryption at rest, but SQS SSE with KMS provides server-side encryption at rest without needing to modify the application code, making client-side encryption redundant for this specific requirement.

514
MCQhard

A company uses AWS OpsWorks for configuration management. They want to deploy a new application version to a stack. Which lifecycle event should they use to run deployment scripts?

A.Configure
B.Undeploy
C.Setup
D.Deploy
AnswerD

The "Deploy" event is the correct and designated lifecycle event in AWS OpsWorks for installing or updating an application on an instance. When this event is triggered, OpsWorks executes recipes designed to fetch application code from a specified repository, install necessary dependencies, configure web servers, and start application services. This ensures the application is correctly placed, configured, and made available to users.

Why this answer

The Deploy lifecycle event in AWS OpsWorks is specifically designed to run deployment scripts when you deploy a new application version to a stack. This event occurs after the application code has been installed, allowing you to execute custom scripts for tasks like database migrations, cache clearing, or service restarts. It is the correct choice because it aligns with the deployment phase of the application lifecycle.

Exam trap

The trap here is that candidates confuse the Deploy event with the Setup or Configure events, mistakenly thinking that code deployment happens during initial instance setup or configuration updates, rather than understanding that Deploy is the dedicated event for application version releases.

How to eliminate wrong answers

Option A is wrong because the Configure lifecycle event runs whenever an instance enters or leaves the online state, not for deploying application code; it is used for updating configuration files or adjusting settings based on the stack's current state. Option B is wrong because Undeploy is not a standard lifecycle event in AWS OpsWorks; the correct event for removing an application is the Shutdown lifecycle event, which runs when an instance is stopped or terminated. Option C is wrong because the Setup lifecycle event runs only once when an instance is first booted, to install packages and configure the instance, not for deploying new application versions.

515
Multi-Selectmedium

A company uses AWS CodePipeline to deploy a web application. The pipeline has a Source stage (CodeCommit), a Build stage (CodeBuild), and a Deploy stage (CodeDeploy). The developer wants to add a manual approval step before the Deploy stage. Which TWO configurations are required?

Select 2 answers
A.An Amazon SES identity to send emails.
B.An AWS Lambda function to send approval emails.
C.An Amazon CloudWatch alarm to trigger the approval.
D.An IAM role that allows CodePipeline to publish to the SNS topic.
E.An Amazon SNS topic to notify the approver.
AnswersD, E

An IAM role is essential for CodePipeline to interact with other AWS services, including Amazon SNS. The CodePipeline service role must be granted explicit `sns:Publish` permissions to the target SNS topic. Without this specific permission, CodePipeline would lack the necessary authorization to send notification messages to the SNS topic, preventing approvers from being alerted about pending actions.

Why this answer

CodePipeline requires an IAM role with permissions to publish to an SNS topic in order to send notifications for manual approval actions. This role is assumed by CodePipeline to invoke the SNS Publish API, which delivers the approval request message to the configured topic. Without this role, the pipeline cannot notify the approver, and the approval step will fail.

Option E is correct because an SNS topic is the mechanism used to send the approval notification to the approver. The SNS topic is configured in the approval stage of the pipeline, and it publishes a message that is sent to the subscribed approvers (e.g., via email). Both the SNS topic and the IAM role allowing CodePipeline to publish to it are required for the manual approval action to function.

Exam trap

The trap here is that candidates often think an email-sending service like SES or a custom Lambda function is required, but the exam expects you to know that CodePipeline natively integrates with SNS for approval notifications and only needs the correct IAM permissions.

516
MCQhard

A company has a Lambda function that writes to an S3 bucket. The IAM role used by the function has an inline policy allowing s3:PutObject on the bucket. However, writes fail with an access denied error. What is the MOST likely cause?

A.The S3 bucket is in a different region.
B.The S3 bucket uses SSE-KMS encryption and the function lacks kms:Decrypt permissions.
C.The Lambda function does not have the correct execution role.
D.The S3 bucket has a bucket policy that denies the request.
AnswerD

This is the correct explanation because AWS IAM policy evaluation logic dictates that an explicit Deny in any applicable policy always overrides an Allow. Even if the Lambda function's execution role has an Allow statement for s3:PutObject, an explicit Deny statement within the S3 bucket policy will take precedence, resulting in an "Access Denied" error for the request. This mechanism allows resource owners to enforce strict access controls.

Why this answer

Even if the Lambda function's IAM role grants s3:PutObject, an explicit deny in the S3 bucket policy takes precedence over any allow. The access denied error indicates that the request is being evaluated and denied by the bucket policy, which overrides the IAM permission due to AWS's policy evaluation logic (explicit deny > allow).

Exam trap

The trap here is that candidates often assume IAM permissions alone are sufficient and overlook that S3 bucket policies can explicitly deny access, which overrides any IAM allow due to AWS's explicit deny precedence.

How to eliminate wrong answers

Option A is wrong because S3 operations work across regions; a bucket in a different region does not cause an access denied error—it would instead result in a redirect or a different error. Option B is wrong because if SSE-KMS were used, the function would need kms:GenerateDataKey or kms:Encrypt, not kms:Decrypt, and the error would typically be a 403 Forbidden with a KMS-specific message, not a generic access denied. Option C is wrong because the question states the IAM role has an inline policy allowing s3:PutObject, so the execution role is correctly assigned; the error is not due to a missing role but due to a conflicting bucket policy.

517
Multi-Selectmedium

A developer is designing a system that ingests high-volume data from IoT devices. The data must be processed in near real-time and then stored in Amazon S3 for analytics. Which TWO AWS services should the developer use together to meet these requirements? (Choose TWO.)

Select 2 answers
A.Amazon SQS
B.Amazon SNS
C.Amazon Kinesis Data Streams
D.Amazon EC2
E.AWS Lambda
AnswersC, E

Amazon Kinesis Data Streams is a fully managed, scalable service specifically designed for ingesting and processing large streams of data records in real time. It provides durable storage for up to 7 days, allowing multiple consumers to process the same data concurrently and independently. This makes it ideal for applications requiring real-time analytics, log aggregation, and continuous data ingestion from various sources at high throughput.

Why this answer

Amazon Kinesis Data Streams is designed for real-time ingestion of large data streams, such as IoT telemetry, and can capture and store data in shards for up to 365 days. AWS Lambda can be configured as a consumer of the Kinesis stream to process records in near real-time and then write the results to Amazon S3 for analytics. Together, they provide a serverless, scalable pipeline for high-volume IoT data.

Exam trap

The trap here is that candidates often confuse Amazon SQS or SNS as suitable for real-time streaming, but they lack the ordered, replayable, and parallel-consumer capabilities that Kinesis Data Streams provides for high-volume IoT ingestion.

518
MCQeasy

A developer is building a serverless application using AWS Lambda. The function needs to access a private S3 bucket in the same AWS account. What is the BEST way to grant the Lambda function access to the bucket?

A.Create an IAM execution role with an S3 access policy and attach it to the Lambda function.
B.Store AWS credentials in environment variables and use them in the function code.
C.Attach an inline IAM policy directly to the Lambda function.
D.Add a bucket policy to the S3 bucket allowing the Lambda function's ARN.
AnswerA

Creating an IAM execution role with an S3 access policy and attaching it to the Lambda function is the standard and most secure method. This role provides the Lambda function with temporary, scoped credentials to interact with other AWS services like S3, adhering to the principle of least privilege. It ensures that the function only has the necessary permissions without exposing sensitive, long-lived credentials.

Why this answer

The correct answer. The best practice for granting an AWS Lambda function access to an S3 bucket in the same account is to create an IAM execution role with a policy that allows the necessary S3 actions, and then attach that role to the Lambda function. This provides temporary credentials via STS, follows the principle of least privilege, and avoids hardcoding credentials.

Option B is incorrect because storing AWS credentials in environment variables is insecure and can lead to accidental exposure. AWS recommends using IAM roles for temporary credentials.

Option C is incorrect because Lambda functions do not support attaching IAM policies directly. Policies must be attached to an IAM role, and that role is assigned to the function.

Option D is incorrect because while a bucket policy could grant access based on the function's ARN, it is not the best approach for same-account access. Using an execution role is more scalable, easier to manage, and follows the principle of least privilege.

519
Multi-Selecthard

A company is using AWS CodeDeploy to deploy an application to an Auto Scaling group. The deployment group has a deployment configuration of CodeDeployDefault.AllAtOnce. During a deployment, some instances fail the deployment. Which THREE actions should the developer take to improve the deployment health?

Select 3 answers
A.Increase the minimum number of healthy instances in the Auto Scaling group.
B.Change the deployment configuration to CodeDeployDefault.OneAtATime.
C.Configure a lifecycle hook to run validation tests before the instance is marked as healthy.
D.Use a larger instance type to handle the deployment load.
E.Add an Elastic Load Balancer health check to the deployment group.
AnswersB, C, E

CodeDeployDefault.OneAtATime is a deployment configuration that deploys the application revision to a single instance at a time, pausing between instances to verify that the deployment succeeded. This minimizes the number of instances taken out of service concurrently, so if the new revision fails health checks, only a small fraction of traffic is affected. It also provides an automatic rollback or stop opportunity before the entire fleet is updated.

Why this answer

The correct options are B, C, and E.

Option A is incorrect: Increasing the minimum number of healthy instances in the Auto Scaling group does not affect CodeDeploy's deployment health checks; it only controls ASG scaling behavior.

Option B is correct: Changing the deployment configuration to CodeDeployDefault.OneAtATime reduces risk by deploying to one instance at a time, allowing you to detect and halt failures before affecting more instances.

Option C is correct: Configuring a lifecycle hook to run validation tests ensures that an instance is only marked healthy after passing critical checks, preventing unhealthy instances from receiving traffic.

Option D is incorrect: Using a larger instance type does not address the underlying cause of deployment failures (e.g., script errors, misconfigurations) and is not a direct mechanism to improve deployment health.

Option E is correct: Adding an Elastic Load Balancer health check to the deployment group allows CodeDeploy to verify that instances are healthy before completing the deployment, enabling automatic rollback if checks fail.

520
MCQhard

An application uses Amazon Cognito user pools for authentication. A developer wants to restrict access to an API Gateway endpoint to only authenticated users from a specific user pool. What is the best approach?

A.Attach an IAM policy to the API Gateway resource that allows only the Cognito user pool ARN.
B.Use a Cognito User Pool authorizer in API Gateway.
C.Use an API Gateway resource policy that allows access only from the Cognito user pool.
D.Use a Lambda authorizer that validates the JWT token against the user pool.
AnswerB

The Cognito User Pool authorizer in API Gateway is the purpose-built, native solution for validating JWTs issued by Amazon Cognito User Pools. It automatically inspects the `Authorization` header for a valid JWT, verifies its signature against the user pool's public keys, checks its expiration, and confirms the issuer. Upon successful validation, API Gateway allows the request to proceed to the backend integration, often passing decoded token claims for application use.

Why this answer

A Cognito User Pool authorizer in API Gateway is the native, fully managed way to restrict access to an API endpoint to authenticated users from a specific user pool. It automatically validates the JWT token issued by the user pool and caches the result, requiring no custom code. This approach integrates directly with API Gateway's authorization flow, ensuring only tokens from the specified user pool are accepted.

Exam trap

The trap here is that candidates often overcomplicate the solution by choosing a Lambda authorizer (option D) because they think they need custom validation logic, forgetting that API Gateway has a built-in Cognito User Pool authorizer that handles JWT validation natively without any custom code.

How to eliminate wrong answers

Option A is wrong because IAM policies cannot reference a Cognito user pool ARN as a principal or resource for API Gateway; IAM policies control access based on IAM users/roles, not user pool identities. Option C is wrong because API Gateway resource policies control access by source IP, VPC, or AWS account, not by Cognito user pool tokens or user pool ARN. Option D is wrong because while a Lambda authorizer could validate a JWT against a user pool, it is unnecessary overhead and not the 'best approach' when a built-in Cognito User Pool authorizer exists that is simpler, faster, and requires no custom code.

521
MCQmedium

A developer receives an AccessDenied error when trying to put an object into an S3 bucket using the AWS SDK. The IAM user has an attached policy that grants s3:PutObject on the bucket. What is the MOST likely cause of the error?

A.The request is being throttled by S3.
B.The object key is too long.
C.The AWS SDK version is outdated.
D.The bucket policy explicitly denies the action.
AnswerD

When evaluating permissions, AWS IAM follows a strict order of precedence where an explicit Deny statement always overrides any Allow statement. If a bucket policy contains an explicit Deny for a specific action or principal, that denial takes precedence over any Allow statement present in the requesting IAM user's or role's identity-based policy. This ensures that even if an identity policy grants permission, a resource-based policy can still block access, resulting in an AccessDenied error (HTTP 403).

Why this answer

The most likely cause is that the bucket policy explicitly denies the s3:PutObject action. IAM policies grant permissions, but S3 bucket policies can override them with an explicit deny, which takes precedence over any allow. Since the IAM user already has an attached policy allowing s3:PutObject, the only way to get an AccessDenied error is if a bucket policy explicitly denies the action.

Exam trap

The trap here is that candidates assume an IAM allow is sufficient, forgetting that S3 bucket policies can explicitly deny actions, and that explicit deny always wins over allow.

How to eliminate wrong answers

Option A is wrong because S3 throttling returns a 503 SlowDown error, not an AccessDenied error. Option B is wrong because an overly long object key would cause a 400 Bad Request error, not an AccessDenied error. Option C is wrong because an outdated SDK version might cause compatibility issues or missing features, but it would not result in an AccessDenied error; the error is a permissions issue, not a client version issue.

522
MCQmedium

A developer needs to encrypt secrets such as database passwords used by an application running on EC2. Which AWS service should be used to securely store and rotate these secrets?

A.AWS CloudHSM
B.AWS Secrets Manager
C.AWS KMS
D.AWS Systems Manager Parameter Store
AnswerB

AWS Secrets Manager is purpose-built for securely storing, managing, and retrieving various types of secrets, including database credentials, API keys, and other sensitive data. Its key feature is native integration with services like Amazon RDS, enabling automatic rotation of database passwords on a schedule or on demand. This capability is crucial for enhancing security posture and meeting compliance requirements by regularly changing sensitive credentials.

Why this answer

AWS Secrets Manager is the correct choice because it is specifically designed to securely store, manage, and automatically rotate secrets such as database passwords, API keys, and other credentials. It integrates natively with AWS services like RDS, Redshift, and DocumentDB to enable automatic rotation of secrets without custom code, and it enforces encryption at rest using AWS KMS. This makes it the ideal service for the use case described, where secrets must be both stored securely and rotated automatically.

Exam trap

The trap here is that candidates often confuse AWS Systems Manager Parameter Store with Secrets Manager because both can store secrets, but Parameter Store lacks native automatic rotation, which is the key requirement in this question.

How to eliminate wrong answers

Option A is wrong because AWS CloudHSM provides dedicated hardware security modules for cryptographic key storage and operations, but it does not offer a managed service for storing or rotating secrets like database passwords; it is a lower-level key management solution. Option C is wrong because AWS KMS is a key management service that creates and controls encryption keys used to encrypt data, but it does not store secrets or provide automatic rotation of secrets; it only supports automatic rotation of the KMS key itself, not the secret value. Option D is wrong because AWS Systems Manager Parameter Store can store secrets as SecureString parameters with KMS encryption, but it lacks built-in automatic rotation capabilities; any rotation would require custom implementation using AWS Lambda or other automation.

523
MCQmedium

A developer is deploying a containerized application on Amazon ECS with the Fargate launch type. The application needs to read data from an Amazon S3 bucket. The developer wants to follow the principle of least privilege. How should the developer grant the necessary permissions to the ECS tasks?

A.Store AWS access keys as environment variables in the task definition.
B.Create an IAM task role and reference it in the task definition using the 'taskRoleArn' parameter.
C.Create an IAM user and embed its credentials in the container image.
D.Use an S3 bucket policy that grants access based on the security group of the ECS tasks.
AnswerB

Creating an IAM task role and referencing it via the 'taskRoleArn' parameter in the task definition is the recommended and most secure method for granting AWS permissions to containers. ECS automatically injects temporary, frequently rotated credentials into the container's metadata service. This allows applications using the AWS SDK to seamlessly assume the role and access AWS resources without hardcoding any credentials, adhering to the principle of least privilege and secure credential management.

Why this answer

Amazon ECS with the Fargate launch type supports IAM task roles, which allow you to assign an IAM role to the ECS task itself. By referencing the IAM task role in the task definition using the 'taskRoleArn' parameter, the containerized application can securely obtain temporary credentials from the ECS container agent via the AWS STS service, adhering to the principle of least privilege without embedding long-lived credentials.

Exam trap

The trap here is that candidates may confuse IAM roles with IAM users or think that network-level controls like security groups can be used for S3 access, but AWS S3 does not evaluate security groups for authorization; only IAM policies and bucket policies are evaluated.

How to eliminate wrong answers

Option A is wrong because storing AWS access keys as environment variables in the task definition exposes long-term credentials in plaintext, violating the principle of least privilege and increasing the risk of credential leakage. Option C is wrong because embedding IAM user credentials in the container image is a security anti-pattern that hardcodes long-lived secrets, making rotation difficult and violating best practices for container security. Option D is wrong because S3 bucket policies cannot grant permissions based on security groups; security groups are network-level constructs for EC2 instances and are not evaluated by AWS S3 for access control decisions.

524
MCQmedium

A developer is implementing an e-commerce application where a purchase operation must deduct inventory and create an order atomically. The inventory and orders are stored in separate DynamoDB tables. Which DynamoDB feature should the developer use to execute these operations as a single, all-or-nothing transaction?

A.DynamoDB Streams
B.DynamoDB Transactions
C.DynamoDB Accelerator (DAX)
D.DynamoDB Global Tables
AnswerB

DynamoDB Transactions, specifically using `TransactWriteItems` or `TransactGetItems`, provide full ACID (Atomicity, Consistency, Isolation, Durability) guarantees for operations involving multiple items within a single table or across multiple tables. For an e-commerce purchase, this ensures that critical related operations, such as deducting inventory from one item and simultaneously creating a new order record, are treated as a single, indivisible unit. If any part of the transaction fails, all changes are rolled back, preventing data inconsistencies.

Why this answer

DynamoDB Transactions provide ACID (Atomicity, Consistency, Isolation, Durability) guarantees across one or more tables within a single AWS account and region. This allows the developer to combine the deduct-inventory and create-order operations into a single all-or-nothing transaction, ensuring that both succeed or both fail without partial updates.

Exam trap

The trap here is that candidates often confuse DynamoDB Streams with transactional capabilities, assuming that capturing changes in order guarantees atomicity, but Streams are asynchronous and cannot enforce all-or-nothing semantics across multiple tables.

How to eliminate wrong answers

Option A is wrong because DynamoDB Streams capture a time-ordered sequence of item-level changes in a table, but they do not provide atomicity or transactional coordination across multiple tables. Option C is wrong because DynamoDB Accelerator (DAX) is an in-memory caching layer that improves read performance but does not offer transactional write capabilities. Option D is wrong because DynamoDB Global Tables provide multi-region replication for disaster recovery and low-latency reads, but they do not enable atomic multi-table transactions within a single region.

525
MCQhard

A company has an S3 bucket that contains sensitive data. The security team requires that all objects uploaded to the bucket must be encrypted at rest using AWS KMS. Which combination of actions will enforce this?

A.Configure the bucket to use SSE-S3 by default.
B.Enable default encryption on the bucket with SSE-KMS.
C.Use a bucket policy that allows only PutObject with KMS encryption.
D.Use a bucket policy that denies PutObject if the x-amz-server-side-encryption header is not 'aws:kms'.
AnswerD

This enforces KMS encryption on every upload.

Why this answer

A bucket policy that denies PutObject requests when the `x-amz-server-side-encryption` header is not set to `aws:kms` enforces encryption at rest using AWS KMS for all uploads. This policy explicitly rejects any upload that does not include the required KMS encryption header, ensuring compliance with the security team's requirement. Default encryption settings (like SSE-S3 or SSE-KMS) can be overridden by the client, so a bucket policy is the only way to enforce encryption at the API level.

Exam trap

The trap here is that candidates often confuse default encryption with enforcement, not realizing that default encryption can be overridden by client-specified headers, whereas a bucket policy with a deny condition is the only way to mandate encryption at the API level.

How to eliminate wrong answers

Option A is wrong because configuring the bucket to use SSE-S3 by default encrypts objects with S3-managed keys, not AWS KMS, which does not meet the requirement for KMS encryption. Option B is wrong because enabling default encryption with SSE-KMS only applies when the client does not specify encryption headers; a client can still upload without KMS encryption by explicitly setting a different encryption header (e.g., `AES256`), bypassing the default. Option C is wrong because allowing only PutObject with KMS encryption does not deny requests that lack KMS encryption; it merely permits some requests, but without a deny statement, unencrypted uploads could still succeed if other permissions allow them.

Page 6

Page 7 of 10

Page 8

All pages