# LegacyCustomOriginProperty

A custom origin.

A custom origin is any origin that is *not* an Amazon S3 bucket, with one exception. An Amazon S3 bucket that is [configured with static website hosting](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html) *is* a custom origin.

> This property is legacy. We recommend that you use [Origin](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origin.html) instead.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## 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 legacyCustomOriginProperty: cloudfront.CfnDistribution.LegacyCustomOriginProperty = {
  dnsName: 'dnsName',
  originProtocolPolicy: 'originProtocolPolicy',
  originSslProtocols: ['originSslProtocols'],

  // the properties below are optional
  httpPort: 123,
  httpsPort: 123,
};
```

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

legacy_custom_origin_property = cloudfront.CfnDistribution.LegacyCustomOriginProperty(
    dns_name="dnsName",
    origin_protocol_policy="originProtocolPolicy",
    origin_ssl_protocols=["originSslProtocols"],

    # the properties below are optional
    http_port=123,
    https_port=123
)
```

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.*;

LegacyCustomOriginProperty legacyCustomOriginProperty = LegacyCustomOriginProperty.builder()
        .dnsName("dnsName")
        .originProtocolPolicy("originProtocolPolicy")
        .originSslProtocols(List.of("originSslProtocols"))

        // the properties below are optional
        .httpPort(123)
        .httpsPort(123)
        .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 legacyCustomOriginProperty = new LegacyCustomOriginProperty {
    DnsName = "dnsName",
    OriginProtocolPolicy = "originProtocolPolicy",
    OriginSslProtocols = new [] { "originSslProtocols" },

    // the properties below are optional
    HttpPort = 123,
    HttpsPort = 123
};
```

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"

legacyCustomOriginProperty := &LegacyCustomOriginProperty{
	DnsName: jsii.String("dnsName"),
	OriginProtocolPolicy: jsii.String("originProtocolPolicy"),
	OriginSslProtocols: []*string{
		jsii.String("originSslProtocols"),
	},

	// the properties below are optional
	HttpPort: jsii.Number(123),
	HttpsPort: jsii.Number(123),
}
```

## Properties

- `dnsName`: string (required) — The domain name assigned to your CloudFront distribution.

- `httpPort`: number = 80 — The HTTP port that CloudFront uses to connect to the origin.

  Specify the HTTP port that the origin listens on.

- `httpsPort`: number = 443 — The HTTPS port that CloudFront uses to connect to the origin.

  Specify the HTTPS port that the origin listens on.

- `originProtocolPolicy`: string (required) — Specifies the protocol (HTTP or HTTPS) that CloudFront uses to connect to the origin.

- `originSslProtocols`: string[] (required) — The minimum SSL/TLS protocol version that CloudFront uses when communicating with your origin server over HTTPs.

  For more information, see [Minimum Origin SSL Protocol](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesOriginSSLProtocols) in the *Amazon CloudFront Developer Guide* .
