Tüm alıştırma soruları

1542 soru

Soru 1401Soru

A developer is implementing authentication and authorization for a mobile retail shopping application. The application needs to allow users to sign up and sign in, make authorized calls to a backend order processing API hosted on Amazon API Gateway, and upload scan logs directly to a private Amazon S3 bucket. Which architecture meets these requirements with the least operational overhead?

Cevabı ve açıklamayı göster

Cevap: Configure a Cognito User Pool to handle user registration and login. Set up a Cognito Authorizer on Amazon API Gateway to validate the tokens generated by the User Pool. Configure a Cognito Identity Pool to exchange the User Pool tokens for temporary AWS IAM credentials to authorize direct S3 uploads.

Cevap

Configure a Cognito User Pool to handle user registration and login. Set up a Cognito Authorizer on Amazon API Gateway to validate the tokens generated by the User Pool. Configure a Cognito Identity Pool to exchange the User Pool tokens for temporary AWS IAM credentials to authorize direct S3 uploads.
The correct solution leverages Cognito User Pools to authenticate users and generate JSON Web Tokens (JWTs). These tokens are verified directly by API Gateway using a built-in Cognito Authorizer, which requires no custom coding. To allow the mobile application to upload files directly to Amazon S3 without exposing static credentials or passing data through a backend, a Cognito Identity Pool is used to exchange the User Pool tokens for temporary, short-lived AWS IAM credentials.

Adım Adım Çözüm

1
Select Amazon Cognito User Pools for authentication.
Enables user signup, signin, and directory management, producing JSON Web Tokens (JWTs) upon successful authentication.
User Pools are built specifically for identity management and authentication.
2
Configure API Gateway with a native Cognito Authorizer.
Enables API Gateway to validate User Pool tokens automatically without custom code or running a Lambda function.
Minimizes operational overhead and cost compared to custom Lambda authorizers.
3
Configure a Cognito Identity Pool (Federated Identities).
Allows authenticated User Pool users to exchange their tokens for temporary AWS credentials mapped to an IAM role with S3 write permissions.
Identity Pools are the standard AWS mechanism to authorize users for direct access to AWS resources like Amazon S3.

Anahtar Kavram

Cognito User Pools handle authentication (identity directory), while Cognito Identity Pools handle authorization (temporary AWS credentials for direct resource access). API Gateway Cognito Authorizers natively validate User Pool tokens.
Soru 1402Soru

A developer is troubleshooting an application named PagePublish that stores metadata for online articles in an Amazon DynamoDB table. The table is configured with provisioned read capacity and uses ArticleStatus (such as DRAFT or PUBLISHED) as the partition key. During peak traffic hours, users experience high latency, and the application logs show numerous ProvisionedThroughputExceededException errors. Upon reviewing CloudWatch metrics, the developer notes that the read capacity is heavily consumed on a single partition, while other partitions remain idle. Which of the following is the most effective way to resolve this issue and prevent future throttling?

Cevabı ve açıklamayı göster

Cevap: Redesign the table schema to use a more granular attribute, such as ArticleID, as the partition key.

Cevap

Redesign the table schema to use a more granular attribute, such as ArticleID, as the partition key.
Redesigning the table schema to use a more granular attribute like ArticleID ensures that write and read requests are evenly distributed across multiple physical partitions. Since DynamoDB allocates partition capacity based on the partition key value, high-cardinality keys prevent hot partitions and eliminate ProvisionedThroughputExceededException errors caused by uneven traffic distribution.

Adım Adım Çözüm

1
Analyze the CloudWatch metrics and the exception logs.
Identify that the ProvisionedThroughputExceededException is occurring on a specific partition key value (ArticleStatus), indicating a hot partition issue.
Before applying a fix, the developer must determine if the throttling is due to overall capacity exhaustion or uneven key distribution.
2
Evaluate the cardinality of the partition key attribute.
Recognize that 'ArticleStatus' has very low cardinality (few distinct values like DRAFT or PUBLISHED), causing almost all requests to hit the same partition.
Understanding the key distribution characteristics is necessary to design a schema that distributes the workload evenly.
3
Select a partition key with high cardinality and modify the schema.
Choose a high-cardinality attribute like 'ArticleID' as the new partition key, which distributes read and write requests uniformly across partitions.
A high-cardinality partition key allows DynamoDB to partition the data across multiple physical SSDs, utilizing the provisioned throughput efficiently.

Anahtar Kavram

Resolving DynamoDB hot partitions by using a high-cardinality partition key design.
Tahmini Süre:1m 30s
Soru 1403Soru

A developer is building a client proofing portal for a photography studio. The portal must authenticate clients using email and password, allow them to upload selection feedback files directly to a secure Amazon S3 bucket, and access private backend APIs on Amazon API Gateway. Which TWO actions must the developer take to configure the authentication and authorization flow?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Set up a Cognito User Pool to handle user registration and sign-in, and configure a Cognito User Pool Authorizer on API Gateway to secure the APIs.; Set up a Cognito Identity Pool that uses the User Pool as an identity provider to obtain temporary AWS credentials for S3 bucket uploads.

Cevap

To configure the authentication and authorization flow, the developer must set up a Cognito User Pool to manage authentication and secure the API Gateway using a Cognito User Pool Authorizer, and set up a Cognito Identity Pool referencing the User Pool to obtain temporary AWS credentials for S3 uploads.
The system requires a Cognito User Pool to handle user directory registration, login, and token generation. The backend APIs are secured with minimal complexity by using the native Cognito User Pool Authorizer on API Gateway. Direct uploads to Amazon S3 are enabled by exchanging the user token for temporary AWS credentials via a Cognito Identity Pool, which assumes an authenticated IAM role with the necessary S3 permissions.

