# HttpVersion

The HTTP version(s) to enable on the distribution.

Note: Setting `HTTP3` enables HTTP 3 only (not HTTP 2). To support both HTTP 2 and HTTP 3, use `HTTP2_AND_3`.

- Source: [`aws-cloudfront/lib/distribution.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-cloudfront/lib/distribution.ts#L929)
- Type last changed: v2.38.0 · 17 Aug 2022

## Example

```ts
// Configure a distribution to use HTTP/2 and HTTP/3
new cloudfront.Distribution(this, 'myDist', {
  defaultBehavior: { origin: new origins.HttpOrigin('www.example.com') },
  httpVersion: cloudfront.HttpVersion.HTTP2_AND_3,
});
```

## Members

| Member | Description |
| --- | --- |
| `HTTP1_1` | HTTP 1.1 only. |
| `HTTP2` | HTTP 2 only. |
| `HTTP2_AND_3` | HTTP 2 and HTTP 3. |
| `HTTP3` | HTTP 3 only (does not include HTTP 2). |

## Referenced by

- [`CloudFrontWebDistributionProps`](/v2/docs/aws-cdk-lib.aws_cloudfront.CloudFrontWebDistributionProps).httpVersion
- [`DistributionProps`](/v2/docs/aws-cdk-lib.aws_cloudfront.DistributionProps).httpVersion
