如何通过CLI停用AWS中的区域

时间:2019-06-25 18:21:29

标签: amazon-web-services

我正在尝试通过CLI停用帐户区域吗?

我可以通过AWS控制台IAM->帐户设置->区域->停用

1 个答案:

答案 0 :(得分:1)

根据AWS: Allows Enabling and Disabling AWS Regions - AWS Identity and Access Management,与启用帐户相关的IAM权限以account:为前缀:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "EnableDisableHongKong",
            "Effect": "Allow",
            "Action": [
                "account:EnableRegion",
                "account:DisableRegion"
            ],
            "Resource": "",
            "Condition": {
                "StringEquals": {"account:TargetRegion": "ap-east-1"}
            }
        },
        {
            "Sid": "ViewConsole",
            "Effect": "Allow",
            "Action": [
                "aws-portal:ViewAccount",
                "account:ListRegions"
            ],
            "Resource": ""
        }
    ]
}

找不到account类别的任何AWS CLI命令。 (我在boto3中也没有看到任何东西。)

did 设法在Actions, Resources, and Condition Keys for AWS Accounts - AWS Identity and Access Management上找到这些动作的参考。因此,在各种SDK和AWS CLI中出现它可能只是一个时间问题。

此答案写于2019年6月,所以事后可能会发生变化。