# KeyValueStoreProps

The properties to create a Key Value Store.

Extends: KeyValueStoreProps
Used as props by: KeyValueStore

- Source: [`aws-cloudfront/lib/key-value-store.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-cloudfront/lib/key-value-store.ts#L170)
- Type last changed: v2.118.0 · 3 Jan 2024

## Example

```ts
const storeAsset = new cloudfront.KeyValueStore(this, 'KeyValueStoreAsset', {
  keyValueStoreName: 'KeyValueStoreAsset',
  source: cloudfront.ImportSource.fromAsset('path-to-data.json'),
});

const storeInline = new cloudfront.KeyValueStore(this, 'KeyValueStoreInline', {
  keyValueStoreName: 'KeyValueStoreInline',
  source: cloudfront.ImportSource.fromInline(JSON.stringify({
    data: [
      {
        key: "key1",
        value: "value1",
      },
      {
        key: "key2",
        value: "value2",
      },
    ],
  })),
});
```

## Properties

- `comment`: string — A comment for the Key Value Store.

  **Default:** No comment will be specified

- `keyValueStoreName`: string — The unique name of the Key Value Store.

  **Default:** A generated name

- `source`: [ImportSource](/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.ImportSource.html) — The import source for the Key Value Store.

  **Default:** No data will be imported to the store

  This will populate the initial items in the Key Value Store. The
  source data must be in a valid JSON format.
