AWS.Glue reference
BatchCreatePartition
Section titled “BatchCreatePartition”Source:
packages/aws/src/Glue/BatchCreatePartition.ts
Runtime binding for glue:BatchCreatePartition.
Registers up to 100 partitions on the bound Table in one call —
the bulk variant of CreatePartition for backfills. Per-partition
failures come back in the response’s Errors list. The database/table
names and catalog id are injected from the binding. Provide the
implementation with Effect.provide(AWS.Glue.BatchCreatePartitionHttp).
BatchCreatePartition: Managing Partitions
Section titled “BatchCreatePartition: Managing Partitions”// initconst batchCreatePartition = yield* AWS.Glue.BatchCreatePartition(table);
// runtimeconst { Errors } = yield* batchCreatePartition({ PartitionInputList: days.map((dt) => ({ Values: [dt] })),});BatchDeletePartition
Section titled “BatchDeletePartition”Source:
packages/aws/src/Glue/BatchDeletePartition.ts
Runtime binding for glue:BatchDeletePartition.
Deletes up to 25 partitions of the bound Table in one call — the
bulk variant of DeletePartition for retention sweeps. Per-partition
failures come back in the response’s Errors list. The database/table
names and catalog id are injected from the binding. Provide the
implementation with Effect.provide(AWS.Glue.BatchDeletePartitionHttp).
BatchDeletePartition: Managing Partitions
Section titled “BatchDeletePartition: Managing Partitions”// initconst batchDeletePartition = yield* AWS.Glue.BatchDeletePartition(table);
// runtimeconst { Errors } = yield* batchDeletePartition({ PartitionsToDelete: expired.map((dt) => ({ Values: [dt] })),});BatchGetPartition
Section titled “BatchGetPartition”Source:
packages/aws/src/Glue/BatchGetPartition.ts
Runtime binding for glue:BatchGetPartition.
Reads up to 1000 partitions of the bound Table by their partition
values in one call — the bulk variant of GetPartition. Values that don’t
resolve come back in UnprocessedKeys. The database/table names and
catalog id are injected from the binding. Provide the implementation with
Effect.provide(AWS.Glue.BatchGetPartitionHttp).
BatchGetPartition: Managing Partitions
Section titled “BatchGetPartition: Managing Partitions”// initconst batchGetPartition = yield* AWS.Glue.BatchGetPartition(table);
// runtimeconst { Partitions } = yield* batchGetPartition({ PartitionsToGet: [{ Values: ["2026-01-01"] }, { Values: ["2026-01-02"] }],});BatchStopJobRun
Section titled “BatchStopJobRun”Source:
packages/aws/src/Glue/BatchStopJobRun.ts
Runtime binding for glue:BatchStopJobRun.
Stops one or more in-flight runs of the bound Job. Per-run
failures come back in the response’s Errors list (the call itself
succeeds), so inspect SuccessfulSubmissions/Errors rather than the
error channel. The job name is injected from the binding. Provide the
implementation with Effect.provide(AWS.Glue.BatchStopJobRunHttp).
BatchStopJobRun: Running Jobs
Section titled “BatchStopJobRun: Running Jobs”// initconst batchStopJobRun = yield* AWS.Glue.BatchStopJobRun(job);
// runtimeconst { SuccessfulSubmissions, Errors } = yield* batchStopJobRun({ JobRunIds: [runId],});BatchUpdatePartition
Section titled “BatchUpdatePartition”Source:
packages/aws/src/Glue/BatchUpdatePartition.ts
Runtime binding for glue:BatchUpdatePartition.
Rewrites up to 100 partitions of the bound Table in one call — the
bulk variant of UpdatePartition. Per-partition failures come back in the
response’s Errors list. The database/table names and catalog id are
injected from the binding. Provide the implementation with
Effect.provide(AWS.Glue.BatchUpdatePartitionHttp).
BatchUpdatePartition: Managing Partitions
Section titled “BatchUpdatePartition: Managing Partitions”// initconst batchUpdatePartition = yield* AWS.Glue.BatchUpdatePartition(table);
// runtimeconst { Errors } = yield* batchUpdatePartition({ Entries: [ { PartitionValueList: ["2026-01-01"], PartitionInput: { Values: ["2026-01-01"], Parameters: { compacted: "true" }, }, }, ],});Connection
Section titled “Connection”Source:
packages/aws/src/Glue/Connection.ts
An AWS Glue connection — stores the connection details (JDBC URL, VPC networking, credentials) that crawlers and jobs use to reach a data store.
Connection: Creating Connections
Section titled “Connection: Creating Connections”import * as AWS from "@alchemy.run/aws";import * as Redacted from "effect/Redacted";
const connection = yield* AWS.Glue.Connection("Warehouse", { connectionType: "JDBC", connectionProperties: { JDBC_CONNECTION_URL: "jdbc:postgresql://db.example.com:5432/warehouse", USERNAME: "glue", PASSWORD: Redacted.make("secret"), }, physicalConnectionRequirements: { subnetId: subnet.subnetId, securityGroupIdList: [securityGroup.groupId], availabilityZone: "us-west-2a", },});Connection: Looking up an existing connection
Section titled “Connection: Looking up an existing connection”Connection.lookup references a connection Alchemy doesn’t manage (created in the
console or by another stack), found by connectionName. It is read during
plan/deploy and never created, updated or deleted.
const warehouse = AWS.Glue.Connection.lookup({ connectionName: "warehouse" });const connectionName = warehouse.connectionName;Crawler
Section titled “Crawler”Source:
packages/aws/src/Glue/Crawler.ts
An AWS Glue crawler — connects to an S3 (or JDBC/DynamoDB/catalog) data
store, infers schemas, and populates the Glue Data Catalog with tables.
Runs are asynchronous: create the crawler, then invoke startCrawler (or
attach a schedule).
Crawler: Creating Crawlers
Section titled “Crawler: Creating Crawlers”S3 Crawler
import * as AWS from "@alchemy.run/aws";
const database = yield* AWS.Glue.Database("Analytics", { databaseName: "analytics",});
const crawler = yield* AWS.Glue.Crawler("EventsCrawler", { role: crawlerRole.roleArn, databaseName: database.databaseName, targets: { s3Targets: [{ path: "s3://my-data-lake/events/" }], },});Scheduled Crawler with Schema Policy
const crawler = yield* AWS.Glue.Crawler("EventsCrawler", { role: crawlerRole.roleArn, databaseName: database.databaseName, targets: { s3Targets: [{ path: "s3://my-data-lake/events/" }] }, schedule: "cron(0 12 * * ? *)", tablePrefix: "raw_", schemaChangePolicy: { updateBehavior: "UPDATE_IN_DATABASE", deleteBehavior: "DEPRECATE_IN_DATABASE", },});Crawler: Looking up an existing crawler
Section titled “Crawler: Looking up an existing crawler”Crawler.lookup references a crawler Alchemy doesn’t manage (created in the
console or by another stack), found by crawlerName. It is read during
plan/deploy and never created, updated or deleted.
const existing = AWS.Glue.Crawler.lookup({ crawlerName: "..." });CreateGlossaryTerm
Section titled “CreateGlossaryTerm”Source:
packages/aws/src/Glue/CreateGlossaryTerm.ts
Runtime binding for the CreateGlossaryTerm operation (IAM action glue:CreateGlossaryTerm):
adds a term to the bound Glossary at runtime, for terms a stack does not declare. A name the glossary already has fails with the typed AlreadyExistsException.
Glossaries and terms have no ARN, so the action is granted on *.
Provide the implementation with
Effect.provide(AWS.Glue.CreateGlossaryTermHttp).
CreateGlossaryTerm: Creating Terms
Section titled “CreateGlossaryTerm: Creating Terms”const createGlossaryTerm = yield* AWS.Glue.CreateGlossaryTerm(glossary);
const { Id } = yield* createGlossaryTerm({ Name: "Overdrawn", ShortDescription: "An account whose balance is below zero.",});CreatePartition
Section titled “CreatePartition”Source:
packages/aws/src/Glue/CreatePartition.ts
Runtime binding for glue:CreatePartition.
Registers a new partition on the bound Table — the write half of
the classic “data landed in S3, register the partition so Athena sees it”
pipeline. Fails with the typed AlreadyExistsException if the partition
is already registered. The database/table names and catalog id are
injected from the binding. Provide the implementation with
Effect.provide(AWS.Glue.CreatePartitionHttp).
CreatePartition: Managing Partitions
Section titled “CreatePartition: Managing Partitions”// initconst createPartition = yield* AWS.Glue.CreatePartition(table);
// runtime — idempotent registrationyield* createPartition({ PartitionInput: { Values: ["2026-01-01"], StorageDescriptor: { Location: "s3://my-data-lake/events/dt=2026-01-01/" }, },}).pipe(Effect.catchTag("AlreadyExistsException", () => Effect.void));Database
Section titled “Database”Source:
packages/aws/src/Glue/Database.ts
An AWS Glue Data Catalog database — the top-level container for Glue tables that Athena, EMR, Redshift Spectrum, and Glue jobs query. Databases are free and instant to create.
Database: Creating Databases
Section titled “Database: Creating Databases”Basic Database
import * as AWS from "@alchemy.run/aws";
const database = yield* AWS.Glue.Database("Analytics", { databaseName: "analytics",});Database with a Default S3 Location
const database = yield* AWS.Glue.Database("Analytics", { databaseName: "analytics", description: "Curated analytics tables", locationUri: "s3://my-data-lake/analytics/", parameters: { classification: "parquet" },});Database: Looking up an existing database
Section titled “Database: Looking up an existing database”Database.lookup references a database Alchemy doesn’t manage (created in the
console or by another stack), found by databaseName. It is read during
plan/deploy and never created, updated or deleted.
const lake = AWS.Glue.Database.lookup({ databaseName: "lake" });
yield* AWS.Glue.Table("Events", { databaseName: lake.databaseName,});DeleteGlossaryTerm
Section titled “DeleteGlossaryTerm”Source:
packages/aws/src/Glue/DeleteGlossaryTerm.ts
Runtime binding for the DeleteGlossaryTerm operation (IAM action glue:DeleteGlossaryTerm):
deletes one term by its id. Deleting a term that is gone succeeds. Use it for terms made at runtime: a term a stack declares is made again on the next deploy.
Glossaries and terms have no ARN, so the action is granted on *.
Provide the implementation with
Effect.provide(AWS.Glue.DeleteGlossaryTermHttp).
DeleteGlossaryTerm: Deleting a Term
Section titled “DeleteGlossaryTerm: Deleting a Term”const deleteGlossaryTerm = yield* AWS.Glue.DeleteGlossaryTerm(glossary);
yield* deleteGlossaryTerm({ Identifier: termId });DeletePartition
Section titled “DeletePartition”Source:
packages/aws/src/Glue/DeletePartition.ts
Runtime binding for glue:DeletePartition.
Deregisters one partition of the bound Table by its partition
values (the underlying data is untouched). Fails with the typed
EntityNotFoundException when the partition is already gone. The
database/table names and catalog id are injected from the binding.
Provide the implementation with
Effect.provide(AWS.Glue.DeletePartitionHttp).
DeletePartition: Managing Partitions
Section titled “DeletePartition: Managing Partitions”// initconst deletePartition = yield* AWS.Glue.DeletePartition(table);
// runtime — idempotent removalyield* deletePartition({ PartitionValues: ["2026-01-01"] }).pipe( Effect.catchTag("EntityNotFoundException", () => Effect.void),);GetCrawler
Section titled “GetCrawler”Source:
packages/aws/src/Glue/GetCrawler.ts
Runtime binding for glue:GetCrawler.
Reads the bound Crawler’s metadata — most usefully its State
(READY, RUNNING, STOPPING) and LastCrawl outcome — so runtime code
can poll a crawl started with StartCrawler to completion. The crawler
name is injected from the binding. Provide the implementation with
Effect.provide(AWS.Glue.GetCrawlerHttp).
GetCrawler: Running Crawlers
Section titled “GetCrawler: Running Crawlers”// initconst startCrawler = yield* AWS.Glue.StartCrawler(crawler);const getCrawler = yield* AWS.Glue.GetCrawler(crawler);
// runtimeyield* startCrawler();const done = yield* getCrawler().pipe( Effect.repeat({ schedule: Schedule.spaced("10 seconds"), until: (r) => r.Crawler?.State === "READY", times: 8, }),);GetGlossary
Section titled “GetGlossary”Source:
packages/aws/src/Glue/GetGlossary.ts
Runtime binding for the GetGlossary operation (IAM action glue:GetGlossary):
reads the bound Glossary: its name, description and when it was created and last changed.
Glossaries and terms have no ARN, so the action is granted on *.
Provide the implementation with
Effect.provide(AWS.Glue.GetGlossaryHttp).
GetGlossary: Reading a Glossary
Section titled “GetGlossary: Reading a Glossary”const getGlossary = yield* AWS.Glue.GetGlossary(glossary);
const { Name, Description } = yield* getGlossary();GetGlossaryTerm
Section titled “GetGlossaryTerm”Source:
packages/aws/src/Glue/GetGlossaryTerm.ts
Runtime binding for the GetGlossaryTerm operation (IAM action glue:GetGlossaryTerm):
reads one term by its id: its name and both descriptions. The id is a GlossaryTerm’s termId, or one ListGlossaryTerms or CreateGlossaryTerm returned. A term that is gone fails with the typed EntityNotFoundException.
Glossaries and terms have no ARN, so the action is granted on *.
Provide the implementation with
Effect.provide(AWS.Glue.GetGlossaryTermHttp).
GetGlossaryTerm: Reading a Term
Section titled “GetGlossaryTerm: Reading a Term”const getGlossaryTerm = yield* AWS.Glue.GetGlossaryTerm(glossary);
const { Name, LongDescription } = yield* getGlossaryTerm({ Identifier: termId });GetJobBookmark
Section titled “GetJobBookmark”Source:
packages/aws/src/Glue/GetJobBookmark.ts
Runtime binding for glue:GetJobBookmark.
Reads the bound Job’s bookmark entry — the incremental-processing
checkpoint Glue keeps when a job runs with --job-bookmark-option job-bookmark-enable. Fails with the typed EntityNotFoundException when
the job has never recorded a bookmark. The job name is injected from the
binding. Provide the implementation with
Effect.provide(AWS.Glue.GetJobBookmarkHttp).
GetJobBookmark: Job Bookmarks
Section titled “GetJobBookmark: Job Bookmarks”// initconst getJobBookmark = yield* AWS.Glue.GetJobBookmark(job);
// runtimeconst entry = yield* getJobBookmark().pipe( Effect.map((r) => r.JobBookmarkEntry), Effect.catchTag("EntityNotFoundException", () => Effect.succeed(undefined), ),);GetJobRun
Section titled “GetJobRun”Source:
packages/aws/src/Glue/GetJobRun.ts
Runtime binding for glue:GetJobRun.
Reads the metadata of a single run of the bound Job — its
JobRunState (RUNNING, SUCCEEDED, FAILED, TIMEOUT, …), timings,
and error message — so a function can poll a run it started to a terminal
state. The job name is injected from the binding. Provide the
implementation with Effect.provide(AWS.Glue.GetJobRunHttp).
GetJobRun: Running Jobs
Section titled “GetJobRun: Running Jobs”// initconst getJobRun = yield* AWS.Glue.GetJobRun(job);
// runtimeconst { JobRun } = yield* getJobRun({ RunId: runId });if (JobRun?.JobRunState === "FAILED") { yield* Effect.logError(JobRun.ErrorMessage ?? "run failed");}GetJobRuns
Section titled “GetJobRuns”Source:
packages/aws/src/Glue/GetJobRuns.ts
Runtime binding for glue:GetJobRuns.
Lists the runs of the bound Job (newest first, paginated via
NextToken), so a function can report run history or find in-flight runs.
The job name is injected from the binding. Provide the implementation with
Effect.provide(AWS.Glue.GetJobRunsHttp).
GetJobRuns: Running Jobs
Section titled “GetJobRuns: Running Jobs”// initconst getJobRuns = yield* AWS.Glue.GetJobRuns(job);
// runtimeconst { JobRuns } = yield* getJobRuns({ MaxResults: 10 });const running = (JobRuns ?? []).filter( (run) => run.JobRunState === "RUNNING",);GetPartition
Section titled “GetPartition”Source:
packages/aws/src/Glue/GetPartition.ts
Runtime binding for glue:GetPartition.
Reads a single partition of the bound Table by its partition
values. Fails with the typed EntityNotFoundException when the partition
does not exist. The database/table names and catalog id are injected from
the binding. Provide the implementation with
Effect.provide(AWS.Glue.GetPartitionHttp).
GetPartition: Managing Partitions
Section titled “GetPartition: Managing Partitions”// initconst getPartition = yield* AWS.Glue.GetPartition(table);
// runtimeconst { Partition } = yield* getPartition({ PartitionValues: ["2026-01-01"],});GetPartitions
Section titled “GetPartitions”Source:
packages/aws/src/Glue/GetPartitions.ts
Runtime binding for glue:GetPartitions.
Lists the bound Table’s partitions, optionally filtered with a
partition-predicate Expression (e.g. dt >= '2026-01-01') and paginated
via NextToken. The database/table names and catalog id are injected from
the binding. Provide the implementation with
Effect.provide(AWS.Glue.GetPartitionsHttp).
GetPartitions: Managing Partitions
Section titled “GetPartitions: Managing Partitions”// initconst getPartitions = yield* AWS.Glue.GetPartitions(table);
// runtimeconst { Partitions } = yield* getPartitions({ Expression: "dt >= '2026-01-01'",});GetTable
Section titled “GetTable”Source:
packages/aws/src/Glue/GetTable.ts
Runtime binding for glue:GetTable.
Reads the bound Table’s full catalog definition — columns, storage
descriptor, partition keys, and parameters — so a function can introspect
the schema it is writing against. The database/table names and catalog id
are injected from the binding. Provide the implementation with
Effect.provide(AWS.Glue.GetTableHttp).
GetTable: Reading the Data Catalog
Section titled “GetTable: Reading the Data Catalog”// initconst getTable = yield* AWS.Glue.GetTable(table);
// runtimeconst { Table } = yield* getTable();const columns = Table?.StorageDescriptor?.Columns ?? [];GetTables
Section titled “GetTables”Source:
packages/aws/src/Glue/GetTables.ts
Runtime binding for glue:GetTables.
Lists the table definitions of the bound Database (optionally
filtered by an Expression pattern, paginated via NextToken) — runtime
schema discovery over the Data Catalog. The database name and catalog id
are injected from the binding. Provide the implementation with
Effect.provide(AWS.Glue.GetTablesHttp).
GetTables: Reading the Data Catalog
Section titled “GetTables: Reading the Data Catalog”// initconst getTables = yield* AWS.Glue.GetTables(database);
// runtimeconst { TableList } = yield* getTables({ Expression: "events_*" });const names = (TableList ?? []).map((t) => t.Name);Glossary
Section titled “Glossary”Source:
packages/aws/src/Glue/Glossary.ts
A business glossary in the AWS Glue Data Catalog: a named set of terms that say what the words used across your tables mean. Terms are found by Glue’s catalog search and can be attached to tables and columns.
A glossary carries no tags, so one that already exists under the same
name is never taken over unless the deploy runs with --adopt.
Glossary: Creating Glossaries
Section titled “Glossary: Creating Glossaries”import * as AWS from "@alchemy.run/aws";
const glossary = yield* AWS.Glue.Glossary("Bank", { description: "What the bank's words mean.",});
yield* AWS.Glue.GlossaryTerm("Overdrawn", { glossary: glossary.glossaryId, shortDescription: "An account whose balance is below zero.",});Glossary: Looking up an existing glossary
Section titled “Glossary: Looking up an existing glossary”Glossary.lookup references a glossary Alchemy doesn’t manage, found by
name. It is read during plan/deploy and never created, updated or
deleted.
const glossary = AWS.Glue.Glossary.lookup({ name: "company" });
yield* AWS.Glue.GlossaryTerm("Overdrawn", { glossary: glossary.glossaryId,});GlossaryTerm
Section titled “GlossaryTerm”Source:
packages/aws/src/Glue/GlossaryTerm.ts
A term of a business glossary in the AWS Glue Data Catalog: a word and what it means. Glue’s catalog search finds terms, and a term can be attached to the tables and columns it describes.
A term carries no tags, so one that already exists under the same name
in the glossary is never taken over unless the deploy runs with
--adopt.
GlossaryTerm: Creating Terms
Section titled “GlossaryTerm: Creating Terms”A term with both descriptions
yield* AWS.Glue.GlossaryTerm("Overdrawn", { glossary: glossary.glossaryId, shortDescription: "An account whose balance is below zero.", longDescription: "Class: Overdrawn\n EquivalentTo: Account and (Balance some integer[< 0])",});A term named differently from its logical id
yield* AWS.Glue.GlossaryTerm("HeldBy", { glossary: glossary.glossaryId, name: "Held by", shortDescription: "The customer who holds an account.",});GlossaryTerm: Looking up an existing term
Section titled “GlossaryTerm: Looking up an existing term”GlossaryTerm.lookup references a term Alchemy doesn’t manage, found by
its glossary and name. It is read during plan/deploy and never created,
updated or deleted.
const overdrawn = AWS.Glue.GlossaryTerm.lookup({ glossary: glossary.glossaryId, name: "Overdrawn",});Source:
packages/aws/src/Glue/Job.ts
An AWS Glue job — a Spark (glueetl), Python shell (pythonshell), or
streaming ETL job definition (script in S3 + IAM role + arguments). The
definition lifecycle is instant and free; job runs are billed and are
started via startJobRun.
Job: Creating Jobs
Section titled “Job: Creating Jobs”Python Shell Job
import * as AWS from "@alchemy.run/aws";
const job = yield* AWS.Glue.Job("Etl", { role: jobRole.roleArn, command: { name: "pythonshell", pythonVersion: "3.9", scriptLocation: "s3://my-bucket/scripts/etl.py", }, maxCapacity: 0.0625, glueVersion: "3.0", defaultArguments: { "--job-language": "python" },});Spark ETL Job
const job = yield* AWS.Glue.Job("SparkEtl", { role: jobRole.roleArn, command: { name: "glueetl", scriptLocation: "s3://my-bucket/scripts/spark.py", }, glueVersion: "4.0", workerType: "G.1X", numberOfWorkers: 2, timeout: "1 hour",});Job: Running Jobs
Section titled “Job: Running Jobs”// initconst startJobRun = yield* AWS.Glue.StartJobRun(job);
// runtimeconst { JobRunId } = yield* startJobRun({});Job: Looking up an existing job
Section titled “Job: Looking up an existing job”Job.lookup references a job Alchemy doesn’t manage (created in the
console or by another stack), found by jobName. It is read during
plan/deploy and never created, updated or deleted.
const existing = AWS.Glue.Job.lookup({ jobName: "..." });ListGlossaryTerms
Section titled “ListGlossaryTerms”Source:
packages/aws/src/Glue/ListGlossaryTerms.ts
Runtime binding for the ListGlossaryTerms operation (IAM action glue:ListGlossaryTerms):
lists the terms of the bound Glossary, a page at a time, each with its id, name and short description.
Glossaries and terms have no ARN, so the action is granted on *.
Provide the implementation with
Effect.provide(AWS.Glue.ListGlossaryTermsHttp).
ListGlossaryTerms: Listing Terms
Section titled “ListGlossaryTerms: Listing Terms”const listGlossaryTerms = yield* AWS.Glue.ListGlossaryTerms(glossary);
const { Items } = yield* listGlossaryTerms();ResetJobBookmark
Section titled “ResetJobBookmark”Source:
packages/aws/src/Glue/ResetJobBookmark.ts
Runtime binding for glue:ResetJobBookmark.
Resets the bound Job’s bookmark entry so the next bookmarked run
reprocesses the source data from the beginning — the standard remediation
after a bad deploy consumed data incorrectly. The job name is injected
from the binding. Provide the implementation with
Effect.provide(AWS.Glue.ResetJobBookmarkHttp).
ResetJobBookmark: Job Bookmarks
Section titled “ResetJobBookmark: Job Bookmarks”// initconst resetJobBookmark = yield* AWS.Glue.ResetJobBookmark(job);
// runtimeyield* resetJobBookmark();StartCrawler
Section titled “StartCrawler”Source:
packages/aws/src/Glue/StartCrawler.ts
Runtime binding for glue:StartCrawler.
Starts a crawl of the bound Crawler on demand — the standard way
to refresh the Data Catalog right after new data lands. Fails with the
typed CrawlerRunningException if a crawl is already in progress. The
crawler name is injected from the binding. Provide the implementation with
Effect.provide(AWS.Glue.StartCrawlerHttp).
StartCrawler: Running Crawlers
Section titled “StartCrawler: Running Crawlers”// initconst startCrawler = yield* AWS.Glue.StartCrawler(crawler);
// runtime — tolerate an already-running crawlyield* startCrawler().pipe( Effect.catchTag("CrawlerRunningException", () => Effect.void),);StartJobRun
Section titled “StartJobRun”Source:
packages/aws/src/Glue/StartJobRun.ts
Starts a run of a Glue job definition.
Grants glue:StartJobRun and glue:GetJobRun on the bound job. Returns the
JobRunId; poll getJobRun for the run’s terminal state (SUCCEEDED,
FAILED, TIMEOUT, …).
StartJobRun: Running Jobs
Section titled “StartJobRun: Running Jobs”Provide the StartJobRunHttp implementation layer on the Function effect
(.pipe(Effect.provide(AWS.Glue.StartJobRunHttp))), bind the job in the
init phase, then start runs at runtime.
// initconst startJobRun = yield* AWS.Glue.StartJobRun(job);
return { fetch: Effect.gen(function* () { // runtime const { JobRunId } = yield* startJobRun({ Arguments: { "--input": "s3://my-bucket/input/" }, }); return HttpServerResponse.json({ JobRunId }); }),};StopCrawler
Section titled “StopCrawler”Source:
packages/aws/src/Glue/StopCrawler.ts
Runtime binding for glue:StopCrawler.
Stops an in-progress crawl of the bound Crawler. Fails with the
typed CrawlerNotRunningException when idle and
CrawlerStoppingException when a stop is already underway. The crawler
name is injected from the binding. Provide the implementation with
Effect.provide(AWS.Glue.StopCrawlerHttp).
StopCrawler: Running Crawlers
Section titled “StopCrawler: Running Crawlers”// initconst stopCrawler = yield* AWS.Glue.StopCrawler(crawler);
// runtime — tolerate an idle or already-stopping crawleryield* stopCrawler().pipe( Effect.catchTag( ["CrawlerNotRunningException", "CrawlerStoppingException"], () => Effect.void, ),);Source:
packages/aws/src/Glue/Table.ts
An AWS Glue Data Catalog table — a schema (columns), storage location, and SerDe over data in S3 (or another store). This is the unit Athena, Redshift Spectrum, and EMR query; it is the analytics foundation of a Glue database.
Table: Creating Tables
Section titled “Table: Creating Tables”import * as AWS from "@alchemy.run/aws";
const database = yield* AWS.Glue.Database("Analytics", { databaseName: "analytics",});
const events = yield* AWS.Glue.Table("Events", { databaseName: database.databaseName, tableName: "events", tableType: "EXTERNAL_TABLE", storageDescriptor: { location: "s3://my-data-lake/events/", inputFormat: "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat", outputFormat: "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat", serdeInfo: { serializationLibrary: "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe", }, columns: [ { name: "id", type: "string" }, { name: "amount", type: "double" }, ], }, partitionKeys: [{ name: "dt", type: "string" }], parameters: { classification: "parquet" },});Table: Looking up an existing table
Section titled “Table: Looking up an existing table”Table.lookup references a table Alchemy doesn’t manage (created in the
console or by another stack), found by databaseName and tableName. It is read during
plan/deploy and never created, updated or deleted.
const events = AWS.Glue.Table.lookup({ databaseName: "lake", tableName: "events" });const tableArn = events.tableArn;UpdateGlossary
Section titled “UpdateGlossary”Source:
packages/aws/src/Glue/UpdateGlossary.ts
Runtime binding for the UpdateGlossary operation (IAM action glue:UpdateGlossary):
renames the bound Glossary or changes its description. A stack that also sets them puts its own values back on the next deploy.
Glossaries and terms have no ARN, so the action is granted on *.
Provide the implementation with
Effect.provide(AWS.Glue.UpdateGlossaryHttp).
UpdateGlossary: Updating a Glossary
Section titled “UpdateGlossary: Updating a Glossary”const updateGlossary = yield* AWS.Glue.UpdateGlossary(glossary);
yield* updateGlossary({ Description: "What the bank's words mean." });UpdateGlossaryTerm
Section titled “UpdateGlossaryTerm”Source:
packages/aws/src/Glue/UpdateGlossaryTerm.ts
Runtime binding for the UpdateGlossaryTerm operation (IAM action glue:UpdateGlossaryTerm):
renames one term, by its id, or changes its descriptions. A member left out keeps its value.
Glossaries and terms have no ARN, so the action is granted on *.
Provide the implementation with
Effect.provide(AWS.Glue.UpdateGlossaryTermHttp).
UpdateGlossaryTerm: Updating a Term
Section titled “UpdateGlossaryTerm: Updating a Term”const updateGlossaryTerm = yield* AWS.Glue.UpdateGlossaryTerm(glossary);
yield* updateGlossaryTerm({ Identifier: termId, ShortDescription: "Below zero." });UpdatePartition
Section titled “UpdatePartition”Source:
packages/aws/src/Glue/UpdatePartition.ts
Runtime binding for glue:UpdatePartition.
Replaces the definition of one partition of the bound Table —
PartitionValueList addresses the existing partition and
PartitionInput is its new definition (location, parameters, schema).
The database/table names and catalog id are injected from the binding.
Provide the implementation with
Effect.provide(AWS.Glue.UpdatePartitionHttp).
UpdatePartition: Managing Partitions
Section titled “UpdatePartition: Managing Partitions”// initconst updatePartition = yield* AWS.Glue.UpdatePartition(table);
// runtimeyield* updatePartition({ PartitionValueList: ["2026-01-01"], PartitionInput: { Values: ["2026-01-01"], StorageDescriptor: { Location: "s3://my-data-lake/v2/dt=2026-01-01/" }, },});