# VpcOriginEndpoint

Represents the VPC origin endpoint.

Obtainable from: VpcOriginEndpoint.applicationLoadBalancer, VpcOriginEndpoint.ec2Instance, VpcOriginEndpoint.networkLoadBalancer

- 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#L117)
- 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';
import { aws_elasticloadbalancingv2 as elbv2 } from 'aws-cdk-lib';

declare const applicationLoadBalancer: elbv2.ApplicationLoadBalancer;
const vpcOriginEndpoint = cloudfront.VpcOriginEndpoint.applicationLoadBalancer(applicationLoadBalancer);
```

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
from aws_cdk import aws_elasticloadbalancingv2 as elbv2

# application_load_balancer: elbv2.ApplicationLoadBalancer

vpc_origin_endpoint = cloudfront.VpcOriginEndpoint.application_load_balancer(application_load_balancer)
```

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.*;
import software.amazon.awscdk.services.elasticloadbalancingv2.*;

ApplicationLoadBalancer applicationLoadBalancer;

VpcOriginEndpoint vpcOriginEndpoint = VpcOriginEndpoint.applicationLoadBalancer(applicationLoadBalancer);
```

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;
using Amazon.CDK.AWS.ElasticLoadBalancingV2;

ApplicationLoadBalancer applicationLoadBalancer;

var vpcOriginEndpoint = VpcOriginEndpoint.ApplicationLoadBalancer(applicationLoadBalancer);
```

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"
import "github.com/aws/aws-cdk-go/awscdk"

var applicationLoadBalancer ApplicationLoadBalancer

vpcOriginEndpoint := awscdk.Aws_cloudfront.VpcOriginEndpoint_ApplicationLoadBalancer(applicationLoadBalancer)
```

## Initializer

TypeScript:

```ts
new VpcOriginEndpoint()
```

Python:

```python
VpcOriginEndpoint()
```

Java:

```java
new VpcOriginEndpoint()
```

C# / .NET:

```csharp
new VpcOriginEndpoint()
```

Golang:

```go
NewVpcOriginEndpoint()
```

## Properties

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

  **Default:** No domain name configured

- `endpointArn`: string — The ARN of the CloudFront VPC origin endpoint configuration.

## Methods

- `applicationLoadBalancer(alb: IApplicationLoadBalancer): VpcOriginEndpoint // chainable` (static) — A VPC origin endpoint from an Application Load Balancer.

- `ec2Instance(instance: IInstance): VpcOriginEndpoint // chainable` (static) — A VPC origin endpoint from an EC2 instance.

- `networkLoadBalancer(nlb: INetworkLoadBalancer): VpcOriginEndpoint // chainable` (static) — A VPC origin endpoint from an Network Load Balancer.
