Skip to content

CreateJob

Source: src/AWS/DataExchange/CreateJob.ts

Runtime binding for dataexchange:CreateJob.

Creates an import/export job — the Data Exchange work unit that moves assets between S3 (or signed URLs, Redshift datashares, API Gateway APIs, Lake Formation permissions) and a revision. Import/export jobs additionally need S3 permissions on the source/destination bucket — attach the matching AWS.S3 bindings to the same host. Provide the implementation with Effect.provide(AWS.DataExchange.CreateJobHttp).

const createJob = yield* AWS.DataExchange.CreateJob();
const startJob = yield* AWS.DataExchange.StartJob();
// runtime
const job = yield* createJob({
Type: "IMPORT_ASSETS_FROM_S3",
Details: {
ImportAssetsFromS3: {
DataSetId: dataSetId,
RevisionId: revisionId,
AssetSources: [{ Bucket: bucket, Key: "prices.csv" }],
},
},
});
yield* startJob({ JobId: job.Id! });