Adım Adım Çözüm

1
Configure a Cognito User Pool.
Establishes a user directory for client registration and authentication, issuing identity and access tokens (JWTs) upon successful login.
A User Pool is required to manage credentials and handle user sign-in.
2
Create a Cognito User Pool Authorizer on Amazon API Gateway.
API Gateway validates the token automatically for incoming requests without requiring custom code.
Using the native Cognito Authorizer reduces operational overhead and simplifies API security.
3
Create a Cognito Identity Pool and link it to the User Pool.
The client application can exchange User Pool tokens for temporary AWS credentials mapped to an IAM role with S3 write permissions.
An Identity Pool is necessary to delegate temporary AWS access for direct interaction with S3.

Anahtar Kavram

Amazon Cognito User Pools vs. Identity Pools and API Gateway Authorization
Soru 1404Soru

A developer is deploying a Go-based web application to Amazon EC2 instances. The application logs HTTP requests in a custom space-delimited format to /var/log/app/web.log. The fields in each log entry are: IP, client, user, datetime, request_path, response_status, and response_time_ms. The developer wants to use the unified CloudWatch agent to publish these logs to CloudWatch Logs and then create a metric filter to track only requests that returned an HTTP 404 response status. Which two configuration steps must the developer perform to meet these requirements?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: In the CloudWatch agent configuration file, specify the log file path under the logs.logs_collected.files section and define a target log group.; Create a CloudWatch Logs metric filter on the target log group using the pattern [ip, client, user, datetime, request_path, response_status = 404, response_time_ms].

Cevap

To monitor the space-delimited log file, the developer must configure the log file path under the logs.logs_collected.files section of the unified CloudWatch agent configuration file, and create a CloudWatch Logs metric filter with the pattern [ip, client, user, datetime, request_path, response_status = 404, response_time_ms].
To stream local log files to CloudWatch Logs, the unified CloudWatch agent must be configured with the file path in the logs.logs_collected.files section. To create a metric filter for space-delimited logs, the filter pattern must list all fields in order, enclosed in brackets, and use the assignment operator to filter on the specific HTTP status code.

Adım Adım Çözüm

1
Configure the CloudWatch agent to collect the log file.
The file path /var/log/app/web.log and log_group_name are added to the logs.logs_collected.files section.
This informs the agent daemon to track the target log file and stream its content to CloudWatch Logs.
2
Create the metric filter for space-delimited events.
The metric filter is created on the target log group using the positional bracketed syntax [ip, client, user, datetime, request_path, response_status = 404, response_time_ms].
Because the logs are space-delimited rather than JSON, CloudWatch Logs maps fields positionally. Specifying the preceding fields is necessary for the filter to target the sixth field, response_status.

Anahtar Kavram

Configuring log collection with the unified CloudWatch agent and applying space-delimited metric filter patterns.
Soru 1405Soru

An order ingestion application named OrderSync processes real-time transaction updates and writes them to an Amazon DynamoDB table. The table is configured with provisioned write capacity. During high-traffic flash sales, the application experiences a high rate of ProvisionedThroughputExceededException errors. CloudWatch metrics indicate that the overall write capacity consumption is well below the table's provisioned limit, but the write operations are concentrated on a small number of partition keys representing trending items.

Which TWO actions should the developer take to resolve these throttling issues? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Modify the application's write logic to append a random numeric suffix to the partition key for high-volume items to distribute writes across multiple partitions.; Implement exponential backoff and jitter in the application's SDK client retry configuration to handle transient throttling errors.

Cevap

Modify the application's write logic to append a random numeric suffix to the partition key for high-volume items, and implement exponential backoff and jitter in the application's SDK client retry configuration.
The correct options are to append a random numeric suffix to the partition key (which spreads the write requests across multiple physical partitions, preventing individual partition limit exhaustion) and to configure the AWS SDK with exponential backoff and jitter (which handles temporary spikes in write requests without failing the transactions outright).

Adım Adım Çözüm

1
Analyze the CloudWatch metrics and throttling errors.
Identified that the ProvisionedThroughputExceededException is caused by a hot partition key issue where writes are concentrated on a few trending items.
Before applying a fix, the developer must confirm whether the throttling is due to overall capacity exhaustion or uneven key distribution.
2
Apply write sharding using a random suffix.
The write requests are distributed across multiple partitions by appending a suffix, preventing a single partition from bearing the entire load.
DynamoDB partitions have a hard limit of 1000 WCU and 3000 RCU per partition. Distributing hot keys via sharding avoids hitting individual partition limits.
3
Configure the SDK retry policy with exponential backoff and jitter.
Transient throttling spikes are handled gracefully by retrying requests at randomized intervals.
Jitter prevents a 'thundering herd' problem where retried requests arrive simultaneously, causing repeated throttling.

Anahtar Kavram

Resolving DynamoDB throttling issues by avoiding hot partitions through partition key sharding and handling transient failures using backoff and jitter.
Soru 1406Soru

