# HttpUserPoolAuthorizer

Authorize Http Api routes on whether the requester is registered as part of an AWS Cognito user pool.

Extends: HttpUserPoolAuthorizer
Implements: IHttpRouteAuthorizer

- Source: [`aws-apigatewayv2-authorizers/lib/http/user-pool.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-apigatewayv2-authorizers/lib/http/user-pool.ts#L42)
- Type last changed: v2.162.0 · 10 Oct 2024

## Example

```ts
import * as cognito from 'aws-cdk-lib/aws-cognito';
import { HttpUserPoolAuthorizer } from 'aws-cdk-lib/aws-apigatewayv2-authorizers';
import { HttpUrlIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';

const userPool = new cognito.UserPool(this, 'UserPool');

const authorizer = new HttpUserPoolAuthorizer('BooksAuthorizer', userPool);

const api = new apigwv2.HttpApi(this, 'HttpApi');

api.addRoutes({
  integration: new HttpUrlIntegration('BooksIntegration', 'https://get-books-proxy.example.com'),
  path: '/books',
  authorizer,
});
```

## Initializer

```ts
new HttpUserPoolAuthorizer(id: string, pool: IUserPool, props?: HttpUserPoolAuthorizerProps)
```

## Properties

- `authorizationType`: string — The authorizationType used for UserPool Authorizer.

- `authorizerId`: string — Return the id of the authorizer if it's been constructed.

## Methods

- `bind(options: HttpRouteAuthorizerBindOptions): HttpRouteAuthorizerConfig` — Bind this authorizer to a specified Http route.
