RDS 代理 IAM 角色无法从机密中检索凭据

RDS Proxy IAM role unable to retrieve credentials from secret

我正在尝试为我们的 Aurora RDS 实例实施代理,但很难让 IAM 访问正常工作。我们在试图访问数据库的 ECS 容器中有一个微服务。到目前为止我遵循的步骤:

向微服务发出 GET 请求时,我在 CloudWatch 日志中看到以下内容:

Credentials couldn't be retrieved. The IAM role "arn:our-proxy-role" is not authorized to read the AWS Secrets Manager secret with the ARN "arn:our-db-credential-secret"

所有这一切的另一个有趣问题:我调出 policy simulator,选择 RDS 代理角色和 Secrets Manager 服务下的所有操作,所有操作都显示为允许。

我真诚地感谢任何指导,以指出我在这里缺少什么。

arn:our-proxy-role

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "rds-db:connect"
            ],
            "Resource": [
                "arn:aws:rds:us-east-1:ACCOUNT:dbuser:*/*"
            ]
        },
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "secretsmanager:GetRandomPassword",
                "secretsmanager:CreateSecret",
                "secretsmanager:ListSecrets"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": "secretsmanager:*",
            "Resource": [
                "arn:aws:our-db-credential-secret"
            ]
        },
        {
            "Sid": "GetSecretValue",
            "Action": [
                "secretsmanager:GetSecretValue"
            ],
            "Effect": "Allow",
            "Resource": [
                "arn:aws:our-db-credential-secret"
            ]
        },
        {
            "Sid": "DecryptSecretValue",
            "Action": [
                "kms:Decrypt"
            ],
            "Effect": "Allow",
            "Resource": [
                "arn:aws:kms:us-east-1:ACCOUNT:key/our-db-cluster"
            ],
            "Condition": {
                "StringEquals": {
                    "kms:ViaService": "secretsmanager.us-east-1.amazonaws.com"
                }
            }
        }
    ]
}

该问题与安全组有关。我需要指定一个额外的入站规则以允许来自其自身的传入流量,以促进属于同一安全组的资源之间的通信。