A developer is troubleshooting a serverless application where an AWS Lambda function has a configured timeout of 15 seconds. The function is designed to write a custom JSON log entry to Amazon CloudWatch Logs at the end of its execution, structured as { "requestID": "123-456", "status": "COMPLETED", "executionTimeMs": 1250 }. If a database delay occurs, the function catches it and logs { "requestID": "123-456", "status": "ERROR", "errorType": "DatabaseTimeout" }. To track performance issues and failures, the developer configures a CloudWatch Metric Filter with the pattern { (.status="ERROR")(.status = "ERROR") || (.executionTimeMs > 15000) }. During testing, several invocations time out, but the metric filter does not register any data points. Why is the metric filter failing to capture these timeout events?

Cevabı ve açıklamayı göster

Cevap: When a Lambda function times out, the execution is abruptly terminated by the Lambda runtime, preventing the custom log statement from being written. The metric filter must instead match the platform-generated log string 'Task timed out'.

Cevap

When a Lambda function times out, the execution is abruptly terminated by the Lambda runtime, preventing the custom log statement from being written. The metric filter must instead match the platform-generated log string 'Task timed out'.
The correct answer is correct because AWS Lambda enforces execution timeouts at the platform level. If the function times out, the execution container is terminated immediately, preventing any application-level catch blocks or log statements from executing. As a result, the custom JSON log containing the execution time is never written. The developer must instead match the platform-generated log line which contains the phrase 'Task timed out'.

Adım Adım Çözüm

1
Analyze how AWS Lambda handles timeouts at the runtime level.
When the timeout threshold (15 seconds) is reached, the Lambda service immediately halts container execution.
This prevents any subsequent application-level code (including catch blocks or logging libraries) from running.
2
Determine where the log entries originate when a timeout occurs.
The application's custom JSON logs are not written. Instead, the AWS Lambda service writes a standard platform message containing the string 'Task timed out after 15.00 seconds'.
Since the application did not write the log, the metric filter looking for custom JSON properties like status or executionTimeMs will find nothing.
3
Formulate a metric filter pattern to capture these timeout events.
Create a metric filter that matches the string 'Task timed out' in the log group.
This platform-generated string is guaranteed to be logged by the Lambda service when a timeout occurs.

Anahtar Kavram

CloudWatch Logs filters and Lambda timeout log generation
Soru 1407Soru

A developer is managing an application deployed on a fleet of 10 Amazon EC2 instances using AWS CodeDeploy. The application must maintain a minimum of 8 healthy instances at all times during a deployment to handle peak traffic loads. To minimize the overall deployment duration as much as possible while strictly adhering to this capacity constraint, which CodeDeploy deployment configuration should the developer choose?

Cevabı ve açıklamayı göster

Cevap: A custom deployment configuration with the minimum healthy hosts set to 80%.

Cevap

A custom deployment configuration with the minimum healthy hosts set to 80%.
A custom deployment configuration specifying a minimum of 80% healthy hosts allows CodeDeploy to update 2 instances in parallel. This is the fastest way to deploy the update because it maximizes the number of parallel updates (2 instances) while guaranteeing that the remaining 8 instances (80%) stay online and healthy, satisfying the customer constraint.

Adım Adım Çözüm

1
Identify the minimum capacity requirement from the scenario constraints.
The application runs on 10 EC2 instances and requires at least 8 instances to remain healthy, which equates to 8/10=80%8/10 = 80\% minimum healthy capacity.
This determines the lower bound of healthy resources required during the update process.
2
Calculate the maximum number of instances that can be updated concurrently.
Subtracting the required healthy instances from the total fleet size (108=210 - 8 = 2), we find that a maximum of 2 instances can be offline/updating at any given time.
To minimize deployment duration, we must maximize parallel updates without dropping below the capacity floor.
3
Evaluate the default CodeDeploy deployment configurations against the constraints.
CodeDeployDefault.OneAtATime updates 1 instance at a time (slower). CodeDeployDefault.HalfAtATime updates 5 instances at a time (violates the healthy host constraint). CodeDeployDefault.AllAtOnce updates 10 instances at a time (causes complete downtime).
To verify if any built-in default configurations can optimize the deployment time while maintaining safety.
4
Select the optimal configuration that meets all criteria.
A custom deployment configuration with minimum healthy hosts set to 80% (or 8 hosts) is selected as it allows 2 parallel updates, making it faster than the OneAtATime configuration.
Custom configurations are necessary when default configurations either violate safety constraints or perform suboptimally.

Anahtar Kavram

AWS CodeDeploy deployment configurations and capacity management
Tahmini Süre:1m 30s
Soru 1408Soru

A developer is building a personal finance application. Users must be able to sign up, sign in, and access secured REST API endpoints on Amazon API Gateway. Additionally, users must be able to upload scanned monthly statements directly to a private Amazon S3 bucket. Which architecture meets these requirements with the least operational overhead?

Cevabı ve açıklamayı göster

Cevap: Use an Amazon Cognito User Pool for user registration and authentication, configure an API Gateway Cognito user pool authorizer to secure the API endpoints, and use an Amazon Cognito Identity Pool to grant authenticated users temporary AWS credentials for the Amazon S3 uploads.

Cevap

Use an Amazon Cognito User Pool for user registration and authentication, configure an API Gateway Cognito user pool authorizer to secure the API endpoints, and use an Amazon Cognito Identity Pool to grant authenticated users temporary AWS credentials for the Amazon S3 uploads.
The correct architecture uses a Cognito User Pool to handle user registration and login, an API Gateway Cognito user pool authorizer to secure REST API endpoints with no coding effort, and a Cognito Identity Pool to dynamically exchange user pool tokens for temporary IAM credentials that authorize the client application to upload files directly to S3.

Adım Adım Çözüm

