# CognitoOptions

Configures Amazon OpenSearch Service to use Amazon Cognito authentication for OpenSearch Dashboards.

- Source: [`aws-opensearchservice/lib/domain.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-opensearchservice/lib/domain.ts#L275)
- Type last changed: v2.224.0 · 13 Nov 2025

## Example

```ts
new opensearch.Domain(this, 'Domain', {
  cognitoDashboardsAuth: {
    identityPoolId: 'test-identity-pool-id',
    userPoolId: 'test-user-pool-id',
    role: role,
  },
  version: openSearchVersion,
});
```

## Properties

- `identityPoolId`: string (required) — The Amazon Cognito identity pool ID that you want Amazon OpenSearch Service to use for OpenSearch Dashboards authentication.

- `role`: [IRoleRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_iam.IRoleRef.html) (required) — A role that allows Amazon OpenSearch Service to configure your user pool and identity pool.

  It must have the `AmazonESCognitoAccess` policy attached to it.

- `userPoolId`: string (required) — The Amazon Cognito user pool ID that you want Amazon OpenSearch Service to use for OpenSearch Dashboards authentication.
