Amazon DynamoDB 動作、資源和條件索引鍵 - 服務授權參考

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

Amazon DynamoDB 動作、資源和條件索引鍵

Amazon DynamoDB (服務字首:dynamodb) 提供可用於 IAM 許可政策的下列服務特定資源、動作和條件內容金鑰。

參考資料:

Amazon DynamoDB 定義的動作

您可在 IAM 政策陳述式的 Action 元素中指定以下動作。使用政策來授予在 AWS中執行操作的許可。在政策中使用動作時,通常會允許或拒絕存取相同名稱的 API 操作或 CLI 命令。不過,在某些情況下,單一動作可控制對多個操作的存取。或者,某些操作需要多種不同的動作。

「動作」資料表的資源類型欄會指出每個動作是否支援資源層級的許可。如果此欄沒有值,您必須在政策陳述式的 Resource 元素中指定政策適用的所有資源 ("*")。如果資料欄包含資源類型,則您可以在具有該動作的陳述式中指定該類型的 ARN。如果動作具有一或多個必要資源,呼叫者必須具有對這些資源使用動作的許可。表格中的必要資源會以星號 (*) 表示。如果您使用 IAM 政策中的 Resource 元素限制資源存取,則每種必要的資源類型必須要有 ARN 或模式。某些動作支援多種資源類型。如果資源類型是選用 (未顯示為必要),則您可以選擇使用其中一種選用資源類型。

「動作」資料表的條件索引鍵欄包含您可以在政策陳述式的 Condition 元素中指定的索引鍵。如需有關與服務資源相關聯之條件索引鍵的詳細資訊,請參閱「資源類型」資料表的條件索引鍵欄。

注意

資源條件索引鍵會列在資源類型資料表中。您可以在「動作」資料表的資源類型 (*必填) 欄中找到適用於動作的資源類型連結。「資源類型」資料表中的資源類型包括條件索引鍵欄,其中包含套用至「動作」資料表中動作的資源條件索引鍵。

如需下表各欄的詳細資訊,請參閱動作資料表

動作 描述 存取層級 資源類型 (*必填項目) 條件索引鍵 相依動作
BatchGetItem 准許從一或多個資料表傳回一或多個項目的屬性 讀取

table*

dynamodb:Attributes

dynamodb:LeadingKeys

dynamodb:ReturnConsumedCapacity

dynamodb:Select

BatchWriteItem 准許在一或多個資料表中放置或刪除多個項目 寫入

table*

dynamodb:Attributes

dynamodb:LeadingKeys

dynamodb:ReturnConsumedCapacity

ConditionCheckItem 授予 ConditionCheckItem 操作權限檢查具有給定主鍵的項目的一組屬性是否存在 讀取

table*

dynamodb:Attributes

dynamodb:LeadingKeys

dynamodb:ReturnConsumedCapacity

dynamodb:ReturnValues

CreateBackup 准許為現有的資料表建立備份 寫入

table*

CreateGlobalTable 准許從現有資料表建立全域資料表 寫入

global-table*

table*

CreateTable 授予對 CreateTable 操作的權限將新表添加到您的帳戶 寫入

table*

CreateTableReplica [僅限許可] 准許新增複本資料表 寫入

table*

DeleteBackup 准許刪除資料表的現有備份 寫入

backup*

DeleteItem 准許透過主索引鍵刪除資料表中的單一項目 寫入

table*

dynamodb:Attributes

dynamodb:EnclosingOperation

dynamodb:LeadingKeys

dynamodb:ReturnConsumedCapacity

dynamodb:ReturnValues

DeleteResourcePolicy 授與刪除附加至資源的資源型原則的權限 許可管理

stream*

table*

DeleteTable 授予刪除表及其所有項目的 DeleteTable 操作的權限 寫入

table*

DeleteTableReplica [僅限許可] 准許刪除複本資料表及其所有項目 寫入

table*

DescribeBackup 准許描述資料表的現有備份 讀取

backup*

DescribeContinuousBackups 准許在指定的資料表檢查備份還原設定狀態 讀取

table*

DescribeContributorInsights 准許描述特定資料表或全域次要索引的參與者洞察狀態和相關詳細資訊 讀取

table*

index

DescribeEndpoints 准許傳回區域端點的相關資訊 讀取
DescribeExport 准許描述資料表的現有匯出 讀取

export*

DescribeGlobalTable 准許傳回指定全域資料表的相關資訊 讀取

global-table*

DescribeGlobalTableSettings 准許傳回指定全域資料表的設定資訊 讀取

global-table*

DescribeImport 准許描述現有的匯入 讀取

import*

DescribeKinesisStreamingDestination 准許授權描述 Kinesis 串流狀態和指定資料表的相關詳細資訊 讀取

table*

