【问题标题】:How to deactivate region in AWS through the CLI如何通过 CLI 停用 AWS 中的区域
【发布时间】:2019-06-26 07:26:24
【问题描述】:

我正在尝试通过 CLI 停用帐户区域,是否可以通过 CLI 进行操作?

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

【问题讨论】:

    标签: amazon-web-services


    【解决方案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 中也没有看到任何东西。)

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

    这个答案是在 2019 年 6 月写的,所以以后可能会发生变化。

    【讨论】:

    • 好的,我想我没有错过 AWS CLI 中的任何内容,谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-21
    • 2018-07-02
    • 2020-01-26
    • 1970-01-01
    相关资源
    最近更新 更多