Dynamodb 简明教程
DynamoDB - Data Pipeline
数据管道允许将数据导出和导入到表、文件或S3存储桶中。当然,这在备份、测试和类似需求或场景中被证明是有用的。
Data Pipeline allows for exporting and importing data to/from a table, file, or S3 bucket. This of course proves useful in backups, testing, and for similar needs or scenarios.
在导出中,您可以使用Data Pipeline控制台创建一个新的管道并启动Amazon EMR(Elastic MapReduce)群集以执行导出操作。EMR从DynamoDB读取数据并写入目标。我们将在本教程的后面详细讨论EMR。
In an export, you use the Data Pipeline console, which makes a new pipeline and launches an Amazon EMR (Elastic MapReduce) cluster to perform the export. An EMR reads data from DynamoDB and writes to the target. We discuss EMR in detail later in this tutorial.
在导入操作中,您可以使用Data Pipeline控制台,它会创建一个管道并启动EMR来执行导入操作。它从源读取数据并写入目标。
In an import operation, you use the Data Pipeline console, which makes a pipeline and launches EMR to perform the import. It reads data from the source and writes to the destination.
由于使用了S3和EMR等服务,因此导出/导入操作会产生一定的成本。
Note − Export/import operations carry a cost given the services used, specifically, EMR and S3.
Using Data Pipeline
使用Data Pipeline时,必须指定操作和资源权限。您可以利用IAM角色或策略来定义它们。执行导入/导出操作的用户应注意,他们需要一个有效的访问密钥ID和密钥。
You must specify action and resource permissions when using Data Pipeline. You can utilize an IAM role or policy to define them. The users who are performing imports/exports should make a note that they would require an active access key ID and secret key.
IAM Roles for Data Pipeline
您需要两个IAM角色才能使用Data Pipeline -
You need two IAM roles to use Data Pipeline −
-
DataPipelineDefaultRole − This has all the actions you permit the pipeline to perform for you.
-
DataPipelineDefaultResourceRole − This has resources you permit the pipeline to provision for you.
如果您是Data Pipeline的新手,则必须生成每个角色。由于现有的角色,所有先前用户都拥有这些角色。
If you are new to Data Pipeline, you must spawn each role. All the previous users possess these roles due to the existing roles.
使用IAM控制台为Data Pipeline创建IAM角色,并执行以下四个步骤 -
Use the IAM console to create IAM roles for Data Pipeline, and perform the following four steps −
-
登录位于以下位置的IAM控制台:
Step 1 − Log in to the IAM console located at https://console.aws.amazon.com/iam/
-
从仪表板中选择角色。
Step 2 − Select Roles from the dashboard.
-
选择“创建角色”。然后在“角色名称”字段中输入“DataPipelineDefaultRole”,并选择“继续:权限”。在“权限策略”面板中的“分配权限”列表中,导航到“AWS服务”,并选择“Elastic MapReduce”。在“选择操作”面板中选择“全部操作”。
Step 3 − Select Create New Role. Then enter DataPipelineDefaultRole in the Role Name field, and select Next Step. In the AWS Service Roles list in the Role Type panel, navigate to Data Pipeline, and choose Select. Select Create Role in the Review panel.
-
选择“查看策略”。
Step 4 − Select Create New Role.