DescribeLimits 授予權限,以針對整個區域和您 AWS 帳戶 在該地區建立的任何 DynamoDB 表傳回目前佈建的容量限制 讀取
DescribeReservedCapacity [僅限許可] 准許描述一或多個購買的預留容量 讀取
DescribeReservedCapacityOfferings [僅限許可] 准許描述可供購買的預留容量產品 讀取
DescribeStream 傳回串流相關資訊,包含目前串流狀態,其 Amazon Resource Name (ARN)、構成的碎片數量,以及其對應的 DynamoDB 資料表 讀取

stream*

DescribeTable 准許傳回資料表的相關資訊 讀取

table*

DescribeTableReplicaAutoScaling 准許描述全域資料表所有複本的自動擴展設定 讀取

table*

DescribeTimeToLive 准許在指定資料表提供存留時間 (TTL) 的狀態描述 讀取

table*

DisableKinesisStreamingDestination 准許授權停止從 DynamoDB 資料表複寫到 Kinesis 資料串流 寫入

table*

EnableKinesisStreamingDestination 准許授權在啟用工作流程期間選擇的時間戳記開始將資料表資料複寫到指定 Kinesis 資料串流 寫入

table*

ExportTableToPointInTime 准許啟動從 DynamoDB 資料表到 S3 的匯出 寫入

table*

GetItem 授予權限,該 GetItem 操作返回具有給定主鍵的項目的一組屬性 讀取

table*

dynamodb:Attributes

dynamodb:EnclosingOperation

dynamodb:LeadingKeys

dynamodb:ReturnConsumedCapacity

dynamodb:Select

GetRecords 准許從指定碎片擷取串流記錄 讀取

stream*

GetResourcePolicy 授與檢視資源以資源為基礎之政策的權限 讀取

stream*

table*

GetShardIterator 准許傳回碎片迭代器 讀取

stream*

ImportTable 准許啟動從 S3 匯入至 DynamoDB 資料表 寫入

table*

ListBackups 准許列出與帳戶和端點相關聯的備份 清單
ListContributorInsights 授與列出與目前帳號和端點關聯的所有資料表和全域次要索引的權限 ContributorInsightsSummary 清單
ListExports 准許列出與帳戶和端點相關聯的匯出 列出
ListGlobalTables 准許列出在指定區域擁有複本的所有全域資料表 清單
ListImports 准許列出與帳戶和端點相關聯的匯入 清單
ListStreams 准許傳回與目前帳戶及端點相關聯的串流 ARN 陣列 讀取
ListTables 准許傳回與目前帳戶及端點相關聯的資料表名稱陣列 列出
ListTagsOfResource 准許列出 Amazon DynamoDB 資源上所有標籤 讀取

table*

PartiQLDelete 准許透過主索引鍵刪除表格中的單個項目 寫入

table*

dynamodb:Attributes

dynamodb:EnclosingOperation

dynamodb:LeadingKeys

dynamodb:ReturnValues

PartiQLInsert 准許在表格中不存在具有相同主索引鍵的項目時,建立新的項目 寫入

table*

dynamodb:Attributes

dynamodb:EnclosingOperation

dynamodb:LeadingKeys

PartiQLSelect 准許從表格或索引讀取項目的一組屬性 讀取

table*

index

dynamodb:Attributes

dynamodb:EnclosingOperation

dynamodb:FullTableScan

dynamodb:LeadingKeys

dynamodb:Select

PartiQLUpdate 准許編輯現有項目的屬性 寫入

table*

dynamodb:Attributes

dynamodb:EnclosingOperation

dynamodb:LeadingKeys

dynamodb:ReturnValues

PurchaseReservedCapacityOfferings [僅限許可] 准許購買預留容量,與您的帳戶搭配使用 寫入
PutItem 准許建立新項目,或以新項目取代舊項目 寫入

table*

dynamodb:Attributes

dynamodb:EnclosingOperation

dynamodb:LeadingKeys

dynamodb:ReturnConsumedCapacity

dynamodb:ReturnValues

PutResourcePolicy 授與將以資源為基礎的策略附加到資源的權限 許可管理

stream*

table*

Query 准許使用資料表的主索引鍵或次要索引,直接從資料表或索引存取項目 讀取

table*

index

dynamodb:Attributes

dynamodb:LeadingKeys

dynamodb:ReturnConsumedCapacity

dynamodb:ReturnValues

dynamodb:Select

RestoreTableFromAwsBackup [僅限許可] 授予從 AWS Backup 復原點建立新資料表的權限 寫入

table*

RestoreTableFromBackup 准許從現有備份建立新資料表 寫入

backup*

dynamodb:BatchWriteItem

dynamodb:DeleteItem

dynamodb:GetItem

dynamodb:PutItem

