当我使用 AWS Backup 执行 Amazon Elastic File System (Amazon EFS) 恢复时,出现错误。错误是“Insufficient privileges to perform this action”或“access denied.”
解决方法
确认您的 IAM 身份具有所需的权限
查看创建恢复作业的 AWS Identity and Access Management (IAM) 角色的策略,以确认其包含 backup:StartRestoreJob 操作。
如果您开启了加密,请确保您的 IAM 策略或 AWS Key Management Service (AWS KMS) 密钥策略包含以下操作:
- “kms:DescribeKey”
- “kms:GenerateDataKeyWithoutPlaintext”
- “kms:CreateGrant”
确认您包含了所需的 Amazon EFS 操作
附加到恢复请求中的 IAM 角色的 IAM 策略必须包含以下 Amazon EFS 操作:
- “elasticfilesystem:Restore”
- “elasticfilesystem:CreateFilesystem”
- “elasticfilesystem:DescribeFilesystems”
- “elasticfilesystem:DeleteFilesystem”
移除 Deny 语句
移除保管库访问策略中的 backup:StartRestoreJob 操作的 Deny 语句。例如,默认 Amazon EFS aws/efs/automatic-backup-vault 保管库的以下访问策略会拒绝 backup:StartRestoreJob 操作:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Deny",
"Principal": {
"AWS": "*"
},
"Action": [
"backup:DeleteBackupVault",
"backup:DeleteBackupVaultAccessPolicy",
"backup:DeleteRecoveryPoint",
"backup:StartCopyJob",
"backup:StartRestoreJob",
"backup:UpdateRecoveryPointLifecycle"
],
"Resource": "*"
}]
}
此外,从您的 IAM 策略和 AWS Organizations 服务控制策略 (SCP) 中移除拒绝执行以下服务所需操作的 Deny 语句:
- AWS Backup
- Amazon EFS
- AWS KMS