A developer is building an AWS Lambda function that retrieves customer order history from an Amazon DynamoDB table. The orders are retrieved based on a specific `CustomerID` and filtered by order status. To connect to the database, the developer has hardcoded the access keys of an IAM user directly inside the Lambda function's code. During load testing, the application experiences high latency and receives `ProvisionedThroughputExceededException` errors when retrieving orders, even though the total read capacity units (RCU) of the table are not fully utilized. The logs indicate that the application is performing a sequential `Scan` operation to find the customer's records. Which two actions should the developer take to resolve these security and performance issues? (Select TWO.)
- Perform a `Query` operation instead of a `Scan` operation, specifying the `CustomerID` as the partition key in the key condition expression.Cevap
- Remove the hardcoded IAM user access keys from the function code, assign an IAM execution role with the required DynamoDB permissions to the Lambda function, and rely on the default SDK credential provider chain to assume the role.Cevap
- CApply a filter expression on `CustomerID` while keeping the `Scan` operation to reduce the number of Read Capacity Units (RCUs) consumed by the database.
- DStore the IAM user access keys in an Amazon S3 bucket, and configure the Lambda function to download and load them into the environment variables at startup.
- EEnable strongly consistent reads on the `Scan` operation to improve retrieval performance and decrease the overall RCU consumption.