dynamodb:Query

dynamodb:Scan

dynamodb:UpdateItem

table*

RestoreTableToPointInTime 准許將資料表還原至特定時間點 寫入

table*

dynamodb:BatchWriteItem

dynamodb:DeleteItem

dynamodb:GetItem

dynamodb:PutItem

dynamodb:Query

dynamodb:Scan

dynamodb:UpdateItem

Scan 准許存取資料表中的每個項目或次要索引,以傳回一或多個項目和項目屬性 讀取

table*

index

dynamodb:Attributes

dynamodb:ReturnConsumedCapacity

dynamodb:ReturnValues

dynamodb:Select

StartAwsBackupJob [僅限許可] 授予在啟用高級功能的 Back AWS up 上創建備份的權限 寫入

table*

TagResource 准許將一組標籤與 Amazon DynamoDB 資源建立關聯 標記

table*

UntagResource 准許從 Amazon DynamoDB 資源移除標籤關聯 標記

table*

UpdateContinuousBackups 准許啟用或停用連續備份 寫入

table*

UpdateContributorInsights 准許更新特定資料表或全域次要索引的參與者洞察狀態 寫入

table*

index

UpdateGlobalTable 准許在指定的全域資料表新增或移除複本 寫入

global-table*

table*

UpdateGlobalTableSettings 准許更新指定全域資料表的設定 寫入

global-table*

table*

UpdateGlobalTableVersion [僅限許可] 准許更新指定全域資料表的版本 寫入

global-table*

table

UpdateItem 准許編輯現有項目的屬性,或是在新項目尚未存在時,將新項目加入到資料表 寫入

table*

dynamodb:Attributes

dynamodb:EnclosingOperation

dynamodb:LeadingKeys

dynamodb:ReturnConsumedCapacity

dynamodb:ReturnValues

UpdateKinesisStreamingDestination 授與更新指定 Kinesis 資料串流之資料複製組態的權限 寫入

table*

UpdateTable 准許修改佈建輸送量設定、全域次要索引,或是指定資料表的 DynamoDB Streams 設定 寫入

table*

UpdateTableReplicaAutoScaling 准許更新複本列表的自動擴展設定 寫入

table*

UpdateTimeToLive 准許啟用或停用指定資料表的 TTL 寫入

table*

Amazon DynamoDB 定義的資源類型

此服務會定義下列資源類型,並可用在 IAM 許可政策陳述式的 Resource 元素中。動作資料表中的每個動作都會指明可使用該動作指定的資源類型。資源類型也能定義您可以在政策中包含哪些條件索引鍵。這些索引鍵都會顯示在「資源類型」資料表的最後一欄。如需下表各欄的詳細資訊,請參閱資源類型資料表

資源類型 ARN 條件索引鍵
index arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/index/${IndexName}
stream arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/stream/${StreamLabel}
table arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}
backup arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/backup/${BackupName}
export arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/export/${ExportName}
global-table arn:${Partition}:dynamodb::${Account}:global-table/${GlobalTableName}
import arn:${Partition}:dynamodb:${Region}:${Account}:table/${TableName}/import/${ImportName}

Amazon DynamoDB 的條件索引鍵

Amazon DynamoDB 會定義下列條件金鑰,可用於 IAM 政策的 Condition 元素。您可以使用這些索引鍵來縮小套用政策陳述式的條件。如需下表各欄的詳細資訊,請參閱條件索引鍵資料表

若要檢視所有服務都可使用的全域條件索引鍵,請參閱可用的全域條件索引鍵

注意

如需關於如何透過 IAM 政策使用內容金要來強化 DynamoDB 存取,請參閱 Amazon DynamoDB 開發人員指南使用 IAM 政策金鑰以強化精細存取控制

條件索引鍵 描述 Type
dynamodb:Attributes 依資料表的屬性 (欄位或資料欄) 名稱篩選存取權 ArrayOfString
dynamodb:EnclosingOperation 透過封鎖 Transaction API 呼叫並允許非 Transaction API 呼叫,來篩選存取權 字串
dynamodb:FullTableScan 透過封鎖完整資料表掃描來篩選存取權 Bool
dynamodb:LeadingKeys 依資料表的分區索引鍵篩選存取權 ArrayOfString
dynamodb:ReturnConsumedCapacity 依要求的 ReturnConsumedCapacity 參數篩選存取。包含「TOTAL」或「NONE」 字串
dynamodb:ReturnValues 通過請求的 ReturnValues 參數過濾訪問。包含以下其中一項:「ALL_OLD」、「UPDATED_OLD」、「ALL_NEW」、「UPDATED_NEW」或「NONE」 字串
dynamodb:Select 依 Query 或 Scan 請求的 Select 參數篩選存取權 字串