Skip to content

UpdateTableMetadataLocation

Source: src/AWS/S3Tables/UpdateTableMetadataLocation.ts

Runtime binding for the UpdateTableMetadataLocation operation (IAM action s3tables:UpdateTableMetadataLocation on the table ARN).

Commits a new Iceberg metadata file for the bound Table — the write half of the Iceberg commit protocol: read the current version with GetTableMetadataLocation, write a new metadata file into the table’s warehouse, then commit it here with the observed versionToken. A stale token fails with the typed ConflictException (another writer committed first). Provide the implementation with Effect.provide(AWS.S3Tables.UpdateTableMetadataLocationHttp).

const getTableMetadataLocation =
yield* AWS.S3Tables.GetTableMetadataLocation(table);
const updateTableMetadataLocation =
yield* AWS.S3Tables.UpdateTableMetadataLocation(table);
const { versionToken, warehouseLocation } =
yield* getTableMetadataLocation();
// ... write `${warehouseLocation}/metadata/00001-….metadata.json` ...
yield* updateTableMetadataLocation({
versionToken,
metadataLocation: `${warehouseLocation}/metadata/00001-….metadata.json`,
});