1
Set up user authentication and directory services.
Create an Amazon Cognito User Pool to manage user registration, sign-in, and user attributes.
A User Pool serves as a user directory and issues JSON Web Tokens (JWT) upon successful authentication.
2
Protect the REST API endpoints in API Gateway.
Create a built-in Cognito User Pool authorizer in API Gateway and configure the API methods to require this authorizer.
Using the built-in Cognito authorizer allows API Gateway to natively validate the user's ID or access tokens without requiring custom Lambda code, minimizing operational overhead.
3
Configure secure access to Amazon S3.
Create an Amazon Cognito Identity Pool, specify the User Pool as the authentication provider, and map authenticated users to an IAM role with write permissions to the destination S3 bucket.
Cognito Identity Pools authorize access to AWS resources by exchanging external authentication tokens for scoped, temporary AWS credentials.

Anahtar Kavram

Distinction between Amazon Cognito User Pools (authentication) and Cognito Identity Pools (authorization to access AWS resources), alongside native API Gateway Cognito authorizer integration.
Tahmini Süre:2m 0s
Soru 1409Soru

A developer is deploying a serverless application using AWS SAM. The template contains a custom IAM role and a Lambda function configured as follows:

yaml
Transform: AWS::Serverless-2016-10-31
Resources:
ProcessDataFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs18.x
CodeUri: ./src
Role: !GetAtt CustomExecutionRole.Arn

CustomExecutionRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service:
- apigateway.amazonaws.com
Action:
- sts:AssumeRole
Policies:
- PolicyName: DynamoDBWritePolicy
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- dynamodb:PutItem
Resource: '*'

During deployment, the CloudFormation stack creation fails with an error indicating that the Lambda function could not be created because AWS Lambda was unable to assume the configured role.

Which configuration change will resolve this deployment failure?

Cevabı ve açıklamayı göster

Cevap: Modify the trust policy of CustomExecutionRole to specify lambda.amazonaws.com as the service principal in the Principal block.

Cevap

Modify the trust policy of the custom execution role to specify the Lambda service principal, allowing AWS Lambda to assume the execution role.
The trust policy of an IAM role determines which entities are trusted to assume the role. For a Lambda function execution role, the trust policy must explicitly allow the AWS Lambda service principal (lambda.amazonaws.com) to assume the role. Because the template erroneously trusts API Gateway (apigateway.amazonaws.com) instead, the Lambda service is unauthorized to assume the role during deployment, leading to a creation failure.

Adım Adım Çözüm

1
Identify the resource type and configuration in the AWS SAM template.
The template uses AWS::Serverless::Function and references a custom IAM execution role named CustomExecutionRole.
Understanding the relationship between the Lambda function and its execution role is necessary to trace role assumption issues.
2
Inspect the trust policy document configuration for the custom execution role.
The trust policy principal is set to apigateway.amazonaws.com instead of lambda.amazonaws.com.
The trust policy controls which AWS services are allowed to assume the role. If the wrong service principal is specified, the target service will be blocked from assuming the role.
3
Update the trust policy's principal to trust the Lambda service.
Changing the service principal to lambda.amazonaws.com permits the Lambda service to assume the role during initialization.
This resolves the deployment failure by granting AWS Lambda the required permissions to assume the configured role.

Anahtar Kavram

AWS SAM Lambda execution role configurations require a trust policy allowing lambda.amazonaws.com to assume the role.
Tahmini Süre:1m 30s
Soru 1410Soru

A developer is configuring AWS CodeDeploy to perform in-place deployments of a web application to a fleet of Amazon EC2 instances. The deployment group is configured, but the deployments fail immediately at the start with an error indicating that CodeDeploy does not have permission to access the target instances. The developer needs to ensure that the CodeDeploy service has the necessary permissions to perform the deployment.

Which configuration change will resolve this issue?

Cevabı ve açıklamayı göster

Cevap: Update the trust policy of the CodeDeploy IAM service role to allow the codedeploy.amazonaws.com service principal to assume the role.

Cevap

Updating the trust policy of the CodeDeploy IAM service role to trust the CodeDeploy service principal.
Updating the trust policy of the CodeDeploy IAM service role to allow the codedeploy.amazonaws.com service principal to assume the role is correct. CodeDeploy requires a service role with permissions to access EC2 instances and ECS services on your behalf, and this role must trust the CodeDeploy service principal so that AWS CodeDeploy can assume it using AWS Security Token Service (STS).

Adım Adım Çözüm

1
Identify the service role configured for the CodeDeploy deployment group.
The specific IAM role used by CodeDeploy is identified.
Deployments require a service role with appropriate permissions to execute actions.
2
Verify the trust relationship of the identified IAM service role in the IAM console.
The trust policy is found to be missing or misconfigured for the CodeDeploy service principal.
To assume a service role, AWS CodeDeploy must be allowed in the trust policy.
3
Modify the trust policy of the IAM service role to allow the codedeploy.amazonaws.com service principal to perform the sts:AssumeRole action.
The role's trust policy is successfully updated, allowing CodeDeploy to assume it.
This resolves the authorization failure and allows CodeDeploy to manage the deployment.

Anahtar Kavram

IAM service roles and trust policies for AWS CodeDeploy
Tahmini Süre:2m 0s
Soru 1411Soru

