An organization implements a multi-account structure where database credentials are centralized in a security account (Account B) using AWS Secrets Manager. A microservice running on an Amazon EC2 instance in a production account (Account A) requires access to one of these secrets. The secret is encrypted using the default AWS managed key `aws/secretsmanager`. The SysOps administrator configures a resource-based policy on the secret in Account B to allow the EC2 instance's IAM role in Account A to call `secretsmanager:GetSecretValue`. The IAM role in Account A has also been granted permissions to call `secretsmanager:GetSecretValue` on the secret's ARN. However, the EC2 instance receives an `AccessDeniedException` when attempting to retrieve the credential.
Which configuration adjustment will resolve this access issue?
- AModify the key policy of the default AWS managed key `aws/secretsmanager` in Account B to grant `kms:Decrypt` permissions to the IAM role in Account A.
- BAdd `iam:PassRole` permissions to the EC2 instance's IAM role in Account A, and configure the EC2 instance to assume the default Secrets Manager service-linked role in Account B.
- Re-encrypt the secret in Account B using a customer managed KMS key, grant the IAM role in Account A permission to perform `kms:Decrypt` in its IAM policy, and update the customer managed KMS key policy in Account B to allow `kms:Decrypt` for the IAM role in Account A.Cevap
- DConfigure a gateway VPC endpoint for Secrets Manager in Account A, and associate the endpoint with the route tables of the subnets where the EC2 instances are running.