AWS.DataExchange reference
AcceptDataGrant
Section titled “AcceptDataGrant”Source:
src/AWS/DataExchange/AcceptDataGrant.ts
Runtime binding for dataexchange:AcceptDataGrant.
Accepts a data grant another account sent to this account, creating
an entitled copy of the granted data set — the receiver-side
automation of direct data sharing.
Provide the implementation with
Effect.provide(AWS.DataExchange.AcceptDataGrantHttp).
AcceptDataGrant: Data Grants
Section titled “AcceptDataGrant: Data Grants”const acceptDataGrant = yield* AWS.DataExchange.AcceptDataGrant();
// runtimeconst accepted = yield* acceptDataGrant({ DataGrantArn: grantArn });yield* Effect.log(`entitled data set: ${accepted.DataSetId}`);CancelJob
Section titled “CancelJob”Source:
src/AWS/DataExchange/CancelJob.ts
Runtime binding for dataexchange:CancelJob.
Cancels a job that has not yet been started (WAITING state).
Provide the implementation with
Effect.provide(AWS.DataExchange.CancelJobHttp).
CancelJob: Import & Export Jobs
Section titled “CancelJob: Import & Export Jobs”const cancelJob = yield* AWS.DataExchange.CancelJob();
// runtimeyield* cancelJob({ JobId: job.Id! });CreateDataGrant
Section titled “CreateDataGrant”Source:
src/AWS/DataExchange/CreateDataGrant.ts
Runtime binding for dataexchange:CreateDataGrant.
Creates a data grant sharing an owned data set with another AWS
account directly (without an AWS Marketplace product). The receiver
must accept the grant to get an entitled copy of the data set.
Provide the implementation with
Effect.provide(AWS.DataExchange.CreateDataGrantHttp).
CreateDataGrant: Data Grants
Section titled “CreateDataGrant: Data Grants”const createDataGrant = yield* AWS.DataExchange.CreateDataGrant();
// runtimeconst grant = yield* createDataGrant({ Name: "prices-for-analytics", SourceDataSetId: dataSetId, ReceiverPrincipal: "111122223333", GrantDistributionScope: "NONE",});CreateJob
Section titled “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).
CreateJob: Import & Export Jobs
Section titled “CreateJob: Import & Export Jobs”const createJob = yield* AWS.DataExchange.CreateJob();const startJob = yield* AWS.DataExchange.StartJob();
// runtimeconst 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! });DataSet
Section titled “DataSet”Source:
src/AWS/DataExchange/DataSet.ts
An AWS Data Exchange data set — the top-level container that data providers publish revisions of data into. An owned data set holds revisions, each of which holds assets (e.g. S3 snapshot files) that subscribers receive.
DataSet: Creating Data Sets
Section titled “DataSet: Creating Data Sets”Basic S3-snapshot data set
import * as AWS from "alchemy/AWS";
const dataSet = yield* AWS.DataExchange.DataSet("Prices", { description: "Daily commodity price snapshots",});Named data set with tags
const dataSet = yield* AWS.DataExchange.DataSet("Prices", { name: "commodity-prices", assetType: "S3_SNAPSHOT", description: "Daily commodity price snapshots", tags: { team: "data" },});DataSet: Publishing Revisions
Section titled “DataSet: Publishing Revisions”const revision = yield* AWS.DataExchange.Revision("PricesV1", { dataSetId: dataSet.dataSetId, comment: "Initial snapshot",});DeleteAsset
Section titled “DeleteAsset”Source:
src/AWS/DataExchange/DeleteAsset.ts
Runtime binding for dataexchange:DeleteAsset.
Deletes an asset from the bound (not-yet-finalized) revision. The
data set and revision ids are injected from the binding.
Provide the implementation with
Effect.provide(AWS.DataExchange.DeleteAssetHttp).
DeleteAsset: Managing Assets
Section titled “DeleteAsset: Managing Assets”const deleteAsset = yield* AWS.DataExchange.DeleteAsset(revision);
// runtimeyield* deleteAsset({ AssetId: assetId });DeleteDataGrant
Section titled “DeleteDataGrant”Source:
src/AWS/DataExchange/DeleteDataGrant.ts
Runtime binding for dataexchange:DeleteDataGrant.
Deletes a sent data grant, revoking the receiver’s entitlement.
Provide the implementation with
Effect.provide(AWS.DataExchange.DeleteDataGrantHttp).
DeleteDataGrant: Data Grants
Section titled “DeleteDataGrant: Data Grants”const deleteDataGrant = yield* AWS.DataExchange.DeleteDataGrant();
// runtimeyield* deleteDataGrant({ DataGrantId: grantId });EventAction
Section titled “EventAction”Source:
src/AWS/DataExchange/EventAction.ts
An AWS Data Exchange event action — an auto-export rule that copies every newly published revision of an ENTITLED data set into your S3 bucket the moment the provider publishes it. This is the subscriber-side automation primitive: subscribe to a product (or accept a data grant), attach an event action, and fresh data lands in your bucket with no polling.
Event actions require an entitled data set — creating one against an
owned data set fails with a ValidationException.
EventAction: Auto-Exporting Entitled Data
Section titled “EventAction: Auto-Exporting Entitled Data”Export new revisions to S3
import * as AWS from "alchemy/AWS";
const landing = yield* AWS.S3.Bucket("Landing", {});
const autoExport = yield* AWS.DataExchange.EventAction("AutoExport", { dataSetId: entitledDataSetId, exportRevisionToS3: { bucket: landing.bucketName },});Encrypted export with a key pattern
const autoExport = yield* AWS.DataExchange.EventAction("AutoExport", { dataSetId: entitledDataSetId, exportRevisionToS3: { bucket: landing.bucketName, keyPattern: "prices/${Revision.CreatedAt}/${Asset.Name}", encryption: { type: "aws:kms", kmsKeyArn: key.keyArn }, },});GetAsset
Section titled “GetAsset”Source:
src/AWS/DataExchange/GetAsset.ts
Runtime binding for dataexchange:GetAsset.
Reads one asset of the bound revision — name, type-specific details
(S3 snapshot size, API Gateway endpoint, …), and timestamps. The data
set and revision ids are injected from the binding.
Provide the implementation with
Effect.provide(AWS.DataExchange.GetAssetHttp).
GetAsset: Reading Revisions & Assets
Section titled “GetAsset: Reading Revisions & Assets”const getAsset = yield* AWS.DataExchange.GetAsset(revision);
// runtimeconst asset = yield* getAsset({ AssetId: assetId });yield* Effect.log(`asset ${asset.Name}`);GetDataGrant
Section titled “GetDataGrant”Source:
src/AWS/DataExchange/GetDataGrant.ts
Runtime binding for dataexchange:GetDataGrant.
Reads a sent data grant’s detail — receiver, acceptance state, and
expiration.
Provide the implementation with
Effect.provide(AWS.DataExchange.GetDataGrantHttp).
GetDataGrant: Data Grants
Section titled “GetDataGrant: Data Grants”const getDataGrant = yield* AWS.DataExchange.GetDataGrant();
// runtimeconst grant = yield* getDataGrant({ DataGrantId: grantId });yield* Effect.log(`state: ${grant.AcceptanceState}`);GetDataSet
Section titled “GetDataSet”Source:
src/AWS/DataExchange/GetDataSet.ts
Runtime binding for dataexchange:GetDataSet.
Reads the bound data set’s detail — name, description, asset type,
origin (OWNED or ENTITLED), and origin details. The data set id is
injected from the binding.
Provide the implementation with
Effect.provide(AWS.DataExchange.GetDataSetHttp).
GetDataSet: Reading Data Sets
Section titled “GetDataSet: Reading Data Sets”// init — bind the operation to the data setconst getDataSet = yield* AWS.DataExchange.GetDataSet(dataSet);
// runtimeconst detail = yield* getDataSet();yield* Effect.log(`data set ${detail.Name} (${detail.AssetType})`);GetJob
Section titled “GetJob”Source:
src/AWS/DataExchange/GetJob.ts
Runtime binding for dataexchange:GetJob.
Reads a job’s state (WAITING, IN_PROGRESS, COMPLETED, ERROR,
…) and typed error details — the polling half of every import/export
flow.
Provide the implementation with
Effect.provide(AWS.DataExchange.GetJobHttp).
GetJob: Import & Export Jobs
Section titled “GetJob: Import & Export Jobs”const getJob = yield* AWS.DataExchange.GetJob();
// runtimeconst done = yield* getJob({ JobId: job.Id! }).pipe( Effect.repeat({ schedule: Schedule.spaced("2 seconds"), until: (j) => j.State === "COMPLETED" || j.State === "ERROR", times: 30, }),);GetReceivedDataGrant
Section titled “GetReceivedDataGrant”Source:
src/AWS/DataExchange/GetReceivedDataGrant.ts
Runtime binding for dataexchange:GetReceivedDataGrant.
Reads a received data grant’s detail — sender, acceptance state, and
expiration.
Provide the implementation with
Effect.provide(AWS.DataExchange.GetReceivedDataGrantHttp).
GetReceivedDataGrant: Data Grants
Section titled “GetReceivedDataGrant: Data Grants”const getReceivedDataGrant = yield* AWS.DataExchange.GetReceivedDataGrant();
// runtimeconst grant = yield* getReceivedDataGrant({ DataGrantArn: grantArn });GetRevision
Section titled “GetRevision”Source:
src/AWS/DataExchange/GetRevision.ts
Runtime binding for dataexchange:GetRevision.
Reads the bound revision’s detail — comment, finalized state, and
revocation status. The data set and revision ids are injected from
the binding.
Provide the implementation with
Effect.provide(AWS.DataExchange.GetRevisionHttp).
GetRevision: Reading Revisions & Assets
Section titled “GetRevision: Reading Revisions & Assets”const getRevision = yield* AWS.DataExchange.GetRevision(revision);
// runtimeconst detail = yield* getRevision();yield* Effect.log(`finalized: ${detail.Finalized}`);ListDataGrants
Section titled “ListDataGrants”Source:
src/AWS/DataExchange/ListDataGrants.ts
Runtime binding for dataexchange:ListDataGrants.
Enumerates the data grants this account has sent.
Provide the implementation with
Effect.provide(AWS.DataExchange.ListDataGrantsHttp).
ListDataGrants: Data Grants
Section titled “ListDataGrants: Data Grants”const listDataGrants = yield* AWS.DataExchange.ListDataGrants();
// runtimeconst { DataGrantSummaries } = yield* listDataGrants();ListDataSetRevisions
Section titled “ListDataSetRevisions”Source:
src/AWS/DataExchange/ListDataSetRevisions.ts
Runtime binding for dataexchange:ListDataSetRevisions.
Enumerates the bound data set’s revisions, newest first — the
building block of “process the latest published revision” consumers.
The data set id is injected from the binding.
Provide the implementation with
Effect.provide(AWS.DataExchange.ListDataSetRevisionsHttp).
ListDataSetRevisions: Reading Data Sets
Section titled “ListDataSetRevisions: Reading Data Sets”const listRevisions = yield* AWS.DataExchange.ListDataSetRevisions(dataSet);
// runtimeconst { Revisions } = yield* listRevisions();const latest = (Revisions ?? []).find((r) => r.Finalized);ListDataSets
Section titled “ListDataSets”Source:
src/AWS/DataExchange/ListDataSets.ts
Runtime binding for dataexchange:ListDataSets.
Enumerates the account’s data sets — Origin: "OWNED" for data sets
this account publishes, Origin: "ENTITLED" for active
subscriptions.
Provide the implementation with
Effect.provide(AWS.DataExchange.ListDataSetsHttp).
ListDataSets: Reading Data Sets
Section titled “ListDataSets: Reading Data Sets”// init — account-level binding, no resource argumentconst listDataSets = yield* AWS.DataExchange.ListDataSets();
// runtimeconst { DataSets } = yield* listDataSets({ Origin: "ENTITLED" });ListEventActions
Section titled “ListEventActions”Source:
src/AWS/DataExchange/ListEventActions.ts
Runtime binding for dataexchange:ListEventActions.
Enumerates the account’s event actions (auto-export rules on entitled
data sets), optionally filtered to one event source data set.
Provide the implementation with
Effect.provide(AWS.DataExchange.ListEventActionsHttp).
ListEventActions: Event Actions
Section titled “ListEventActions: Event Actions”const listEventActions = yield* AWS.DataExchange.ListEventActions();
// runtimeconst { EventActions } = yield* listEventActions();ListJobs
Section titled “ListJobs”Source:
src/AWS/DataExchange/ListJobs.ts
Runtime binding for dataexchange:ListJobs.
Enumerates the account’s import/export jobs, optionally filtered to
one data set or revision.
Provide the implementation with
Effect.provide(AWS.DataExchange.ListJobsHttp).
ListJobs: Import & Export Jobs
Section titled “ListJobs: Import & Export Jobs”const listJobs = yield* AWS.DataExchange.ListJobs();
// runtimeconst { Jobs } = yield* listJobs({ DataSetId: dataSetId });ListReceivedDataGrants
Section titled “ListReceivedDataGrants”Source:
src/AWS/DataExchange/ListReceivedDataGrants.ts
Runtime binding for dataexchange:ListReceivedDataGrants.
Enumerates the data grants this account has received, optionally
filtered by acceptance state (PENDING_RECEIVER_ACCEPTANCE,
ACCEPTED).
Provide the implementation with
Effect.provide(AWS.DataExchange.ListReceivedDataGrantsHttp).
ListReceivedDataGrants: Data Grants
Section titled “ListReceivedDataGrants: Data Grants”const listReceivedDataGrants = yield* AWS.DataExchange.ListReceivedDataGrants();
// runtimeconst { DataGrantSummaries } = yield* listReceivedDataGrants({ AcceptanceState: ["PENDING_RECEIVER_ACCEPTANCE"],});ListRevisionAssets
Section titled “ListRevisionAssets”Source:
src/AWS/DataExchange/ListRevisionAssets.ts
Runtime binding for dataexchange:ListRevisionAssets.
Enumerates the assets imported into the bound revision. The data set
and revision ids are injected from the binding.
Provide the implementation with
Effect.provide(AWS.DataExchange.ListRevisionAssetsHttp).
ListRevisionAssets: Reading Revisions & Assets
Section titled “ListRevisionAssets: Reading Revisions & Assets”const listAssets = yield* AWS.DataExchange.ListRevisionAssets(revision);
// runtimeconst { Assets } = yield* listAssets();yield* Effect.log(`${(Assets ?? []).length} assets`);Revision
Section titled “Revision”Source:
src/AWS/DataExchange/Revision.ts
A revision of an AWS Data Exchange data set — a versioned container of assets. Providers import assets into a revision (via DataExchange jobs) and then finalize it to make the snapshot available to subscribers.
Revision: Creating Revisions
Section titled “Revision: Creating Revisions”import * as AWS from "alchemy/AWS";
const dataSet = yield* AWS.DataExchange.DataSet("Prices", { description: "Daily commodity price snapshots",});
const revision = yield* AWS.DataExchange.Revision("PricesV1", { dataSetId: dataSet.dataSetId, comment: "Initial snapshot",});Revision: Finalizing
Section titled “Revision: Finalizing”Once assets have been imported into the revision (via a DataExchange
import job), flip finalized to publish it. Finalizing an empty revision
fails.
const revision = yield* AWS.DataExchange.Revision("PricesV1", { dataSetId: dataSet.dataSetId, comment: "Initial snapshot", finalized: true,});RevokeRevision
Section titled “RevokeRevision”Source:
src/AWS/DataExchange/RevokeRevision.ts
Runtime binding for dataexchange:RevokeRevision.
Revokes the bound revision from subscribers with a required
revocation comment — the remediation path when bad or sensitive data
was published. The data set and revision ids are injected from the
binding.
Provide the implementation with
Effect.provide(AWS.DataExchange.RevokeRevisionHttp).
RevokeRevision: Managing Assets
Section titled “RevokeRevision: Managing Assets”const revokeRevision = yield* AWS.DataExchange.RevokeRevision(revision);
// runtimeyield* revokeRevision({ RevocationComment: "Published with corrupted price data",});SendApiAsset
Section titled “SendApiAsset”Source:
src/AWS/DataExchange/SendApiAsset.ts
Runtime binding for dataexchange:SendApiAsset.
Invokes an API asset of an entitled API_GATEWAY_API data set — the
Data Exchange data plane proxies the request to the provider’s API
Gateway. The data set id is injected from the binding; pass the
revision and asset ids of the API asset to call.
Provide the implementation with
Effect.provide(AWS.DataExchange.SendApiAssetHttp).
SendApiAsset: Calling API Assets
Section titled “SendApiAsset: Calling API Assets”const sendApiAsset = yield* AWS.DataExchange.SendApiAsset(dataSet);
// runtimeconst response = yield* sendApiAsset({ RevisionId: revisionId, AssetId: assetId, Method: "GET", Path: "/prices",});SendDataSetNotification
Section titled “SendDataSetNotification”Source:
src/AWS/DataExchange/SendDataSetNotification.ts
Runtime binding for dataexchange:SendDataSetNotification.
Sends a provider-generated notification about the bound data set to
its subscribers (DATA_UPDATE, DATA_DELAY, SCHEMA_CHANGE, or
DEPRECATION) — delivered to each subscriber’s default EventBridge
bus. The data set id is injected from the binding.
Provide the implementation with
Effect.provide(AWS.DataExchange.SendDataSetNotificationHttp).
SendDataSetNotification: Notifying Subscribers
Section titled “SendDataSetNotification: Notifying Subscribers”const notify = yield* AWS.DataExchange.SendDataSetNotification(dataSet);
// runtime — after publishing a new revisionyield* notify({ Type: "DATA_UPDATE", Comment: "Daily prices refreshed" });StartJob
Section titled “StartJob”Source:
src/AWS/DataExchange/StartJob.ts
Runtime binding for dataexchange:StartJob.
Starts a created job. Jobs are created in the WAITING state and do
nothing until started. The job runs with the caller’s forwarded
permissions, so this binding also grants dataexchange:CreateAsset
(import jobs) and dataexchange:GetAsset (export jobs); grant the S3
side of the transfer via the matching AWS.S3 bindings.
Provide the implementation with
Effect.provide(AWS.DataExchange.StartJobHttp).
StartJob: Import & Export Jobs
Section titled “StartJob: Import & Export Jobs”const startJob = yield* AWS.DataExchange.StartJob();
// runtimeyield* startJob({ JobId: job.Id! });UpdateAsset
Section titled “UpdateAsset”Source:
src/AWS/DataExchange/UpdateAsset.ts
Runtime binding for dataexchange:UpdateAsset.
Renames an asset of the bound revision (the asset name is the S3 key
used when subscribers export it). The data set and revision ids are
injected from the binding.
Provide the implementation with
Effect.provide(AWS.DataExchange.UpdateAssetHttp).
UpdateAsset: Managing Assets
Section titled “UpdateAsset: Managing Assets”const updateAsset = yield* AWS.DataExchange.UpdateAsset(revision);
// runtimeyield* updateAsset({ AssetId: assetId, Name: "prices/2026-07-14.csv" });