A developer is implementing a transaction processing service for a financial ledger application. The application tracks transactions in an Amazon DynamoDB table with the following schema:
- Partition Key: `` (string)
- Sort Key: `` (string)
- Attributes: `` (number), `` (number), `` (string)
The application currently retrieves all transactions for a given `` that are in a 'PENDING' status. During peak traffic, the application experiences high latency and receives `ProvisionedThroughputExceededException` errors, even though the total Read Capacity Units (RCUs) provisioned are sufficient for the workload. Furthermore, during a security audit, it was discovered that the ECS tasks running this microservice are configured with hardcoded AWS credentials in the container environment variables.
Which two actions should the developer take to resolve the latency, throughput, and security issues?
- Create a Local Secondary Index (LSI) with `` as the sort key, and execute a `Query` operation specifying the `` and the `` key condition.Cevap
- BUse a `Scan` operation with a `FilterExpression` on the base table to retrieve items matching the `` and a `` of 'PENDING'.
- Associate an IAM policy granting DynamoDB access to the ECS Task Role by specifying the `taskRoleArn` in the task definition, and configure the SDK client to retrieve credentials automatically.Cevap
- DHardcode the AWS access key and secret key in the application's SDK client initialization code to bypass role resolution latency.
- EAttach the DynamoDB access policy to the ECS Task Execution Role using the `executionRoleArn` property to grant the running container permission to perform data plane operations.