【问题标题】:Restrict RDS users to region将 RDS 用户限制在区域内
【发布时间】:2017-11-10 15:50:01
【问题描述】:

我正在尝试创建一个可以限制用户访问不同区域 RDS 的策略。但是,我只想让他们管理员访问一个区域,即 ap-southeast-1。

我已经制定了一些政策,但它们不适用于新加坡地区,仅适用于美国东部地区。

为什么这适用于美国东部但不适用于新加坡?

政策示例:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt----------",
            "Effect": "Allow",
            "Action": [
                "rds:*"
            ],
            "Condition": {
                "StringEquals": {
                    "ec2:Region": "ap-southeast-1"
                }
            },
            "Resource": [
                "*"
            ]
        }
    ]
} 

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt----------",
            "Action": [
                "rds:*",
                "cloudwatch:DescribeAlarms",
                "cloudwatch:GetMetricStatistics",
                "ec2:DescribeAccountAttributes",
                "ec2:DescribeAvailabilityZones",
                "ec2:DescribeSecurityGroups",
                "ec2:DescribeSubnets",
                "ec2:DescribeVpcs",
                "sns:ListSubscriptions",
                "sns:ListTopics",
                "logs:DescribeLogStreams",
                "logs:GetLogEvents"
            ],
            "Effect": "Allow",
            "Resource": "arn:aws:rds:ap-southeast-1:*"
        }
    ]
}

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt1454649600000",
            "Effect": "Allow",
            "Action": [
                "*"
            ],
            "Resource": [
                "arn:aws:rds:ap-southeast-1:account number:*"
            ]
        }
    ]
}

【问题讨论】:

    标签: amazon-web-services amazon-iam aws-ec2 aws-rds


    【解决方案1】:

    试试这个 .. 下面的代码对我有用。

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "Stmt145591112222",
          "Action": "rds:*",
          "Effect": "Allow",
          "Resource": "arn:aws:rds:ap-southeast-1:ACC_ID:db:*"
    
        }
      ]
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-31
      相关资源
      最近更新 更多