我正在为 dynamo db 导出到 s3 创建数据管道。为无服务器 yaml 提供的模板不适用于“PAY_PER_REQUEST”计费模式
使用 aws 控制台创建了一个 itr 工作正常,导出了它的定义,尝试在无服务器中使用相同的定义创建,但它给了我以下错误
ServerlessError: An error occurred: UrlReportDataPipeline - Pipeline Definition failed to validate because of following Errors: [{ObjectId = 'TableBackupActivity', errors = [Object references invalid id: 's3://dynamodb-dpl-#{myDDBRegion}/emr-ddb-storage-handler/4.11.0/emr-dynamodb-tools-4.11.0-SNAPSHOT-jar-with-dependencies.jar,org.apache.hadoop.dynamodb.tools.DynamoDBExport,#{output.directoryPath},#{input.tableName},#{input.readThroughputPercent}']}] and Warnings: [].
谁可以帮我这个事。使用控制台创建的管道与表备份活动中的相同步骤值完美配合。
管道模板粘贴在下面
UrlReportDataPipeline:
Type: AWS::DataPipeline::Pipeline
Properties:
Name: ***pipeline name****
Activate: true
ParameterObjects:
- Id: "myDDBReadThroughputRatio"
Attributes:
- Key: "description"
StringValue: "DynamoDB read throughput ratio"
- Key: "type"
StringValue: "Double"
- Key: "default"
StringValue: "0.9"
- Id: "myOutputS3Loc"
Attributes:
- Key: "description"
StringValue: "S3 output bucket"
- Key: "type"
StringValue: "AWS::S3::ObjectKey"
- Key: "default"
StringValue:
!Join [ "", [ "s3://", Ref: "UrlReportBucket" ] ]
- Id: "myDDBTableName"
Attributes:
- Key: "description"
StringValue: "DynamoDB Table Name"
- Key: "type"
StringValue: "String"
- Id: "myDDBRegion"
Attributes:
- Key: "description"
StringValue: "DynamoDB region"
ParameterValues:
- Id: "myDDBTableName"
StringValue:
Ref: "UrlReport"
- Id: "myDDBRegion"
StringValue: "eu-west-1"
PipelineObjects:
- Id: "S3BackupLocation"
Name: "Copy data to this S3 location"
Fields:
- Key: "type"
StringValue: "S3DataNode"
- Key: "dataFormat"
RefValue: "DDBExportFormat"
- Key: "directoryPath"
StringValue: "#{myOutputS3Loc}/#{format(@scheduledStartTime, 'YYYY-MM-dd-HH-mm-ss')}"
- Id: "DDBSourceTable"
Name: "DDBSourceTable"
Fields:
- Key: "tableName"
StringValue: "#{myDDBTableName}"
- Key: "type"
StringValue: "DynamoDBDataNode"
- Key: "dataFormat"
RefValue: "DDBExportFormat"
- Key: "readThroughputPercent"
StringValue: "#{myDDBReadThroughputRatio}"
- Id: "DDBExportFormat"
Name: "DDBExportFormat"
Fields:
- Key: "type"
StringValue: "DynamoDBExportDataFormat"
- Id: "TableBackupActivity"
Name: "TableBackupActivity"
Fields:
- Key: "resizeClusterBeforeRunning"
StringValue: "true"
- Key: "type"
StringValue: "EmrActivity"
- Key: "input"
RefValue: "DDBSourceTable"
- Key: "runsOn"
RefValue: "EmrClusterForBackup"
- Key: "output"
RefValue: "S3BackupLocation"
- Key: "step"
RefValue: "s3://dynamodb-dpl-#{myDDBRegion}/emr-ddb-storage-handler/4.11.0/emr-dynamodb-tools-4.11.0-SNAPSHOT-jar-with-dependencies.jar,org.apache.hadoop.dynamodb.tools.DynamoDBExport,#{output.directoryPath},#{input.tableName},#{input.readThroughputPercent}"
- Id: "DefaultSchedule"
Name: "Every 1 day"
Fields:
- Key: "occurrences"
StringValue: "1"
- Key: "startDateTime"
StringValue: "2020-09-17T1:00:00"
- Key: "type"
StringValue: "Schedule"
- Key: "period"
StringValue: "1 Day"
- Id: "Default"
Name: "Default"
Fields:
- Key: "type"
StringValue: "Default"
- Key: "scheduleType"
StringValue: "cron"
- Key: "failureAndRerunMode"
StringValue: "CASCADE"
- Key: "role"
StringValue: "DatapipelineDefaultRole"
- Key: "resourceRole"
StringValue: "DatapipelineDefaultResourceRole"
- Key: "schedule"
RefValue: "DefaultSchedule"
- Id: "EmrClusterForBackup"
Name: "EmrClusterForBackup"
Fields:
- Key: "terminateAfter"
StringValue: "2 Hours"
- Key: "masterInstanceType"
StringValue: "m3.xlarge"
- Key: "coreInstanceType"
StringValue: "m3.xlarge"
- Key: "coreInstanceCount"
StringValue: "1"
- Key: "type"
StringValue: "EmrCluster"
- Key: "releaseLabel"
StringValue: "emr-5.23.0"
- Key: "region"
StringValue: "#{myDDBRegion}"