> **Experimental**
>
> `@aws-cdk/aws-location-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# ApiKeyProps

Properties for an API Key.

Extends: ApiKeyProps
Used as props by: ApiKey

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/api-key.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-location-alpha/lib/api-key.ts#L32)

## Example

```ts
new location.ApiKey(this, 'APIKeyAny', {
  // specify allowed actions
  allowMapsActions: [
    location.AllowMapsAction.GET_STATIC_MAP,
  ],
  allowPlacesActions: [
    location.AllowPlacesAction.GET_PLACE,
  ],
  allowRoutesActions: [
    location.AllowRoutesAction.CALCULATE_ISOLINES,
  ],
});
```

## Properties

- `allowMapsActions`: [AllowMapsAction](/cdk/api/v2/docs/@aws-cdk_aws-location-alpha.AllowMapsAction.html)[] — A list of allowed actions for Maps that an API key resource grants permissions to perform.

  **Default:** no actions for Maps are permitted

- `allowPlacesActions`: [AllowPlacesAction](/cdk/api/v2/docs/@aws-cdk_aws-location-alpha.AllowPlacesAction.html)[] — A list of allowed actions for Places that an API key resource grants permissions to perform.

  **Default:** no actions for Places are permitted

- `allowReferers`: string[] — An optional list of allowed HTTP referers for which requests must originate from.

  **Default:** no Referer

  Requests using this API key from other domains will not be allowed.

- `allowRoutesActions`: [AllowRoutesAction](/cdk/api/v2/docs/@aws-cdk_aws-location-alpha.AllowRoutesAction.html)[] — A list of allowed actions for Routes that an API key resource grants permissions to perform.

  **Default:** no actions for Routes are permitted

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

  **Default:** A name is automatically generated

  Must be between 1 and 100 characters and contain only alphanumeric characters,
  hyphens, periods and underscores.

  Must be a unique API key name.

- `description`: string — A description for the api key.

  **Default:** no description

- `expireTime`: date — The optional timestamp for when the API key resource will expire.

  **Default:** undefined - The API Key never expires

  `expireTime` must be set when `noExpiry` is false or undefined.
  When `expireTime` is not set, `noExpiry` must be `true`.

- `forceDelete`: boolean — `forceDelete` bypasses an API key's expiry conditions and deletes the key.

  **Default:** undefined - not force delete

  Set the parameter true to delete the key or to false to not preemptively delete the API key.

- `forceUpdate`: boolean — The boolean flag to be included for updating ExpireTime or Restrictions details.

  **Default:** undefined - not force update

  Must be set to true to update an API key resource that has been used in the past 7 days.
  False if force update is not preferred.

- `noExpiry`: boolean — Whether the API key should expire.

  **Default:** undefined - The API Key expires at `expireTime`

  Set to `true` when `expireTime` is not set.
  When you set `expireTime`, `noExpiry` must be `false` or `undefined`.
