DynamoDB 与 Amazon Redshift 的零 ETL 集成
Amazon DynamoDB 与 Amazon Redshift 的零 ETL 集成无需任何编码即可对 DynamoDB 数据进行无缝分析。这项完全托管的特征可自动将 DynamoDB 表复制到 Amazon Redshift 数据库中,因此用户无需设置复杂的 ETL 流程,即可对自己的 DynamoDB 数据运行 SQL 查询和分析。该集成的工作原理是将 DynamoDB 表中的数据复制到 Amazon Redshift 数据库。
要设置该集成,只需将 DynamoDB 表指定为源,将 Amazon Redshift 数据库指定为目标即可。激活后,该集成会导出整个 DynamoDB 表来填充 Amazon Redshift 数据库。完成这个初始过程所花的时间取决于 DynamoDB 表大小。然后,零 ETL 集成使用 DynamoDB 增量导出功能,每 15-30 分钟以增量方式将更新从 DynamoDB 复制到 Amazon Redshift。这意味着 Amazon Redshift 中复制的 DynamoDB 数据会自动保持最新。
配置完成后,用户可以使用标准的 SQL 客户端和工具来分析 Amazon Redshift 中的 DynamoDB 数据,而不会影响 DynamoDB 表的性能。这种零 ETL 集成消除了繁琐的 ETL,让您能够通过 Amazon Redshift 分析和机器学习功能快速轻松地从 DynamoDB 获取见解。
主题
创建 DynamoDB 与 Amazon Redshift 的零 ETL 集成之前的先决条件
-
您必须先创建源 DynamoDB 表和目标 Amazon Redshift 集群,然后才能创建集成。步骤 1:配置源 DynamoDB 表和步骤 2:创建 Amazon Redshift 数据仓库中提供了相应信息。
-
Amazon DynamoDB 与 Amazon Redshift 的零 ETL 集成要求您的源 DynamoDB 表启用时间点故障恢复(PITR)。
-
对于基于资源的策略,如果您创建的集成使 DynamoDB 表和 Amazon Redshift 数据仓库位于同一账户中,则可以在创建集成步骤中使用自动修复此问题选项,将所需的资源策略自动应用于 DynamoDB 和 Amazon Redshift。如果您创建的集成使 DynamoDB 表和 Amazon Redshift 数据仓库位于不同的 Amazon 账户,则需要对 Amazon Redshift 数据仓库应用以下资源策略。
{ "Version": "2012-10-17", "Statement": [ { "Sid": "Statement that allows redshift service to DescribeTable and ExportTable", "Effect": "Allow", "Principal": { "Service": "redshift.amazonaws.com" }, "Action": [ "dynamodb:ExportTableToPointInTime", "dynamodb:DescribeTable" ], "Resource": "*", "Condition": { "StringEquals": { "aws:SourceAccount": "<account>" }, "ArnEquals": { "aws:SourceArn": "arn:aws:redshift:<region>:<account>:integration:*" } } }, { "Sid": "Statement that allows redshift service to see all exports performed on the table", "Effect": "Allow", "Principal": { "Service": "redshift.amazonaws.com" }, "Action": "dynamodb:DescribeExport", "Resource": "arn:aws:dynamodb:<region>:<account>:table/<table-name>/export/*", "Condition": { "StringEquals": { "aws:SourceAccount": "<account>" }, "ArnEquals": { "aws:SourceArn": "arn:aws:redshift:<region>:<account>:integration:*" } } } ] }
-
基于身份的策略
-
创建集成的用户需要基于身份的策略来授权以下操作:
GetResourcePolicy
、PutResourcePolicy
和UpdateContinuousBackups
。注意
以下策略示例将该资源显示为
arn:aws:redshift{-serverless}
。此示例表明 arn 可以是arn:aws:redshift
,也可以是arn:aws:redshift-serverless
,具体取决于您的命名空间是 Amazon Redshift 集群还是 Amazon Redshift Serverless 命名空间。{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "dynamodb:ListTables" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "dynamodb:GetResourcePolicy", "dynamodb:PutResourcePolicy", "dynamodb:UpdateContinuousBackups" ], "Resource": [ "arn:aws:dynamodb:<region>:<account>:table/<table-name>" ] }, { "Sid": "AllowRedshiftDescribeIntegration", "Effect": "Allow", "Action": [ "redshift:DescribeIntegrations" ], "Resource": "*" }, { "Sid": "AllowRedshiftCreateIntegration", "Effect": "Allow", "Action": "redshift:CreateIntegration", "Resource": "arn:aws:redshift:<region>:<account>:integration:*" }, { "Sid": "AllowRedshiftModifyDeleteIntegration", "Effect": "Allow", "Action": [ "redshift:ModifyIntegration", "redshift:DeleteIntegration" ], "Resource": "arn:aws:redshift:<region>:<account>:integration:<uuid>" }, { "Sid": "AllowRedshiftCreateInboundIntegration", "Effect": "Allow", "Action": "redshift:CreateInboundIntegration", "Resource": // The Amazon Resource Name (arn) for a Redshift provisioned cluster and a Redshift Serverless namespace have different formats. // Choose the one that applies to you: "arn:aws:redshift:<region>:<account>:namespace:<uuid>" "arn:aws:redshift-serverless:<region>:<account>:namespace/<uuid>" } ] }
-
负责配置目标 Amazon Redshift 命名空间的用户需要基于身份的策略来授权以下操作:
PutResourcePolicy
、DeleteResourcePolicy
和GetResourcePolicy
。{ "Statement": [ # This statement authorizes the user to change, view or remove resource policies on a specific namespace { "Effect": "Allow", "Action": [ "redshift:PutResourcePolicy", "redshift:DeleteResourcePolicy", "redshift:GetResourcePolicy" ], "Resource": [ "arn:aws:redshift{-serverless}:<region>:<account>:namespace/ExampleNamespace" ] }, # This statement authorizes the user to view integrations connected to any target namespaces in the account { "Effect": "Allow", "Action": [ "redshift:DescribeInboundIntegrations" ], "Resource": [ "arn:aws:redshift{-serverless}:<region>:<account>:namespace/*" ] } ], "Version": "2012-10-17" }
-
-
加密密钥权限
如果使用客户托管的 Amazon KMS 密钥对源 DynamoDB 表进行加密,则需要在 KMS 密钥上添加以下策略。此策略允许 Amazon Redshift 使用您的 KMS 密钥从您的加密表中导出数据。
{ "Sid": "Statement to allow Redshift service to perform Decrypt operation on the source DynamoDB Table", "Effect": "Allow", "Principal": { "Service": [ "redshift.amazonaws.com" ] }, "Action": "kms:Decrypt", "Resource": "*", "Condition": { "StringEquals": { "aws:SourceAccount": "<account>" }, "ArnEquals": { "aws:SourceArn": "arn:aws:redshift:<region>:<account>:integration:*" } } }
您也可以按照《Amazon Redshift 管理指南》中的开始使用零 ETL 集成步骤来配置 Amazon Redshift 命名空间的权限。
使用 DynamoDB 与 Amazon Redshift 的零 ETL 集成时的限制
以下一般限制适用于此集成的当前版本。在后续版本中,这些限制可能会发生变更。
注意
除了以下限制外,还要查看使用零 ETL 集成时的一般注意事项,请参阅《Amazon Redshift 管理指南》中的使用与 Amazon Redshift 的零 ETL 集成时的注意事项。
-
DynamoDB 表和 Amazon Redshift 集群需要位于同一区域。
-
源 DynamoDB 表必须使用 Amazon 拥有或客户托管的 Amazon KMS 密钥进行加密。源 DynamoDB 表不支持 Amazon 托管式加密。