# KeyGroupProps

Properties for creating a Public Key.

Extends: KeyGroupProps
Used as props by: KeyGroup

- Source: [`aws-cloudfront/lib/key-group.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-cloudfront/lib/key-group.ts#L23)
- Type last changed: v2.224.0 · 13 Nov 2025

## Example

```ts
// Validating signed URLs or signed cookies with Trusted Key Groups

// public key in PEM format
declare const publicKey: string;
const pubKey = new cloudfront.PublicKey(this, 'MyPubKey', {
  encodedKey: publicKey,
});

const keyGroup = new cloudfront.KeyGroup(this, 'MyKeyGroup', {
  items: [
    pubKey,
  ],
});

new cloudfront.Distribution(this, 'Dist', {
  defaultBehavior: {
    origin: new origins.HttpOrigin('www.example.com'),
    trustedKeyGroups: [
      keyGroup,
    ],
  },
});
```

## Properties

- `comment`: string — A comment to describe the key group.

  **Default:** no comment

- `items`: [IPublicKeyRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_cloudfront.IPublicKeyRef.html)[] (required) — A list of public keys to add to the key group.

- `keyGroupName`: string — A name to identify the key group.

  **Default:** generated from the `id`
