Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅
中国的 Amazon Web Services 服务入门
(PDF)。
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
保护会员账户不被关闭 Amazon Organizations
为了保护成员账户免遭意外关闭,请创建一个 IAM 策略来指定哪些账户可以免税。此政策可防止关闭受保护的成员账户。
使用以下方法之一创建 IAM 策略以拒绝账户关闭:
服务控制策略 (SCPs) 无法保护成员账户,因为 SCPs 不影响管理账户中的 IAM 委托人。
防止成员账户关闭的 IAM policy 示例
以下代码示例展示了两种可用来限制成员账户注销账户的不同功能方法。
- Prevent member accounts with
tags from getting closed
-
您可以将以下策略附加到管理账户中的身份。此策略防止管理账户中的主体关闭任何标记为 aws:ResourceTag
标记全局条件键、AccountType
键和 Critical
标签值的成员账户。
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PreventCloseAccountForTaggedAccts",
"Effect": "Deny",
"Action": "organizations:CloseAccount",
"Resource": "*",
"Condition": {
"StringEquals": {"aws:ResourceTag/AccountType": "Critical"}
}
}
]
}
- Prevent member
accounts listed in this policy from getting closed
-
您可以将以下策略附加到管理账户中的身份。此策略可防止管理账户中的主体关闭 Resource
元素中明确指定的成员账户。
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PreventCloseAccount",
"Effect": "Deny",
"Action": "organizations:CloseAccount",
"Resource": [
"arn:aws:organizations::555555555555:account/o-12345abcdef/123456789012",
"arn:aws:organizations::555555555555:account/o-12345abcdef/123456789014"
]
}
]
}