# VpcOriginOptions

VPC origin endpoint configuration.

- Source: [`aws-cloudfront/lib/vpc-origin.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-cloudfront/lib/vpc-origin.ts#L49)
- Type last changed: v2.180.0 · 21 Feb 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudfront as cloudfront } from 'aws-cdk-lib';
const vpcOriginOptions: cloudfront.VpcOriginOptions = {
  httpPort: 123,
  httpsPort: 123,
  originSslProtocols: [cloudfront.OriginSslPolicy.SSL_V3],
  protocolPolicy: cloudfront.OriginProtocolPolicy.HTTP_ONLY,
  vpcOriginName: 'vpcOriginName',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cloudfront as cloudfront

vpc_origin_options = cloudfront.VpcOriginOptions(
    http_port=123,
    https_port=123,
    origin_ssl_protocols=[cloudfront.OriginSslPolicy.SSL_V3],
    protocol_policy=cloudfront.OriginProtocolPolicy.HTTP_ONLY,
    vpc_origin_name="vpcOriginName"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudfront.*;

VpcOriginOptions vpcOriginOptions = VpcOriginOptions.builder()
        .httpPort(123)
        .httpsPort(123)
        .originSslProtocols(List.of(OriginSslPolicy.SSL_V3))
        .protocolPolicy(OriginProtocolPolicy.HTTP_ONLY)
        .vpcOriginName("vpcOriginName")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudFront;

var vpcOriginOptions = new VpcOriginOptions {
    HttpPort = 123,
    HttpsPort = 123,
    OriginSslProtocols = new [] { OriginSslPolicy.SSL_V3 },
    ProtocolPolicy = OriginProtocolPolicy.HTTP_ONLY,
    VpcOriginName = "vpcOriginName"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

vpcOriginOptions := &VpcOriginOptions{
	HttpPort: jsii.Number(123),
	HttpsPort: jsii.Number(123),
	OriginSslProtocols: []OriginSslPolicy{
		awscdk.Aws_cloudfront.OriginSslPolicy_SSL_V3,
	},
	ProtocolPolicy: awscdk.*Aws_cloudfront.OriginProtocolPolicy_HTTP_ONLY,
	VpcOriginName: jsii.String("vpcOriginName"),
}
```

## Properties

- `httpPort`: number = 80 — The HTTP port for the CloudFront VPC origin endpoint configuration.

- `httpsPort`: number = 443 — The HTTPS port of the CloudFront VPC origin endpoint configuration.

- `originSslProtocols`: [OriginSslPolicy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.OriginSslPolicy.html)[] = TLSv1.2 — A list that contains allowed SSL/TLS protocols for this distribution.

- `protocolPolicy`: [OriginProtocolPolicy](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.OriginProtocolPolicy.html) — The origin protocol policy for the CloudFront VPC origin endpoint configuration.

  **Default:** OriginProtocolPolicy.MATCH_VIEWER

- `vpcOriginName`: string — The name of the CloudFront VPC origin endpoint configuration.

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