AWS.OpenSearch reference
CancelServiceSoftwareUpdate
Section titled “CancelServiceSoftwareUpdate”Source:
src/AWS/OpenSearch/CancelServiceSoftwareUpdate.ts
Runtime binding for the CancelServiceSoftwareUpdate operation (IAM action
es:CancelServiceSoftwareUpdate).
Cancels a scheduled service software update — only while the update is in the PENDING_UPDATE state. Provide the implementation with
Effect.provide(AWS.OpenSearch.CancelServiceSoftwareUpdateHttp).
CancelServiceSoftwareUpdate: Service Software Updates
Section titled “CancelServiceSoftwareUpdate: Service Software Updates”const cancelServiceSoftwareUpdate = yield* OpenSearch.CancelServiceSoftwareUpdate();
const result = yield* cancelServiceSoftwareUpdate({ DomainName: name });// result.ServiceSoftwareOptions?.UpdateStatus → "NOT_ELIGIBLE" | "ELIGIBLE"DescribeDomain
Section titled “DescribeDomain”Source:
src/AWS/OpenSearch/DescribeDomain.ts
Runtime binding for the DescribeDomain operation (IAM action
es:DescribeDomain).
Reads a domain’s current status — endpoint, engine version, creation and processing state — e.g. an operational health check that verifies a domain is active before routing search traffic. Provide the implementation with
Effect.provide(AWS.OpenSearch.DescribeDomainHttp).
DescribeDomain: Monitoring Domains
Section titled “DescribeDomain: Monitoring Domains”const describeDomain = yield* OpenSearch.DescribeDomain();
const result = yield* describeDomain({ DomainName: name });// result.DomainStatus.Processing → falseDescribeDomainAutoTunes
Section titled “DescribeDomainAutoTunes”Source:
src/AWS/OpenSearch/DescribeDomainAutoTunes.ts
Runtime binding for the DescribeDomainAutoTunes operation (IAM action
es:DescribeDomainAutoTunes).
Lists the Auto-Tune optimizations scheduled for a domain — e.g. to surface upcoming JVM heap or queue tuning actions to operators. Provide the implementation with
Effect.provide(AWS.OpenSearch.DescribeDomainAutoTunesHttp).
DescribeDomainAutoTunes: Auto-Tune and Scheduled Actions
Section titled “DescribeDomainAutoTunes: Auto-Tune and Scheduled Actions”const describeDomainAutoTunes = yield* OpenSearch.DescribeDomainAutoTunes();
const result = yield* describeDomainAutoTunes({ DomainName: name });// result.AutoTunes → scheduled optimizationsDescribeDomainChangeProgress
Section titled “DescribeDomainChangeProgress”Source:
src/AWS/OpenSearch/DescribeDomainChangeProgress.ts
Runtime binding for the DescribeDomainChangeProgress operation (IAM action
es:DescribeDomainChangeProgress).
Tracks the stage-by-stage progress of a domain’s in-flight configuration change (blue/green deployment) — e.g. to report how far along a cluster resize is. Provide the implementation with
Effect.provide(AWS.OpenSearch.DescribeDomainChangeProgressHttp).
DescribeDomainChangeProgress: Monitoring Domains
Section titled “DescribeDomainChangeProgress: Monitoring Domains”const describeDomainChangeProgress = yield* OpenSearch.DescribeDomainChangeProgress();
const result = yield* describeDomainChangeProgress({ DomainName: name });// result.ChangeProgressStatus?.Status → "COMPLETED"DescribeDomainConfig
Section titled “DescribeDomainConfig”Source:
src/AWS/OpenSearch/DescribeDomainConfig.ts
Runtime binding for the DescribeDomainConfig operation (IAM action
es:DescribeDomainConfig).
Reads a domain’s full configuration, with per-option status metadata (update date, state, pending values) — the authoritative view of what a blue/green change is converging toward. Provide the implementation with
Effect.provide(AWS.OpenSearch.DescribeDomainConfigHttp).
DescribeDomainConfig: Monitoring Domains
Section titled “DescribeDomainConfig: Monitoring Domains”const describeDomainConfig = yield* OpenSearch.DescribeDomainConfig();
const result = yield* describeDomainConfig({ DomainName: name });// result.DomainConfig.ClusterConfig?.Status.State → "Active"DescribeDomainHealth
Section titled “DescribeDomainHealth”Source:
src/AWS/OpenSearch/DescribeDomainHealth.ts
Runtime binding for the DescribeDomainHealth operation (IAM action
es:DescribeDomainHealth).
Reads a domain’s cluster health — overall status, master eligibility, per-AZ shard and node distribution — for dashboards and automated health checks. Provide the implementation with
Effect.provide(AWS.OpenSearch.DescribeDomainHealthHttp).
DescribeDomainHealth: Monitoring Domains
Section titled “DescribeDomainHealth: Monitoring Domains”const describeDomainHealth = yield* OpenSearch.DescribeDomainHealth();
const result = yield* describeDomainHealth({ DomainName: name });// result.ClusterHealth → "Green"DescribeDomainNodes
Section titled “DescribeDomainNodes”Source:
src/AWS/OpenSearch/DescribeDomainNodes.ts
Runtime binding for the DescribeDomainNodes operation (IAM action
es:DescribeDomainNodes).
Lists a domain’s individual nodes — type (data/master/UltraWarm), Availability Zone, instance type, and storage — for node-level diagnostics. Provide the implementation with
Effect.provide(AWS.OpenSearch.DescribeDomainNodesHttp).
DescribeDomainNodes: Monitoring Domains
Section titled “DescribeDomainNodes: Monitoring Domains”const describeDomainNodes = yield* OpenSearch.DescribeDomainNodes();
const result = yield* describeDomainNodes({ DomainName: name });// result.DomainNodesStatusList → one entry per nodeDescribeDomains
Section titled “DescribeDomains”Source:
src/AWS/OpenSearch/DescribeDomains.ts
Runtime binding for the DescribeDomains operation (IAM action
es:DescribeDomains).
Reads the current status of up to five domains in one call — the batch form of DescribeDomain. Provide the implementation with
Effect.provide(AWS.OpenSearch.DescribeDomainsHttp).
DescribeDomains: Monitoring Domains
Section titled “DescribeDomains: Monitoring Domains”const describeDomains = yield* OpenSearch.DescribeDomains();
const result = yield* describeDomains({ DomainNames: [a, b] });// result.DomainStatusList → one status per domainDomain
Section titled “Domain”Source:
src/AWS/OpenSearch/Domain.ts
An Amazon OpenSearch Service domain — a managed OpenSearch/Elasticsearch cluster with a search/HTTP endpoint.
Domains take roughly 15-25 minutes to provision (and about as long for blue/green configuration changes) and are billed per instance-hour while they exist. Destroy domains you are not using.
Domain: Creating a Domain
Section titled “Domain: Creating a Domain”Minimal Domain
// A single t3.small.search node with 10 GiB of gp3 EBS storage.const domain = yield* Domain("Search", {});Encrypted Domain with Access Policy
const domain = yield* Domain("Search", { engineVersion: "OpenSearch_2.19", clusterConfig: { instanceType: "t3.small.search", instanceCount: 1 }, ebsOptions: { volumeType: "gp3", volumeSize: 10 }, encryptionAtRest: { enabled: true }, nodeToNodeEncryption: true, domainEndpointOptions: { enforceHTTPS: true, tlsSecurityPolicy: "Policy-Min-TLS-1-2-2019-07", }, accessPolicies: { Version: "2012-10-17", Statement: [ { Effect: "Allow", Principal: { AWS: `arn:aws:iam::${accountId}:root` }, Action: ["es:*"], Resource: `arn:aws:es:${region}:${accountId}:domain/*`, }, ], },});Domain: Multi-AZ Cluster
Section titled “Domain: Multi-AZ Cluster”const domain = yield* Domain("Search", { clusterConfig: { instanceType: "r7g.large.search", instanceCount: 2, zoneAwarenessEnabled: true, availabilityZoneCount: 2, },});DomainRead
Section titled “DomainRead”Source:
src/AWS/OpenSearch/DomainRead.ts
Runtime binding for read-only access to an OpenSearch Domain’s
REST data plane (IAM actions es:ESHttpGet and es:ESHttpHead on the
domain and its paths).
Every request is a SigV4-signed HTTP call (service es) against the
domain’s endpoint, made with the host Function’s own credentials — the
domain’s access policy must allow the function’s role. Provide the
implementation with Effect.provide(AWS.OpenSearch.DomainReadHttp).
DomainRead: Searching a Domain
Section titled “DomainRead: Searching a Domain”Search Documents
// init — grants es:ESHttpGet/es:ESHttpHead on the domainconst search = yield* AWS.OpenSearch.DomainRead(domain);
// runtimeconst result = yield* search.search<{ title: string }>({ index: "songs", body: { query: { match: { title: "wind" } } },});const titles = result.hits.hits.map((hit) => hit._source.title);Fetch One Document
const doc = yield* search.getDocument<{ title: string }>("songs", "1");if (doc.found) yield* Effect.log(doc._source?.title);DomainReadWrite
Section titled “DomainReadWrite”Source:
src/AWS/OpenSearch/DomainReadWrite.ts
Runtime binding for full read/write access to an OpenSearch
Domain’s REST data plane (IAM action es:ESHttp* on the domain
and its paths).
Every request is a SigV4-signed HTTP call (service es) against the
domain’s endpoint, made with the host Function’s own credentials — the
domain’s access policy must allow the function’s role. Prefer the
least-privilege DomainRead / DomainWrite bindings when one direction
suffices. Provide the implementation with
Effect.provide(AWS.OpenSearch.DomainReadWriteHttp).
DomainReadWrite: Reading and Writing a Domain
Section titled “DomainReadWrite: Reading and Writing a Domain”Index Then Search
// init — grants es:ESHttp* on the domainconst client = yield* AWS.OpenSearch.DomainReadWrite(domain);
// runtimeyield* client.indexDocument( "songs", { title: "The Wind Cries Mary" }, { id: "1", refresh: true },);const result = yield* client.search({ index: "songs", body: { query: { match: { title: "wind" } } },});Create an Index With Explicit Mappings
yield* client.request("PUT", "songs", { body: { mappings: { properties: { title: { type: "text" } } } },});DomainWrite
Section titled “DomainWrite”Source:
src/AWS/OpenSearch/DomainWrite.ts
Runtime binding for write access to an OpenSearch Domain’s REST
data plane (IAM actions es:ESHttpPut, es:ESHttpPost, es:ESHttpDelete
and es:ESHttpPatch on the domain and its paths).
Every request is a SigV4-signed HTTP call (service es) against the
domain’s endpoint, made with the host Function’s own credentials — the
domain’s access policy must allow the function’s role. Provide the
implementation with Effect.provide(AWS.OpenSearch.DomainWriteHttp).
DomainWrite: Writing Documents
Section titled “DomainWrite: Writing Documents”// init — grants es:ESHttpPut/Post/Delete/Patch on the domainconst writer = yield* AWS.OpenSearch.DomainWrite(domain);
// runtimeyield* writer.indexDocument( "songs", { title: "The Wind Cries Mary" }, { id: "1", refresh: true },);yield* writer.deleteDocument("songs", "1", { refresh: true });GetCompatibleVersions
Section titled “GetCompatibleVersions”Source:
src/AWS/OpenSearch/GetCompatibleVersions.ts
Runtime binding for the GetCompatibleVersions operation (IAM action
es:GetCompatibleVersions).
Maps engine versions to the versions they can be upgraded to — for one domain (pass DomainName) or for every supported version. Provide the implementation with
Effect.provide(AWS.OpenSearch.GetCompatibleVersionsHttp).
GetCompatibleVersions: Engine Upgrades
Section titled “GetCompatibleVersions: Engine Upgrades”const getCompatibleVersions = yield* OpenSearch.GetCompatibleVersions();
const result = yield* getCompatibleVersions({ DomainName: name });// result.CompatibleVersions?.[0]?.TargetVersions → upgrade targetsGetDomainMaintenanceStatus
Section titled “GetDomainMaintenanceStatus”Source:
src/AWS/OpenSearch/GetDomainMaintenanceStatus.ts
Runtime binding for the GetDomainMaintenanceStatus operation (IAM action
es:GetDomainMaintenanceStatus).
Reads the status of one in-progress or completed maintenance action started with StartDomainMaintenance. Provide the implementation with
Effect.provide(AWS.OpenSearch.GetDomainMaintenanceStatusHttp).
GetDomainMaintenanceStatus: Domain Maintenance
Section titled “GetDomainMaintenanceStatus: Domain Maintenance”const getDomainMaintenanceStatus = yield* OpenSearch.GetDomainMaintenanceStatus();
const result = yield* getDomainMaintenanceStatus({ DomainName: name, MaintenanceId: maintenanceId,});// result.Status → "COMPLETED"GetUpgradeHistory
Section titled “GetUpgradeHistory”Source:
src/AWS/OpenSearch/GetUpgradeHistory.ts
Runtime binding for the GetUpgradeHistory operation (IAM action
es:GetUpgradeHistory).
Lists a domain’s past engine-version upgrades and upgrade-eligibility checks, with per-step progress. Provide the implementation with
Effect.provide(AWS.OpenSearch.GetUpgradeHistoryHttp).
GetUpgradeHistory: Engine Upgrades
Section titled “GetUpgradeHistory: Engine Upgrades”const getUpgradeHistory = yield* OpenSearch.GetUpgradeHistory();
const result = yield* getUpgradeHistory({ DomainName: name });// result.UpgradeHistories → past upgradesGetUpgradeStatus
Section titled “GetUpgradeStatus”Source:
src/AWS/OpenSearch/GetUpgradeStatus.ts
Runtime binding for the GetUpgradeStatus operation (IAM action
es:GetUpgradeStatus).
Reads the status of a domain’s most recent engine-version upgrade or upgrade-eligibility check. Provide the implementation with
Effect.provide(AWS.OpenSearch.GetUpgradeStatusHttp).
GetUpgradeStatus: Engine Upgrades
Section titled “GetUpgradeStatus: Engine Upgrades”const getUpgradeStatus = yield* OpenSearch.GetUpgradeStatus();
const result = yield* getUpgradeStatus({ DomainName: name });// result.StepStatus → "SUCCEEDED"ListDomainMaintenances
Section titled “ListDomainMaintenances”Source:
src/AWS/OpenSearch/ListDomainMaintenances.ts
Runtime binding for the ListDomainMaintenances operation (IAM action
es:ListDomainMaintenances).
Lists a domain’s maintenance actions — status and timestamps of past and in-progress reboots and process restarts. Provide the implementation with
Effect.provide(AWS.OpenSearch.ListDomainMaintenancesHttp).
ListDomainMaintenances: Domain Maintenance
Section titled “ListDomainMaintenances: Domain Maintenance”const listDomainMaintenances = yield* OpenSearch.ListDomainMaintenances();
const result = yield* listDomainMaintenances({ DomainName: name });// result.DomainMaintenances → maintenance historyListDomainNames
Section titled “ListDomainNames”Source:
src/AWS/OpenSearch/ListDomainNames.ts
Runtime binding for the ListDomainNames operation (IAM action
es:ListDomainNames).
Lists the names and engine types of all domains the account owns in the active Region — the entry point for fleet-wide monitoring. Provide the implementation with
Effect.provide(AWS.OpenSearch.ListDomainNamesHttp).
ListDomainNames: Monitoring Domains
Section titled “ListDomainNames: Monitoring Domains”const listDomainNames = yield* OpenSearch.ListDomainNames();
const result = yield* listDomainNames();// result.DomainNames → [{ DomainName, EngineType }, …]ListInstanceTypeDetails
Section titled “ListInstanceTypeDetails”Source:
src/AWS/OpenSearch/ListInstanceTypeDetails.ts
Runtime binding for the ListInstanceTypeDetails operation (IAM action
es:ListInstanceTypeDetails).
Lists the instance types (and their capabilities — encryption, warm storage, app logs) supported by an engine version, e.g. to validate a resize before applying it. Provide the implementation with
Effect.provide(AWS.OpenSearch.ListInstanceTypeDetailsHttp).
ListInstanceTypeDetails: Engine Catalog
Section titled “ListInstanceTypeDetails: Engine Catalog”const listInstanceTypeDetails = yield* OpenSearch.ListInstanceTypeDetails();
const result = yield* listInstanceTypeDetails({ EngineVersion: "OpenSearch_2.19",});// result.InstanceTypeDetails → supported instance typesListScheduledActions
Section titled “ListScheduledActions”Source:
src/AWS/OpenSearch/ListScheduledActions.ts
Runtime binding for the ListScheduledActions operation (IAM action
es:ListScheduledActions).
Lists the actions scheduled on a domain — service software updates, blue/green Auto-Tune changes — with their scheduled time and severity. Provide the implementation with
Effect.provide(AWS.OpenSearch.ListScheduledActionsHttp).
ListScheduledActions: Auto-Tune and Scheduled Actions
Section titled “ListScheduledActions: Auto-Tune and Scheduled Actions”const listScheduledActions = yield* OpenSearch.ListScheduledActions();
const result = yield* listScheduledActions({ DomainName: name });// result.ScheduledActions → pending actionsListVersions
Section titled “ListVersions”Source:
src/AWS/OpenSearch/ListVersions.ts
Runtime binding for the ListVersions operation (IAM action
es:ListVersions).
Lists every OpenSearch and Elasticsearch version the service supports — e.g. to validate an upgrade target before calling the upgrade API. Provide the implementation with
Effect.provide(AWS.OpenSearch.ListVersionsHttp).
ListVersions: Engine Catalog
Section titled “ListVersions: Engine Catalog”const listVersions = yield* OpenSearch.ListVersions();
const result = yield* listVersions();// result.Versions → ["OpenSearch_2.19", …]StartDomainMaintenance
Section titled “StartDomainMaintenance”Source:
src/AWS/OpenSearch/StartDomainMaintenance.ts
Runtime binding for the StartDomainMaintenance operation (IAM action
es:StartDomainMaintenance).
Starts a maintenance action on a domain — reboot a node, restart the search process, or restart Dashboards — e.g. remediation triggered by a health alarm. Provide the implementation with
Effect.provide(AWS.OpenSearch.StartDomainMaintenanceHttp).
StartDomainMaintenance: Domain Maintenance
Section titled “StartDomainMaintenance: Domain Maintenance”const startDomainMaintenance = yield* OpenSearch.StartDomainMaintenance();
const result = yield* startDomainMaintenance({ DomainName: name, Action: "REBOOT_NODE", NodeId: nodeId,});// result.MaintenanceId → track with GetDomainMaintenanceStatusStartServiceSoftwareUpdate
Section titled “StartServiceSoftwareUpdate”Source:
src/AWS/OpenSearch/StartServiceSoftwareUpdate.ts
Runtime binding for the StartServiceSoftwareUpdate operation (IAM action
es:StartServiceSoftwareUpdate).
Schedules a service software update for a domain — immediately, at a timestamp, or in the domain’s off-peak window — e.g. rolling out a pending security patch fleet-wide. Provide the implementation with
Effect.provide(AWS.OpenSearch.StartServiceSoftwareUpdateHttp).
StartServiceSoftwareUpdate: Service Software Updates
Section titled “StartServiceSoftwareUpdate: Service Software Updates”const startServiceSoftwareUpdate = yield* OpenSearch.StartServiceSoftwareUpdate();
const result = yield* startServiceSoftwareUpdate({ DomainName: name });// result.ServiceSoftwareOptions?.UpdateStatus → "PENDING_UPDATE"