A company enforces a strict security policy that prohibits all internet egress from its production Amazon VPC. A SysOps administrator is configuring automatic credential rotation for an Amazon RDS for PostgreSQL DB instance. The database credentials are stored in AWS Secrets Manager, and the secret is encrypted using the default AWS managed key `aws/secretsmanager`.
The administrator deploys the rotation AWS Lambda function into the same private subnets as the RDS DB instance. However, during testing, the rotation fails. CloudWatch Logs for the rotation Lambda function show that the function times out while attempting to establish a connection to the Secrets Manager service endpoint to retrieve the current version of the secret.
Which action must the administrator take to resolve this network connectivity issue and allow the rotation to complete successfully?
- ACreate a gateway VPC endpoint for AWS Secrets Manager within the VPC, and associate the gateway endpoint with the route tables of the private subnets.
- BAttach an IAM policy containing `iam:PassRole` permissions to the rotation Lambda function's execution role to authorize the Secrets Manager service to invoke the function.
- Create an interface VPC endpoint for AWS Secrets Manager within the VPC. Configure the security group of the interface VPC endpoint to allow inbound HTTPS traffic from the security group of the rotation Lambda function, and ensure that private DNS is enabled.Answer
- DModify the key policy of the default AWS managed key `aws/secretsmanager` to explicitly grant the rotation Lambda execution role the `kms:Decrypt` and `kms:GenerateDataKey` permissions.