> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect OpenSearch with Access Key – StackOne Hub

> Link a OpenSearch account in the StackOne Hub using Access Key. End-user guide to authorize the integration and start using OpenSearch actions.

> [!WARNING]
>
> AWS SigV4 is the only accepted auth mode for AWS OpenSearch Serverless collections (service `aoss`) and for AWS OpenSearch Service domains whose access policy references IAM principals. Every request is signed with the caller's AWS credentials and region — the SigV4 service value differs between the two products, so pick the right one below.

## Identify your AWS OpenSearch endpoint and product

There are two AWS-managed products with different endpoint URL shapes, IAM permissions, and SigV4 service values.

**1. Copy the endpoint from the AWS console**

Check the endpoint hostname:

<ul>
  <li>**AWS OpenSearch Service (Managed domain)** — host ends in `.es.amazonaws.com`, e.g. `search-mydomain-abc123.us-east-1.es.amazonaws.com`. Signing service: `es`.</li>
  <li>**AWS OpenSearch Serverless (Collection)** — host ends in `.aoss.amazonaws.com`, e.g. `abcd1234.us-east-1.aoss.amazonaws.com`. Signing service: `aoss`.</li>
  <li>Reference: [Making and signing OpenSearch Service requests](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-signing-service-requests.html).</li>
</ul>

## Create an IAM user for the integration

SigV4 signing requires a long-term IAM user (or STS-issued temporary credentials via role assumption). Create a dedicated IAM user rather than reusing an admin's keys.

**1. Create the IAM user in the AWS Console**

