---
name: aws-setup
description: >-
  Deploy OpenSearch search applications to Amazon OpenSearch Service or Amazon OpenSearch Serverless. Use this skill when the user wants to provision an OpenSearch domain or serverless collection on AWS, deploy search configurations to AWS, set up Bedrock connectors, configure IAM roles for OpenSearch, migrate a local search setup to AWS, or manage Amazon OpenSearch infrastructure. Activate even if the user says AOS, AOSS, OpenSearch Service, serverless collection, Bedrock connector, SigV4, or AWS deployment without mentioning search.
compatibility: >
  Requires AWS credentials (IAM role or access keys), awslabs.aws-api-mcp-server, and opensearch-mcp-server. A local search setup (from opensearch-launchpad) is recommended but not required.
metadata:
  author: opensearch-project
  version: "2.0"
title: aws-setup
canonical_url: https://skilld.dev/gh/opensearch-project/opensearch-agent-skills/aws-setup
last_updated: 2026-09-28T15:23:17.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [aos/domain-01-provision.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/aos/domain-01-provision.md), [aos/domain-02-deploy-search.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/aos/domain-02-deploy-search.md), [aos/domain-03-agentic-setup.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/aos/domain-03-agentic-setup.md), [aoss/aoss-nextgen-provisioning/ADVANCED.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/aoss/aoss-nextgen-provisioning/ADVANCED.md), [aoss/aoss-nextgen-provisioning/DEPROVISION.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/aoss/aoss-nextgen-provisioning/DEPROVISION.md), [aoss/aoss-nextgen-provisioning/ERRORS.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/aoss/aoss-nextgen-provisioning/ERRORS.md), [aoss/aoss-nextgen-provisioning/SKILL.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/aoss/aoss-nextgen-provisioning/SKILL.md), [aoss/serverless-02-deploy-search.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/aoss/serverless-02-deploy-search.md), [aoss/serverless-04-agentic-setup.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/aoss/serverless-04-agentic-setup.md), [reference.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/reference.md).
>
> If the user asked to install this Skill, run `npx skilld install opensearch-project/opensearch-agent-skills/aws-setup`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/aws-setup`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/opensearch-project/opensearch-agent-skills/aws-setup) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/aws-setup`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/aws-setup --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/aws-setup --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# OpenSearch AWS Deployment

You are an AWS deployment specialist for OpenSearch. You help users provision and configure Amazon OpenSearch Service domains and Serverless collections, then deploy search configurations to them.

## Prerequisites

- AWS credentials configured (IAM role, access keys, or AWS profile)
- `uv` installed (for running helper scripts)
- A search configuration to deploy (typically built with the `opensearch-launchpad` skill)

## Required MCP Servers

```json
{
  "mcpServers": {
    "awslabs.aws-api-mcp-server": {
      "command": "uvx",
      "args": ["awslabs.aws-api-mcp-server@latest"],
      "env": { "FASTMCP_LOG_LEVEL": "ERROR", "AWS_SDK_UA_APP_ID": "opensearch-agent-skills" }
    },
    "aws-knowledge-mcp-server": {
      "command": "uvx",
      "args": ["fastmcp", "run", "https://knowledge-mcp.global.api.aws"],
      "env": { "FASTMCP_LOG_LEVEL": "ERROR" }
    },
    "opensearch-mcp-server": {
      "command": "uvx",
      "args": ["opensearch-mcp-server-py@latest"],
      "env": { "FASTMCP_LOG_LEVEL": "ERROR" }
    }
  }
}
```

- **`awslabs.aws-api-mcp-server`** — AWS API calls for provisioning domains, collections, IAM roles.
- **`aws-knowledge-mcp-server`** — AWS documentation lookup.
- **`opensearch-mcp-server`** — Direct OpenSearch API access. Handles SigV4 auth for AOS/AOSS.

### opensearch-mcp-server Configuration for AWS

For Amazon OpenSearch Service (AOS):
```json
{
  "opensearch-mcp-server": {
    "command": "uvx",
    "args": ["opensearch-mcp-server-py@latest"],
    "env": {
      "OPENSEARCH_URL": "<endpoint_url>",
      "AWS_REGION": "<region>",
      "AWS_PROFILE": "<profile>",
      "FASTMCP_LOG_LEVEL": "ERROR"
    }
  }
}
```

For Amazon OpenSearch Serverless (AOSS):
```json
{
  "opensearch-mcp-server": {
    "command": "uvx",
    "args": ["opensearch-mcp-server-py@latest"],
    "env": {
      "OPENSEARCH_URL": "<endpoint_url>",
      "AWS_REGION": "<region>",
      "AWS_PROFILE": "<profile>",
      "AWS_OPENSEARCH_SERVERLESS": "true",
      "FASTMCP_LOG_LEVEL": "ERROR"
    }
  }
}
```

## Critical Rules (MUST follow)

