我想创建一个拥有AdministratorAccess
和管理所有内容的用户,例如拒绝 IAM 中的删除和更新操作
我试着这样做
- 创建管理员用户
- 在 IAM 中创建拒绝删除和更新操作的策略
- 将该策略附加到用户
- 用户现在拥有(AdministratorAccess + MyPolicy)
但
- 用户仍然可以在 IAM 中删除和更新用户
- 我认为这是因为
AdministratorAccess
有没有办法做到这一点,而无需尝试创建复杂的多个策略?
更新
这是我创建的政策
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "StmtXXXX",
"Effect": "Deny",
"Action": [
"iam:ChangePassword",
"iam:DeactivateMFADevice",
"iam:DeleteAccessKey",
"iam:DeleteAccountAlias",
"iam:DeleteAccountPasswordPolicy",
"iam:DeleteGroup",
"iam:DeleteGroupPolicy",
"iam:DeleteInstanceProfile",
"iam:DeleteLoginProfile",
"iam:DeleteOpenIDConnectProvider",
"iam:DeletePolicy",
"iam:DeletePolicyVersion",
"iam:DeleteRole",
"iam:DeleteRolePolicy",
"iam:DeleteSAMLProvider",
"iam:DeleteSSHPublicKey",
"iam:DeleteServerCertificate",
"iam:DeleteSigningCertificate",
"iam:DeleteUser",
"iam:DeleteUserPolicy",
"iam:DeleteVirtualMFADevice",
"iam:RemoveClientIDFromOpenIDConnectProvider",
"iam:RemoveRoleFromInstanceProfile",
"iam:RemoveUserFromGroup",
"iam:UpdateAccessKey",
"iam:UpdateLoginProfile",
"iam:UpdateSSHPublicKey"
],
"Resource": [
"arn:aws:iam::1234:user/dummyadmin"
]
}
]
}
更新 2
将资源设置为 后arn:aws:iam::1234
,它起作用了!