Sign in to the [AWS IAM Console](https://console.aws.amazon.com/iam/) as an administrator, then:

<ul>
  <li>Go to **Users** > **Create user**.</li>
  <li>Enter a **User name** (e.g. `stackone-opensearch`) and click **Next**.</li>
  <li>On **Set permissions**, attach the policy that matches your product (next step below), then click **Next**, review, and click **Create user**.</li>
  <li>Reference: [Create an IAM user in your AWS account](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html).</li>
</ul>

**2. Grant the access policy for your product**

Which IAM policy the user needs depends on whether you're connecting to a Managed domain or a Serverless collection.

<ul>
  <li>**OpenSearch Service (Managed)** — attach `AmazonOpenSearchServiceFullAccess` (broad) or a scoped policy allowing `es:ESHttp*` on your domain ARN. Also ensure the **domain access policy** references the IAM user's ARN — under **Amazon OpenSearch Service** > select domain > **Actions** > **Edit security configuration**, edit the resource-based access policy to allow the principal. Reference: [Fine-grained access control](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/fgac.html).</li>
  <li>**OpenSearch Serverless** — the user needs BOTH IAM permissions (`aoss:APIAccessAll` and `aoss:DashboardsAccessAll` on the collection ARN) AND a **data-access policy** granting collection/index permissions. Without both, requests return `403`. Reference: [Data access control for Amazon OpenSearch Serverless](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-data-access.html).</li>
</ul>

**3. Add the user to a Serverless data-access policy**

Data access policies are separate from IAM permissions and required for every Serverless collection.

<ul>
  <li>Open the [Amazon OpenSearch Service console](https://console.aws.amazon.com/aos/home). In the left nav pane, expand **Serverless** and under **Security** choose **Data access policies**.</li>
  <li>Choose **Create access policy**. Provide a name and description, then a rule name (e.g. `stackone-integration`).</li>
  <li>Choose **Add principals** and select the IAM user's ARN.</li>
  <li>Choose **Grant** and select the collection and index permissions the connector needs (for read-only datasync: `aoss:DescribeCollectionItems`, `aoss:ReadDocument`, `aoss:DescribeIndex`).</li>
  <li>Choose **Create**. Enforcement may lag up to a minute.</li>
</ul>

## Generate an access key pair

SigV4 signing needs an Access Key ID + Secret Access Key. Generate the pair from the user's Security credentials tab.

**1. Create the access key**

In the IAM Console:

<ul>
  <li>Open the user you just created, go to the **Security credentials** tab, and in the **Access keys** panel choose **Create access key**.</li>
  <li>On the **Access key best practices & alternatives** screen, pick a use-case (**Third-party service** is appropriate for StackOne), acknowledge the recommendation checkbox, and click **Next**.</li>
  <li>Add an optional description tag (e.g. `stackone-integration`) and click **Create access key**.</li>
  <li>Copy the **Access key** (Access Key ID, format `AKIAIOSFODNN7EXAMPLE`) and the **Secret access key** (format `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`) immediately — **the secret can only be retrieved at creation time**. If you lose it, delete the key and create a new one.</li>
  <li>Reference: [Manage access keys for IAM users](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html).</li>
</ul>

**2. Configure temporary STS credentials as an alternative**

For higher-security setups, use short-lived STS credentials from an assume-role or federated session.

<ul>
  <li>Call `sts:AssumeRole` (or your identity federation flow) to obtain a temporary access key pair plus a **Session Token**.</li>
  <li>Paste all three values into the corresponding StackOne fields (Access Key ID, Secret Access Key, AWS Session Token) — StackOne signs each request with all three.</li>
  <li>Refresh the credentials before the STS expiry and update the connection — StackOne does not renew STS credentials automatically.</li>
</ul>

## Test the credentials

A signed test call catches missing permissions or wrong signing service before configuring the connector.

**1. Verify with a signed manual health check**

Two convenient options:

<ul>
  <li>**curl** (7.75+): `curl --aws-sigv4 'aws:amz:{region}:{service}' -u '{accessKeyId}:{secretAccessKey}' https://{coreBaseUrl}/_cluster/health` — set `{service}` to `es` or `aoss` to match your product.</li>
  <li>**awscurl**: `awscurl --service {service} --region {region} https://{coreBaseUrl}/_cluster/health`.</li>
  <li>**403 Forbidden** on Serverless — you likely have IAM permissions but not a matching data-access policy. Re-check the data-access policy principals.</li>
  <li>**403 Forbidden** on Managed — the domain access policy does not reference this IAM principal. Edit the domain's access policy to grant `es:ESHttp*` for this user.</li>
  <li>**Signature does not match** — usually a wrong `region` or `awsService` value in the connection fields.</li>
</ul>

## Enter credentials in StackOne Hub

Paste the values below into StackOne Hub to connect the account.

**1. Fill in the connection fields**

Copy each value from the IAM Console and the AWS OpenSearch console.

<ul>
  <li>**OpenSearch Endpoint URL** — the HTTPS endpoint from step 1.</li>
  <li>**AWS Access Key ID** — the Access Key ID from step 3.</li>
  <li>**AWS Secret Access Key** — the Secret Access Key from step 3.</li>
  <li>**AWS Session Token** — only for temporary STS credentials; leave blank for long-term IAM user access keys.</li>
  <li>**AWS Region** — the region hosting the endpoint (e.g. `us-east-1`, `eu-west-2`).</li>
  <li>**AWS Service** — `es` for AWS OpenSearch Service (Managed domain), `aoss` for AWS OpenSearch Serverless. This value is used as the SigV4 signing service and must match your endpoint host suffix.</li>
  <li>**OpenSearch Dashboards URL** — optional. For **Managed** domains, the Dashboards URL is `{coreBaseUrl}/_dashboards`. For **Serverless**, the Dashboards URL is `https://dashboards.{region}.aoss.amazonaws.com/_login/?collectionId={collection-id}` (found on the collection's detail page). Required only for `dashboards_*` actions.</li>
</ul>

## Link the Account

**1. Connect**

<ul>
  <li>Click **Connect**.</li>
  <li>If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider's authorization flow.</li>
  <li>Once authorization is successful, you will see a confirmation popup.</li>
</ul>

**2. Use Actions**

Connect an AI platform to the linked account's actions. See [AI Platforms](https://docs.stackone.com/ai-platforms/overview.md).

Other ways to call actions are listed in [Protocols & SDKs](https://docs.stackone.com/connect/protocols-and-sdks.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.