

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# Amazon S3 資料來源的存取控制
<a name="s3-acl"></a>

您可以使用組態檔案控制對 Amazon S3 資料來源中文件的存取。當您呼叫 [CreateDataSource](https://docs.aws.amazon.com/kendra/latest/APIReference/API_CreateDataSource.html) 或 [UpdateDataSource](https://docs.aws.amazon.com/kendra/latest/APIReference/API_UpdateDataSource.html) API 時，您可以在 主控台或 中指定 檔案做為 `AccessControlListConfiguration` 參數。

組態檔案包含可識別 S3 字首的 JSON 結構，並列出字首的存取設定。字首可以是路徑，或指定至單一檔案。若字首為路徑，存取設定將套用至該路徑下的所有檔案。JSON 組態檔案中有最大數量的 S3 字首，以及預設的檔案大小上限。如需詳細資訊，請參閱[的配額 Amazon Kendra](quotas.md)

您可以在存取設定中指定使用者和群組。當您查詢索引時，您可以指定使用者和群組資訊。如需詳細資訊，請參閱[依使用者屬性篩選](user-context-filter.md#context-filter-attribute)。

組態檔案的 JSON 結構必須符合以下格式：

```
[
    {
        "keyPrefix": "s3://BUCKETNAME/prefix1/",
        "aclEntries": [
            {
                "Name": "user1",
                "Type": "USER",
                "Access": "ALLOW"
            },
            {
                "Name": "group1",
                "Type": "GROUP",
                "Access": "DENY"
            }
        ]
    },
    {
        "keyPrefix": "s3://prefix2",
        "aclEntries": [
            {
                "Name": "user2",
                "Type": "USER",
                "Access": "ALLOW"
            },
            {
                "Name": "user1",
                "Type": "USER",
                "Access": "DENY"
            },
            {
                "Name": "group1",
                "Type": "GROUP",
                "Access": "DENY"
            }
        ]
    }
]
```