Skip to content

CreateBatchLoadTask

Source: src/AWS/Timestream/CreateBatchLoadTask.ts

Runtime binding for timestream-write:CreateBatchLoadTask — start a bulk CSV import from S3 into a Timestream Table.

Bind the operation to the target table to get a callable with TargetDatabaseName and TargetTableName injected automatically; you supply the S3 data source, the report location, and the data model. The binding grants timestream:CreateBatchLoadTask on the table and its database; grant the host S3 read on the source bucket and write on the report bucket separately (e.g. via the S3 capability bindings).

Provide Timestream.CreateBatchLoadTaskHttp on the Function to implement the binding.

// init — bind the operation to the target table
const createBatchLoadTask = yield* Timestream.CreateBatchLoadTask(table);
// runtime — import CSV rows from S3
const task = yield* createBatchLoadTask({
DataSourceConfiguration: {
DataSourceS3Configuration: { BucketName: "my-ingest-bucket", ObjectKeyPrefix: "metrics/" },
DataFormat: "CSV",
},
ReportConfiguration: {
ReportS3Configuration: { BucketName: "my-report-bucket" },
},
DataModelConfiguration: { DataModel: { TimeColumn: "time", TimeUnit: "MILLISECONDS", DimensionMappings: [{ SourceColumn: "host" }], MeasureNameColumn: "measure" } },
});
// task.TaskId identifies the import for Describe/Resume