An application container runs on Amazon Elastic Container Service (Amazon ECS) in AWS Account B (). The application must send messages to an encrypted Amazon Simple Queue Service (Amazon SQS) queue in AWS Account A (). The SQS queue is encrypted using an AWS KMS customer managed key (CMK) also located in Account A. The queue policy in Account A is configured to allow the ECS task role from Account B to perform `sqs:SendMessage` actions.
To enable the encryption flow, an administrator attached an IAM policy to the ECS task execution role in Account B, permitting `kms:GenerateDataKey` and `kms:Decrypt` on the KMS key ARN in Account A. However, the ECS task container logs show `KMS.AccessDeniedException` errors when the application attempts to publish messages.
Which combination of actions will resolve this issue? (Select TWO.)
- In Account A, update the KMS key policy to grant the Account B root principal (`arn:aws:iam::444455556666:root`) permissions to perform `kms:GenerateDataKey` and `kms:Decrypt` actions.Cevap
- In Account B, attach the IAM policy containing the KMS permissions to the ECS task role instead of the ECS task execution role.Cevap
- CIn Account A, modify the SQS queue policy to grant the SQS service principal (`sqs.amazonaws.com`) permissions to perform `kms:GenerateDataKey` and `kms:Decrypt` actions on the KMS key.
- DIn Account B, update the ECS task definition to enable container credential propagation from the host EC2 instance profile.
- EIn Account B, use the AWS CLI to create an AWS KMS grant that delegates `kms:GenerateDataKey` permissions from Account A's KMS key to the SQS queue.