0

我想创建对 Amazon S3 存储桶的 AWS Config 访问权限,下面提供了我根据链接https://docs.aws.amazon.com/config/latest/developerguide/s3-bucket-编写的策略政策.html

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AWSConfigBucketPermissionsCheck",
      "Effect": "Allow",
      "Principal": {
        "Service": [
         "config.amazonaws.com"
        ]
      },
      "Action": "s3:GetBucketAcl",
      "Resource": "arn:aws:s3:::targetBucketName"
    },
    {
      "Sid": "AWSConfigBucketExistenceCheck",
      "Effect": "Allow",
      "Principal": {
        "Service": [
          "config.amazonaws.com"
        ]
      },
      "Action": "s3:ListBucket",
      "Resource": "arn:aws:s3:::targetBucketName"
    },
    {
      "Sid": "AWSConfigBucketDelivery",
      "Effect": "Allow",
      "Principal": {
        "Service": [
         "config.amazonaws.com"    
        ]
      },
      "Action": "s3:PutObject",
      "Resource": "arn:aws:s3:::targetBucketName/[optional] prefix/AWSLogs/sourceAccountID-WithoutHyphens/Config/*",
      "Condition": { 
        "StringEquals": { 
          "s3:x-amz-acl": "bucket-owner-full-control"
        }
      }
    }
  ]
}   

我想知道下面提供的部分:

"Resource": "arn:aws:s3:::targetBucketName/[optional] prefix/AWSLogs/sourceAccountID-WithoutHyphens/Config/*",

保单的含义是什么?prefix如何填写prefix/AWSLogs/sourceAccountID-WithoutHyphens/Config/*保单部分?

谢谢。

4

1 回答 1

1

前缀是您在将日志记录配置到 S3 时定义的内容。这是可选的。Config 使用标准路径/密钥格式将日志写入 S3 存储桶,即“prefix/AWSLogs/sourceAccountID-WithoutHyphens/Config/*”。

如果您从控制台将配置日志记录配置到 S3,则不必担心存储桶策略,因为它将自动创建。您只需提供存储桶名称和可选前缀。

于 2021-06-14T13:58:48.090 回答