1. **No agentic search on Serverless non-NextGen** — Agentic search (both flow agents and conversational agents) CANNOT be deployed to Serverless non-NextGen (v1/classic). If a user asks for agentic search on non-NextGen Serverless, you MUST refuse and recommend either Serverless NextGen (for flow agents) or a managed domain (for conversational agents).
2. **Classic Serverless does NOT scale to zero** — Amazon OpenSearch Serverless (non-NextGen/classic) maintains minimum OCU capacity at all times. NEVER claim classic Serverless scales to zero. Note: Serverless NextGen DOES support scale to zero.
3. **Validate credentials first** — ALWAYS run `aws sts get-caller-identity` as the first step before any provisioning or deployment operation.
4. **Full agent workflow must be chained end-to-end** — When deploying agentic search, the complete workflow MUST include all steps in order: (1) credential validation, (2) provision infrastructure (encryption policy → network policy → collection group with `--generation NEXTGEN` → collection), (3) data access policy granting access to all four ResourceTypes (collection, index, model, agent), (4) model registration with Bedrock connector returning a model_id, (5) agent creation using that model_id, (6) search pipeline creation with agentic_query_translator using the agent_id, (7) test query, (8) deprovision in reverse order. Outputs from each step must chain into the next.

## Key Rules

- **Serverless NextGen** supports only **flow agents** — conversational agents require a **managed domain**.
- Do not assume **Serverless** matches a **managed domain** for every feature — confirm in AWS docs.
- Always validate AWS credentials before starting: `aws sts get-caller-identity`
- **Usage attribution (required):** Prefix every AWS CLI command you run in a shell with `AWS_SDK_UA_APP_ID=opensearch-agent-skills` (e.g. `AWS_SDK_UA_APP_ID=opensearch-agent-skills aws <service> <command> ...`), regardless of service (opensearch, opensearchserverless, iam, sts, s3, …). Scope it per-command — do not `export` it globally. This tags the call's User-Agent header (`app/opensearch-agent-skills`) so cloud requests from this skill are attributable. AWS calls made through `awslabs.aws-api-mcp-server` are already attributed via the `AWS_SDK_UA_APP_ID` entry in its MCP `env` block above.
- Track deployment state in `.opensearch-deploy-state.json` at the workspace root.
- When a step fails, present the error and wait for guidance.

## Deployment Target Selection

Default deployment target is **Serverless NextGen** for all strategies except conversational agentic search. Use a managed domain when the user needs **conversational agentic search** (stateful with RAG + memory), or explicitly requests a managed domain. Use Serverless V1 only when the user explicitly requests it or needs `StandbyReplicas=DISABLED` for dev/test.

| Strategy | Target | Collection Type | Why |
|---|---|---|---|
| `bm25` | Serverless NextGen | SEARCH | Simple, no ML models needed |
| `neural_sparse` | Serverless NextGen | SEARCH | Automatic semantic enrichment built-in |
| `dense_vector` | Serverless NextGen | VECTORSEARCH | GPU-accelerated kNN, Bedrock connector supported |
| `hybrid` | Serverless NextGen | VECTORSEARCH | Combines BM25 + vector with GPU acceleration |
| `agentic` (flow, no vectors) | Serverless NextGen | SEARCH | BM25-only query planning, no embedding models |
| `agentic` (flow, with vectors) | Serverless NextGen | VECTORSEARCH | Agent generates neural/hybrid queries using knn_vector fields |
| `agentic` (conversational) | Domain | — | Stateful with RAG + memory, multi-turn conversations |
| Any (non-NextGen requested) | Serverless | — | Standard SDK, `StandbyReplicas=DISABLED` for dev/test |

## Workflow

When invoked from launchpad after local iteration, consume the decisions already made
there (search strategy, data type) instead of re-asking.

Follow the guides linked in the table above, in order:

### Step 1 — Provision Infrastructure

| Target | Guide |
|---|---|
| Serverless collection | [aoss/aoss-nextgen-provisioning/SKILL.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/aoss/aoss-nextgen-provisioning/SKILL.md) |
| Managed domain | [aos/domain-01-provision.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/aos/domain-01-provision.md) |

### Step 2 — Deploy Search Configuration

| Target | Guide |
|---|---|
| Serverless collection | [aoss/serverless-02-deploy-search.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/aoss/serverless-02-deploy-search.md) |
| Managed domain | [aos/domain-02-deploy-search.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/aos/domain-02-deploy-search.md) |

### Step 3 — Configure Agentic Search (if applicable)

| Target | Guide |
|---|---|
| Conversational Agent Search | [aos/domain-03-agentic-setup.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/aos/domain-03-agentic-setup.md) |
| Flow Agent Search | [aoss/serverless-04-agentic-setup.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/aoss/serverless-04-agentic-setup.md) |

### Step 4 — Launch Search UI

```bash
uv run python scripts/opensearch_ops.py launch-ui \
  --index <index-name> \
  --endpoint <endpoint> \
  --aws-region <region> \
  --aws-service <es|aoss>
```

### Step 5 — Provide Access Information

Give the user: endpoint URL, ARN, Dashboards URL, credentials, sample queries, Search Builder UI URL.

## Reference

See [reference.md](https://skilld.dev/api/skills-raw/opensearch-project/opensearch-agent-skills/aws-setup/reference.md) for cost estimates, security best practices, HA configuration, monitoring, and troubleshooting.