A developer is building a serverless web application for a fitness tracking portal. The application must allow users to log in using their existing Google or Facebook accounts. Once authenticated, the application must allow users to retrieve their profile data from an Amazon API Gateway REST API and upload workout videos directly to a private Amazon S3 bucket. Which TWO configuration steps should the developer perform to implement this authentication and authorization workflow with the least operational overhead?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Configure a Cognito User Pool with Google and Facebook social identity providers, and configure a Cognito Authorizer on the API Gateway REST API.; Configure a Cognito Identity Pool, set the Cognito User Pool as an authentication provider, and assign an authenticated IAM role with write permissions for the S3 bucket.

Cevap

Configure a Cognito User Pool with Google and Facebook social identity providers, configure a Cognito Authorizer on the API Gateway REST API, configure a Cognito Identity Pool using the User Pool as an authentication provider, and assign an authenticated IAM role with write permissions for the S3 bucket.
To implement authentication with Google and Facebook and access both API Gateway and S3 with the least operational overhead, the developer should combine a Cognito User Pool with a Cognito Identity Pool. The Cognito User Pool authenticates the federated social users and provides tokens. These tokens are natively validated by the API Gateway Cognito Authorizer to secure REST API endpoints without custom code. To allow direct upload to a private S3 bucket, the application must exchange the User Pool tokens for temporary AWS credentials using a Cognito Identity Pool, which maps the authenticated session to an IAM role with S3 write permissions.

Adım Adım Çözüm

1
Set up User Directory and Social Federation
Configure an Amazon Cognito User Pool with Google and Facebook as identity providers to handle user registration, login, and identity token issuance.
A User Pool acts as the user directory and manages federation, allowing the application to authenticate users and receive JSON Web Tokens (JWTs) representing their identity.
2
Authorize API Access
Configure a Cognito Authorizer on the Amazon API Gateway REST API endpoints.
The Cognito Authorizer natively validates the identity tokens (JWTs) passed in the authorization header of incoming API requests, securing the backend with zero custom code.
3
Enable S3 Write Permissions
Create an Amazon Cognito Identity Pool, configure the User Pool as the authentication provider, and associate the authenticated IAM role with S3 write permissions.
An Identity Pool (Federated Identities) is required to exchange the authenticated User Pool token for temporary, short-lived AWS credentials, enabling the client application to directly upload video files to S3 without using a proxy backend.

Anahtar Kavram

Amazon Cognito Authentication and Authorization
Soru 1412Soru

A developer is configuring an AWS Lambda function in Account A (111111111111111111111111) that needs to write items to an Amazon DynamoDB table in Account B (222222222222222222222222). The developer wants to use cross-account IAM roles to implement secure access following the principle of least privilege. An IAM role named `CrossAccountDynamoDBWriter` has been created in Account B with the necessary permission policy to write to the DynamoDB table.

Which two configuration steps must the developer perform to enable the Lambda function to access the DynamoDB table?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: In Account B, configure the trust policy of the `CrossAccountDynamoDBWriter` role to allow the Lambda function's execution role in Account A to assume the role.; In Account A, attach an identity-based policy to the Lambda function's execution role that grants the `sts:AssumeRole` permission on the ARN of the `CrossAccountDynamoDBWriter` role in Account B.

Cevap

In Account B, configure the trust policy of the role to allow the Lambda function's execution role in Account A to assume the role, and in Account A, attach an identity-based policy to the Lambda function's execution role that grants the `sts:AssumeRole` permission on the ARN of the role in Account B.
For cross-account access, a two-way permission handshake is required. The role in the trusting account (Account B) must have a trust policy allowing the trusted identity (Account A's Lambda execution role) to assume it. Concurrently, the trusted identity in Account A must have an identity-based policy allowing it to call `sts:AssumeRole` on the target role in Account B.

Adım Adım Çözüm

1
Configure the trust relationship on the target role in Account B.
The `CrossAccountDynamoDBWriter` role in Account B trusts the Lambda function's execution role in Account A.
A role must explicitly declare which identities are trusted to assume it via its trust policy.
2
Grant permission to the Lambda execution role in Account A to perform the assume role action.
The Lambda execution role in Account A is authorized to perform `sts:AssumeRole` on the target role's ARN.
An IAM identity must be explicitly granted permission to perform the `sts:AssumeRole` API call on a target resource.

Anahtar Kavram

Cross-account IAM role access requires configuring both a trust policy on the resource role and an identity-based permission policy on the calling principal.
Tahmini Süre:2m 0s
Soru 1413Soru

A fleet management system stores real-time diagnostics for 50,00050,000 delivery vehicles in an Amazon DynamoDB table. To minimize read latency and prevent database load, a developer deploys a DynamoDB Accelerator (DAX) cluster. The developer implements a background process that runs periodic Scan operations via the DAX client to pre-warm the cache. However, when the dashboard application performs GetItem calls to retrieve individual vehicle details, it continues to experience high read latency and triggers ProvisionedThroughputExceededException errors on the DynamoDB table. Which action should the developer take to resolve the performance bottleneck and utilize the DAX cache effectively?

Cevabı ve açıklamayı göster

Cevap: Modify the background process to perform individual GetItem or BatchGetItem calls for the vehicle records instead of Scan operations, allowing DAX to populate its item cache.

Cevap

Modify the background process to perform individual GetItem or BatchGetItem calls for the vehicle records instead of Scan operations, allowing DAX to populate its item cache.
The correct answer is to modify the background process to perform individual GetItem or BatchGetItem calls. Amazon DynamoDB Accelerator (DAX) utilizes two separate caches: the item cache and the query cache. GetItem and BatchGetItem operations check and populate the item cache. Scan and Query operations check and populate the query cache. Because the background process was using Scan, it only populated the query cache. Subsequent GetItem requests from the dashboard resulted in item cache misses and went directly to DynamoDB, causing latency and throttling. Warming the item cache using GetItem or BatchGetItem resolves this issue.

Adım Adım Çözüm

1
Analyze how DAX handles cache population for different API calls.
DAX maintains an item cache (populated by GetItem, BatchGetItem, etc.) and a query cache (populated by Query and Scan).
Understanding the difference between DAX's item cache and query cache is necessary to diagnose why GetItem calls are bypassing the cache.
2
Identify the cause of the cache misses and read throttling.
The background process uses Scan, which only populates the query cache. Subsequent GetItem calls search the item cache, result in cache misses, and hit the DynamoDB table directly.
This explains why the table is receiving ProvisionedThroughputExceededException errors despite the DAX cluster.
3
Apply the appropriate caching strategy to resolve the bottleneck.
Changing the background warming process to use GetItem or BatchGetItem calls ensures that the individual vehicle items are cached in the DAX item cache.
This allows subsequent GetItem calls from the dashboard to be served directly from the DAX item cache, eliminating database load and reducing latency.

Anahtar Kavram

DAX Caching Behavior (Item Cache vs. Query Cache)
Soru 1414Soru

A development team is setting up a continuous delivery pipeline using AWS CodeDeploy for a microservice hosted on Amazon Elastic Container Service (Amazon ECS). The team wants to ensure that a validation test suite is executed immediately after the new container tasks are registered and test traffic is routed to them, but before any production traffic is shifted. Additionally, they want to execute a notification task once the production traffic has been completely transitioned.

Which actions must the developer take to achieve this deployment workflow? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Define the AfterAllowTestTraffic hook in the appspec.yaml file to invoke a Lambda function that executes the validation tests.; Define the AfterAllowTraffic hook in the appspec.yaml file to invoke a Lambda function that executes the notification task.

Cevap

To configure this ECS deployment workflow, the developer must define the AfterAllowTestTraffic hook in the appspec.yaml file to execute the validation tests, and define the AfterAllowTraffic hook to run the post-traffic routing notification task.
For an Amazon ECS deployment, CodeDeploy uses a specific set of hooks. The 'AfterAllowTestTraffic' hook runs after the replacement tasks are created and test traffic is routed to them, making it the ideal stage for running integration/validation tests. The 'AfterAllowTraffic' hook runs after all production traffic is shifted to the new task set, which is the correct moment to trigger a notification task confirming completion.

Adım Adım Çözüm

1
Identify the target compute platform and its specific lifecycle hooks.
The platform is Amazon ECS. ECS-specific hooks must be used rather than EC2-specific ones.
AWS CodeDeploy uses distinct lifecycle hooks depending on the target compute platform.
2
Determine the correct lifecycle hook for the validation tests.
Validation tests must run after test traffic is active but before production traffic starts shifting, which matches the AfterAllowTestTraffic hook.
This hook fires as soon as the test port is serving traffic to the new task set.
3
Determine the correct lifecycle hook for post-deployment notification.
The notification must run after the shift of production traffic is completed, which corresponds to the AfterAllowTraffic hook.
This hook fires immediately after the production traffic routing is successfully fully swapped.

Anahtar Kavram

AWS CodeDeploy Lifecycle Hooks for ECS

Alternatif Yöntem

Instead of executing tests strictly in AfterAllowTestTraffic, you can also use AfterInstall to perform tests if you do not have a separate test port configured, though AfterAllowTestTraffic is the standard best practice when test traffic routing is configured.
Tahmini Süre:1m 30s
Soru 1415Soru

A document collaboration platform named DocuCollab tracks real-time document editing events and writes them to an Amazon DynamoDB table. The table is configured with provisioned write capacity and uses the DocumentId as the partition key. During peak hours, a small number of extremely popular shared documents experience heavy, concurrent editing activity. This results in ProvisionedThroughputExceededException errors and writes are dropped, even though the total consumed write capacity is well below the table's provisioned limit.

Which combination of actions will resolve this issue? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Append a random numeric suffix to the partition key value before writing the items to distribute the write load.; Configure the application SDK client to implement exponential backoff with jitter for retrying failed requests.

Cevap

To resolve the throttling issues, the developer should append a random numeric suffix to the partition key value before writing the items, and configure the application SDK client to implement exponential backoff with jitter for retrying failed requests.
The correct actions are appending a random numeric suffix to the partition key (sharding) and configuring the SDK to use exponential backoff with jitter. Appending a random suffix distributes the concurrent writes for a single popular document across multiple physical partitions, which prevents exceeding the 1,000 WCU physical partition limit. Implementing exponential backoff with jitter ensures that when throttling does occur, the application retries the requests at progressively longer, randomized intervals, preventing retry storms and allowing the writes to succeed without being dropped.

Adım Adım Çözüm

1
Analyze the DynamoDB ProvisionedThroughputExceededException and partition key design to identify if the workload is unevenly distributed.
Discovered that a few popular documents (hot partition keys) are exceeding the single physical partition throughput limit of 1,000 WCUs, even though the total table WCU consumption is low.
This step is necessary to pinpoint that the problem is a hot partition issue rather than a table-wide capacity limitation.
2
Redesign the partition key strategy by appending a random numeric suffix (e.g., a hash or random number from 1 to N) to the DocumentId before writing.
Writes for a single popular document are distributed across N different partition keys, spreading the throughput load across multiple physical partitions.
This step is required to scale the throughput of a single logical key beyond the 1,000 WCU physical partition limit.
3
Configure the application SDK client to implement exponential backoff with randomized jitter for request retries.
Throttled requests are retried with spacing in time, preventing collision patterns (retry storms) and allowing temporary spikes to resolve successfully.
This step is necessary to ensure that the application handles transient throttling gracefully without immediately dropping write requests.

Anahtar Kavram

Resolving DynamoDB throttling issues by redesigning partition keys (sharding) and configuring SDK retry policies with backoff and jitter.
Tahmini Süre:2m 0s
Soru 1416Soru

A developer has a production API hosted on Amazon API Gateway and wants to introduce a new API version. To minimize risk, the developer needs to route 5%5\% of the API traffic to the new version using the same endpoint, while the remaining 95%95\% continues to go to the current version. The developer wants to monitor the performance of the new version and must be able to immediately roll back all traffic to the current version if any anomalies are detected. Which deployment approach should the developer use to meet these requirements?

Cevabı ve açıklamayı göster

Cevap: Enable canary settings on the existing API Gateway stage, set the canary traffic percentage to 5%5\%, and delete the canary deployment if any anomalies are detected.

Cevap

Enable canary settings on the existing API Gateway stage, set the canary traffic percentage to 5%5\%, and delete the canary deployment if any anomalies are detected.
Enabling canary settings on an existing API Gateway stage allows a developer to route a small percentage of traffic (such as 5%5\%) to a new deployment using the same endpoint. If anomalies occur, deleting the canary deployment immediately routes all traffic back to the stable production version, satisfying the rollback requirement.

Adım Adım Çözüm

1
Identify the requirement for percentage-based traffic routing on a single API endpoint.
The solution must support shifting 5%5\% of traffic to the new version and 95%95\% to the current version under the same stage endpoint.
Clients must access the API using the existing configuration without needing distinct URLs.
2
Evaluate the native deployment capabilities of Amazon API Gateway.
API Gateway offers stage-level canary settings, allowing traffic to be split between a production deployment and a canary deployment on the same stage.
This avoids external routing layers and provides native support for canary testing.
3
Determine the optimal rollback mechanism.
If anomalies occur, deleting the canary settings or deployment on the stage immediately redirects all traffic back to the primary production deployment.
This ensures the rollback is instantaneous, meeting the requirement without suffering from DNS propagation delays.

Anahtar Kavram

API Gateway Canary Deployments
Tahmini Süre:1m 15s
Soru 1417Soru

An enterprise web application needs to allow employees to sign in using their corporate Identity Provider (IdP) via SAML 2.0. Once authenticated, the application must allow users to upload files directly to a user-specific folder in an Amazon S3 bucket. The architecture must minimize operational overhead and avoid storing long-term credentials on the client. Which solution meets these requirements with the least operational overhead?

Cevabı ve açıklamayı göster

Cevap: Configure an Amazon Cognito User Pool integrated with the SAML IdP, and associate it with an Amazon Cognito Identity Pool. Use the Identity Pool to map the federated users to an IAM role that grants access to the user-specific S3 folder using the cognito-identity.amazonaws.com:sub variable.

Cevap

Configure an Amazon Cognito User Pool integrated with the SAML IdP, and associate it with an Amazon Cognito Identity Pool. Use the Identity Pool to map the federated users to an IAM role that grants access to the user-specific S3 folder using the cognito-identity.amazonaws.com:sub variable.
The correct solution leverages Amazon Cognito User Pools to manage authentication with the corporate SAML Identity Provider, and Amazon Cognito Identity Pools to exchange the authentication tokens for temporary AWS IAM credentials. The IAM policy attached to the authenticated role uses the cognito-identity.amazonaws.com:sub policy variable to dynamically restrict access to the user's specific folder in the S3 bucket, ensuring security with minimal operational overhead.

Adım Adım Çözüm

1
Configure SAML federation with the corporate Identity Provider within an Amazon Cognito User Pool.
Users can authenticate against their corporate IdP and receive Cognito User Pool tokens.
This establishes user authentication without managing passwords locally or creating custom SAML validation logic.
2
Link the Cognito User Pool as an authentication provider in an Amazon Cognito Identity Pool.
The Identity Pool can verify the Cognito User Pool tokens and exchange them for temporary AWS credentials.
Cognito Identity Pools are designed to authorize users and provide temporary AWS IAM credentials.
3
Create an IAM role for authenticated users with a policy permitting S3 PutObject actions restricted to user-specific prefixes using the cognito-identity.amazonaws.com:sub variable, and associate it with the Identity Pool.
Authenticated users receive dynamic, scope-limited temporary credentials to upload directly to their own S3 folder.
This implements secure, direct client-to-S3 uploads with minimal latency, avoiding the need for an intermediary backend server or hardcoded credentials.

Anahtar Kavram

Amazon Cognito Identity Pools are used to federate identities and obtain temporary AWS credentials for accessing AWS resources like Amazon S3, whereas Cognito User Pools handle user directory management and authentication.
Tahmini Süre:2m 0s
Soru 1418Soru

An e-commerce checkout application named CartCheckout records transaction logs in Amazon DynamoDB. The table uses CheckoutDate (formatted as YYYY-MM-DD) as the partition key and TransactionID as the sort key. During a flash sale event, the application experiences multiple ProvisionedThroughputExceededException errors when writing to the table, even though the total consumed Write Capacity Units (WCUs) are well below the table's total provisioned limits. Which action should the developer take to resolve the write throttling and optimize the table's write performance?

Cevabı ve açıklamayı göster

Cevap: Redesign the partition key schema to use the high-entropy TransactionID as the partition key, or append a random suffix to the CheckoutDate, to distribute writes evenly across partitions.

Cevap

Redesign the partition key schema to use the high-entropy TransactionID as the partition key, or append a random suffix to the CheckoutDate, to distribute writes evenly across partitions.
The correct answer is correct because replacing the partition key with a high-entropy key (like TransactionID) or adding a random suffix to the date distributes the data and request load evenly across all available physical partitions. This avoids hot partition bottlenecks where a single partition key receives all writes.

Adım Adım Çözüm

1
Analyze the error message and table configuration to determine the root cause of throttling.
The ProvisionedThroughputExceededException combined with low overall table throughput indicates a hot partition issue due to poor partition key distribution.
Since the partition key is CheckoutDate (YYYY-MM-DD), all transaction writes on the day of the flash sale target the same partition, exceeding the throughput limit of a single physical partition.
2
Evaluate remediation strategies to distribute the write load more evenly across partitions.
A high-entropy attribute like TransactionID should be selected as the partition key, or write sharding (appending a random suffix) should be implemented on the CheckoutDate.
This spreads writes across multiple partition keys and therefore multiple physical partitions, utilizing the table's provisioned capacity effectively.

Anahtar Kavram

Identifying and resolving hot partitions in Amazon DynamoDB by designing high-entropy partition keys or implementing write sharding.
Soru 1419Soru

A smart home telemetry application stores real-time ambient device statuses in an Amazon DynamoDB table. Users retrieve the status of specific devices through a mobile app dashboard, which performs frequent key-value read requests by device ID. During peak usage hours, users experience high read latency, and the dashboard receives ProvisionedThroughputExceededException errors. CloudWatch metrics indicate that the table's total read capacity is not exceeded, but a small subset of highly active device IDs is causing hot partitions. The developer wants to deploy Amazon DynamoDB Accelerator (DAX) to resolve the latency and throttling issues. Which two actions must the developer take to achieve this objective?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Deploy a DAX cluster and replace the standard DynamoDB client with the DAX client SDK in the application code.; Configure the read requests from the mobile application to use eventually consistent reads.

Cevap

To resolve the throttling and latency issues using DAX, the developer must deploy the DAX cluster, use the DAX client SDK to point the application to the cache, and ensure read requests use eventually consistent reads so they can be cached.
To leverage DAX for sub-millisecond read latency and prevent hot partition throttling, the application must use the DAX client SDK to route reads through the cache. Additionally, the read operations must be configured as eventually consistent, because DAX does not cache strongly consistent reads in its Item Cache.

Adım Adım Çözüm

1
Replace the standard DynamoDB client SDK with the DAX client SDK.
The application routes its API calls to the DAX cluster instead of directly to DynamoDB.
DAX requires a specialized client SDK that is API-compatible with DynamoDB to intercept and cache the requests.
2
Configure read requests to use eventually consistent reads.
DAX intercepts the GetItem and Query calls and saves the result in the Item Cache.
Strongly consistent reads bypass the DAX cache and hit the database directly, which would not resolve the hot partition throttling.

Anahtar Kavram

Integrating DAX requires utilizing the DAX client SDK and configuring reads to be eventually consistent to leverage the DAX Item Cache.
Soru 1420Soru

A developer is preparing to deploy updates to an AWS Lambda function using AWS CodeDeploy. The deployment must use a canary strategy (Canary10Percent5Minutes). The developer wants to execute a validation Lambda function to perform integration tests on the new version of the function before any production traffic is shifted to it. The deployment must also use a service role that grants CodeDeploy the necessary permissions to perform the deployment.

Which two actions should the developer take to configure this deployment? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Define the validation Lambda function under the BeforeAllowTraffic hook in the hooks section of the AppSpec file.; Attach a trust policy to the CodeDeploy service role that allows the codedeploy.amazonaws.com service principal to assume the role.

Cevap

Define the validation Lambda function under the BeforeAllowTraffic hook in the hooks section of the AppSpec file, and attach a trust policy to the CodeDeploy service role that allows the codedeploy.amazonaws.com service principal to assume the role.
The correct options are to define the validation function in the BeforeAllowTraffic hook and configure the CodeDeploy service role trust policy. The BeforeAllowTraffic hook runs before any traffic is shifted to the new version, which allows the developer to run verification tests. The CodeDeploy service role must have a trust policy that allows codedeploy.amazonaws.com to assume the role in order to perform deployment tasks.

Adım Adım Çözüm

1
Determine the correct CodeDeploy lifecycle hook for validating an AWS Lambda function before traffic starts routing to the new version.
Identify the BeforeAllowTraffic lifecycle hook as the appropriate hook.
AWS Lambda deployments support only BeforeAllowTraffic and AfterAllowTraffic hooks. BeforeAllowTraffic executes prior to any traffic shifting, which meets the requirement of verifying the function before production traffic is routed.
2
Establish the correct trust policy for the IAM service role used by CodeDeploy.
Ensure the trust policy allows the codedeploy.amazonaws.com service principal to assume the role.
AWS CodeDeploy requires permissions to interact with AWS Lambda and other services during deployment. This requires a dedicated CodeDeploy service role that explicitly trusts the CodeDeploy service principal.

Anahtar Kavram

Configuring AWS CodeDeploy for Lambda deployments using AppSpec lifecycle hooks and establishing the correct trust policy for the service role.
ÖncekiSayfa 71 / 78Sonraki