# VpcOriginProps

VPC origin endpoint configuration.

Extends: [VpcOriginOptions](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.VpcOriginOptions.html)
Used as props by: [VpcOrigin](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.VpcOrigin.html)

- 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#L80)
- 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';

declare const vpcOriginEndpoint: cloudfront.VpcOriginEndpoint;
const vpcOriginProps: cloudfront.VpcOriginProps = {
  endpoint: vpcOriginEndpoint,

  // the properties below are optional
  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_endpoint: cloudfront.VpcOriginEndpoint

vpc_origin_props = cloudfront.VpcOriginProps(
    endpoint=vpc_origin_endpoint,

    # the properties below are optional
    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.*;

VpcOriginEndpoint vpcOriginEndpoint;

VpcOriginProps vpcOriginProps = VpcOriginProps.builder()
        .endpoint(vpcOriginEndpoint)

        // the properties below are optional
        .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;

VpcOriginEndpoint vpcOriginEndpoint;

var vpcOriginProps = new VpcOriginProps {
    Endpoint = vpcOriginEndpoint,

    // the properties below are optional
    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"

var vpcOriginEndpoint VpcOriginEndpoint

vpcOriginProps := &VpcOriginProps{
	Endpoint: vpcOriginEndpoint,

	// the properties below are optional
	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

- `endpoint`: [VpcOriginEndpoint](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.VpcOriginEndpoint.html) (required) — The VPC origin endpoint.

- `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`
