# WebSocketAuthorizerProps

Properties to initialize an instance of `WebSocketAuthorizer`.

Extends: WebSocketAuthorizerProps
Used as props by: WebSocketAuthorizer

- Source: [`aws-apigatewayv2/lib/websocket/authorizer.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-apigatewayv2/lib/websocket/authorizer.ts#L27)
- Type last changed: v2.112.0 · 1 Dec 2023

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigatewayv2 as apigatewayv2 } from 'aws-cdk-lib';

declare const webSocketApi: apigatewayv2.WebSocketApi;
const webSocketAuthorizerProps: apigatewayv2.WebSocketAuthorizerProps = {
  identitySource: ['identitySource'],
  type: apigatewayv2.WebSocketAuthorizerType.LAMBDA,
  webSocketApi: webSocketApi,

  // the properties below are optional
  authorizerName: 'authorizerName',
  authorizerUri: 'authorizerUri',
};
```

## Properties

- `authorizerName`: string — Name of the authorizer.

  **Default:** id of the WebSocketAuthorizer construct.

- `authorizerUri`: string — The authorizer's Uniform Resource Identifier (URI).

  **Default:** required for Request authorizer types

  For REQUEST authorizers, this must be a well-formed Lambda function URI.

- `identitySource`: string[] (required) — The identity source for which authorization is requested.

- `type`: [WebSocketAuthorizerType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.WebSocketAuthorizerType.html) (required) — The type of authorizer.

- `webSocketApi`: [IWebSocketApi](/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.IWebSocketApi.html) (required) — WebSocket Api to attach the authorizer to.
