# ApiKeyOptions

The options for creating an API Key.

- Source: [`aws-apigatewayv2/lib/websocket/api-key.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-apigatewayv2/lib/websocket/api-key.ts#L36)
- Type last changed: v2.212.0 · 20 Aug 2025

## 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';
const apiKeyOptions: apigatewayv2.ApiKeyOptions = {
  apiKeyName: 'apiKeyName',
  description: 'description',
  value: 'value',
};
```

## Properties

- `apiKeyName`: string — A name for the API key.

  **Default:** automatically generated name

  If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the API key name.

- `description`: string = none — A description of the purpose of the API key.

- `value`: string = none — The value of the API key.

  Must be at least 20 characters long.
