Skip to content

[@vercel/aws] introduce package with createOpenSearch()#16443

Merged
mtoth-vercel merged 2 commits into
mainfrom
mtoth/vercel-aws-opensearch
May 27, 2026
Merged

[@vercel/aws] introduce package with createOpenSearch()#16443
mtoth-vercel merged 2 commits into
mainfrom
mtoth/vercel-aws-opensearch

Conversation

@mtoth-vercel
Copy link
Copy Markdown
Contributor

@mtoth-vercel mtoth-vercel commented May 27, 2026

Why

customers go from this:

import { Client } from '@opensearch-project/opensearch';
import { AwsSigv4Signer } from '@opensearch-project/opensearch/aws';
import { awsCredentialsProvider } from '@vercel/functions/oidc';

const client = new Client({
  ...AwsSigv4Signer({
    region: process.env.OPENSEARCH_REGION!,
    service: 'aoss',
    getCredentials: () =>
      awsCredentialsProvider({ roleArn: process.env.AWS_ROLE_ARN! })(),
  }),
  node: process.env.OPENSEARCH_DASHBOARD_ENDPOINT,
});

to this:

import { createOpenSearch } from '@vercel/aws';
const os = createOpenSearch();

Summary

  • New package @vercel/aws@0.1.0 at packages/aws/.
  • One public export: createOpenSearch(opts?). Defaults endpoint, region, roleArn to OPENSEARCH_DASHBOARD_ENDPOINT / OPENSEARCH_REGION / AWS_ROLE_ARN (the env vars Vercel injects when a Marketplace OpenSearch resource is connected). Explicit options override env. Helpful error names the specific missing var(s).
  • Credentials flow through @vercel/oidc-aws-credentials-provider (existing workspace package) → STS AssumeRoleWithWebIdentity.
  • @opensearch-project/opensearch is a peer dependency (optional) so consumers pin their own version.
  • Scope intentionally narrow for now

Validation

  • pnpm --filter @vercel/aws build:code clean (tsc + esbuild).
  • pnpm --filter @vercel/aws exec vitest run — 4/4 pass: env defaults applied, explicit overrides, full-missing error message, partial-missing names only the missing var.
  • pnpm biome check packages/aws/src packages/aws/package.json clean.

Adds the `@vercel/aws` package with a `createOpenSearch()` factory that
wires up an `@opensearch-project/opensearch` client using the env vars
Vercel injects for a Marketplace OpenSearch Serverless resource
(`OPENSEARCH_DASHBOARD_ENDPOINT`, `OPENSEARCH_REGION`, `AWS_ROLE_ARN`).
Credentials are resolved via Vercel OIDC + AssumeRoleWithWebIdentity,
so customers can go from ~10 lines of AWS SDK setup to two:

    import { createOpenSearch } from '@vercel/aws';
    const os = createOpenSearch();

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 27, 2026

🦋 Changeset detected

Latest commit: bb2988d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@vercel/aws Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

🧪 Unit Test Strategy

Comparing: 0e04bc5bb2988d (view diff)

Strategy: Code changed outside of a package - running all unit tests

⚠️ All unit tests will run because global code changes could impact all packages.

Affected packages - 45 (100%)
  1. @vercel-internals/get-package-json
  2. @vercel/aws
  3. @vercel/backends
  4. @vercel/build-utils
  5. @vercel/cervel
  6. @vercel/cli-auth
  7. @vercel/cli-config
  8. @vercel/cli-exec
  9. @vercel/client
  10. @vercel/config
  11. @vercel/detect-agent
  12. @vercel/edge
  13. @vercel/elysia
  14. @vercel/error-utils
  15. @vercel/express
  16. @vercel/fastify
  17. @vercel/firewall
  18. @vercel/frameworks
  19. @vercel/fs-detectors
  20. @vercel/functions
  21. @vercel/gatsby-plugin-vercel-analytics
  22. @vercel/gatsby-plugin-vercel-builder
  23. @vercel/go
  24. @vercel/h3
  25. @vercel/hono
  26. @vercel/hydrogen
  27. @vercel/koa
  28. @vercel/nestjs
  29. @vercel/next
  30. @vercel/node
  31. @vercel/oidc
  32. @vercel/oidc-aws-credentials-provider
  33. @vercel/python
  34. @vercel/python-analysis
  35. @vercel/redwood
  36. @vercel/related-projects
  37. @vercel/remix-builder
  38. @vercel/routing-utils
  39. @vercel/ruby
  40. @vercel/rust
  41. @vercel/static-build
  42. @vercel/static-config
  43. @vercel/vc-native
  44. examples
  45. vercel

Results

  • Unit tests: All affected packages will run unit tests
  • E2E tests: Running in parallel in this workflow
  • Type checks: All affected packages will run type checks

This comment is automatically generated based on the affected testing strategy

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 27, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​opensearch-project/​opensearch@​3.3.0991009589100

View full report

The initial commit pinned typedoc 0.24.6 + typedoc-plugin-markdown 4.1.2
+ typedoc-plugin-mdn-links 3.2.3, which forced a duplicate older typedoc
resolution into the lockfile. pnpm's peer-dep hoisting then wired the
typedoc 0.28.19 binary to the 4.1.2 plugin in @vercel/firewall (and
others), breaking `pnpm run build` across CI ("modules.map is not a
function" inside typedoc).

Bumps to typedoc 0.28.19 / plugin-markdown 4.11.0 / plugin-mdn-links
5.1.1 — matching every other docs-building package — and adds prettier
3.8.3 so `build:docs` resolves consistently. Also drops a `{@link
ClientOptions}` from the CreateOpenSearchOptions doc comment that
typedoc couldn't resolve and commits the generated docs/ tree, matching
the convention used by sibling packages.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

📦 CLI Tarball Ready

The Vercel CLI tarball for this PR is now available!

Quick Test

You can test this PR's CLI directly by running:

npx https://vercel-pc2lmshwq.vercel.sh/tarballs/vercel.tgz --help

Use in vercel.json

To use this CLI version in your project builds, add to your vercel.json:

{
  "build": {
    "env": {
      "VERCEL_CLI_VERSION": "vercel@https://vercel-pc2lmshwq.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

Python Runtime Wheel

A vercel-runtime wheel was also built for this PR.
To use in your Python project builds, also set this environment variable:

VERCEL_RUNTIME_PYTHON="vercel-runtime @ https://vercel-pc2lmshwq.vercel.sh/tarballs/vercel_runtime-0.15.0.dev1779919228+bb2988d-py3-none-any.whl"

Python Workers Wheel

A vercel-workers wheel was also built for this PR.
To use in your Python project builds, also set this environment variable:

VERCEL_WORKERS_PYTHON="vercel-workers @ https://vercel-pc2lmshwq.vercel.sh/tarballs/vercel_workers-0.1.0.dev1779919228+bb2988d-py3-none-any.whl"

This comment is automatically generated

@mtoth-vercel mtoth-vercel marked this pull request as ready for review May 27, 2026 22:27
@mtoth-vercel mtoth-vercel requested a review from a team as a code owner May 27, 2026 22:27
Comment thread packages/aws/package.json
@mtoth-vercel mtoth-vercel merged commit 11e2a41 into main May 27, 2026
678 of 683 checks passed
@mtoth-vercel mtoth-vercel deleted the mtoth/vercel-aws-opensearch branch May 27, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants