# OriginBindConfig

The struct returned from `IOrigin.bind`.

Returned by: [IOrigin.bind](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.IOrigin.html#bind)

- Source: [`aws-cloudfront/lib/origin.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-cloudfront/lib/origin.ts#L62)
- Type last changed: v2.178.0 · 6 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 origin: cloudfront.IOrigin;
const originBindConfig: cloudfront.OriginBindConfig = {
  failoverConfig: {
    failoverOrigin: origin,

    // the properties below are optional
    statusCodes: [123],
  },
  originProperty: {
    domainName: 'domainName',
    id: 'id',

    // the properties below are optional
    connectionAttempts: 123,
    connectionTimeout: 123,
    customOriginConfig: {
      originProtocolPolicy: 'originProtocolPolicy',

      // the properties below are optional
      httpPort: 123,
      httpsPort: 123,
      ipAddressType: 'ipAddressType',
      originKeepaliveTimeout: 123,
      originMtlsConfig: {
        clientCertificateArn: 'clientCertificateArn',
      },
      originReadTimeout: 123,
      originSslProtocols: ['originSslProtocols'],
    },
    originAccessControlId: 'originAccessControlId',
    originCustomHeaders: [{
      headerName: 'headerName',
      headerValue: 'headerValue',
    }],
    originPath: 'originPath',
    originShield: {
      enabled: false,
      originShieldRegion: 'originShieldRegion',
    },
    responseCompletionTimeout: 123,
    s3OriginConfig: {
      originAccessIdentity: 'originAccessIdentity',
      originReadTimeout: 123,
    },
    vpcOriginConfig: {
      vpcOriginId: 'vpcOriginId',

      // the properties below are optional
      originKeepaliveTimeout: 123,
      originReadTimeout: 123,
      ownerAccountId: 'ownerAccountId',
    },
  },
  selectionCriteria: cloudfront.OriginSelectionCriteria.DEFAULT,
};
```

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

# origin: cloudfront.IOrigin

origin_bind_config = cloudfront.OriginBindConfig(
    failover_config=cloudfront.OriginFailoverConfig(
        failover_origin=origin,

        # the properties below are optional
        status_codes=[123]
    ),
    origin_property=cloudfront.CfnDistribution.OriginProperty(
        domain_name="domainName",
        id="id",

        # the properties below are optional
        connection_attempts=123,
        connection_timeout=123,
        custom_origin_config=cloudfront.CfnDistribution.CustomOriginConfigProperty(
            origin_protocol_policy="originProtocolPolicy",

            # the properties below are optional
            http_port=123,
            https_port=123,
            ip_address_type="ipAddressType",
            origin_keepalive_timeout=123,
            origin_mtls_config=cloudfront.CfnDistribution.OriginMtlsConfigProperty(
                client_certificate_arn="clientCertificateArn"
            ),
            origin_read_timeout=123,
            origin_ssl_protocols=["originSslProtocols"]
        ),
        origin_access_control_id="originAccessControlId",
        origin_custom_headers=[cloudfront.CfnDistribution.OriginCustomHeaderProperty(
            header_name="headerName",
            header_value="headerValue"
        )],
        origin_path="originPath",
        origin_shield=cloudfront.CfnDistribution.OriginShieldProperty(
            enabled=False,
            origin_shield_region="originShieldRegion"
        ),
        response_completion_timeout=123,
        s3_origin_config=cloudfront.CfnDistribution.S3OriginConfigProperty(
            origin_access_identity="originAccessIdentity",
            origin_read_timeout=123
        ),
        vpc_origin_config=cloudfront.CfnDistribution.VpcOriginConfigProperty(
            vpc_origin_id="vpcOriginId",

            # the properties below are optional
            origin_keepalive_timeout=123,
            origin_read_timeout=123,
            owner_account_id="ownerAccountId"
        )
    ),
    selection_criteria=cloudfront.OriginSelectionCriteria.DEFAULT
)
```

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

IOrigin origin;

OriginBindConfig originBindConfig = OriginBindConfig.builder()
        .failoverConfig(OriginFailoverConfig.builder()
                .failoverOrigin(origin)

                // the properties below are optional
                .statusCodes(List.of(123))
                .build())
        .originProperty(OriginProperty.builder()
                .domainName("domainName")
                .id("id")

                // the properties below are optional
                .connectionAttempts(123)
                .connectionTimeout(123)
                .customOriginConfig(CustomOriginConfigProperty.builder()
                        .originProtocolPolicy("originProtocolPolicy")

                        // the properties below are optional
                        .httpPort(123)
                        .httpsPort(123)
                        .ipAddressType("ipAddressType")
                        .originKeepaliveTimeout(123)
                        .originMtlsConfig(OriginMtlsConfigProperty.builder()
                                .clientCertificateArn("clientCertificateArn")
                                .build())
                        .originReadTimeout(123)
                        .originSslProtocols(List.of("originSslProtocols"))
                        .build())
                .originAccessControlId("originAccessControlId")
                .originCustomHeaders(List.of(OriginCustomHeaderProperty.builder()
                        .headerName("headerName")
                        .headerValue("headerValue")
                        .build()))
                .originPath("originPath")
                .originShield(OriginShieldProperty.builder()
                        .enabled(false)
                        .originShieldRegion("originShieldRegion")
                        .build())
                .responseCompletionTimeout(123)
                .s3OriginConfig(S3OriginConfigProperty.builder()
                        .originAccessIdentity("originAccessIdentity")
                        .originReadTimeout(123)
                        .build())
                .vpcOriginConfig(VpcOriginConfigProperty.builder()
                        .vpcOriginId("vpcOriginId")

                        // the properties below are optional
                        .originKeepaliveTimeout(123)
                        .originReadTimeout(123)
                        .ownerAccountId("ownerAccountId")
                        .build())
                .build())
        .selectionCriteria(OriginSelectionCriteria.DEFAULT)
        .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;

IOrigin origin;

var originBindConfig = new OriginBindConfig {
    FailoverConfig = new OriginFailoverConfig {
        FailoverOrigin = origin,

        // the properties below are optional
        StatusCodes = new [] { 123 }
    },
    OriginProperty = new OriginProperty {
        DomainName = "domainName",
        Id = "id",

        // the properties below are optional
        ConnectionAttempts = 123,
        ConnectionTimeout = 123,
        CustomOriginConfig = new CustomOriginConfigProperty {
            OriginProtocolPolicy = "originProtocolPolicy",

            // the properties below are optional
            HttpPort = 123,
            HttpsPort = 123,
            IpAddressType = "ipAddressType",
            OriginKeepaliveTimeout = 123,
            OriginMtlsConfig = new OriginMtlsConfigProperty {
                ClientCertificateArn = "clientCertificateArn"
            },
            OriginReadTimeout = 123,
            OriginSslProtocols = new [] { "originSslProtocols" }
        },
        OriginAccessControlId = "originAccessControlId",
        OriginCustomHeaders = new [] { new OriginCustomHeaderProperty {
            HeaderName = "headerName",
            HeaderValue = "headerValue"
        } },
        OriginPath = "originPath",
        OriginShield = new OriginShieldProperty {
            Enabled = false,
            OriginShieldRegion = "originShieldRegion"
        },
        ResponseCompletionTimeout = 123,
        S3OriginConfig = new S3OriginConfigProperty {
            OriginAccessIdentity = "originAccessIdentity",
            OriginReadTimeout = 123
        },
        VpcOriginConfig = new VpcOriginConfigProperty {
            VpcOriginId = "vpcOriginId",

            // the properties below are optional
            OriginKeepaliveTimeout = 123,
            OriginReadTimeout = 123,
            OwnerAccountId = "ownerAccountId"
        }
    },
    SelectionCriteria = OriginSelectionCriteria.DEFAULT
};
```

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 origin IOrigin

originBindConfig := &OriginBindConfig{
	FailoverConfig: &OriginFailoverConfig{
		FailoverOrigin: origin,

		// the properties below are optional
		StatusCodes: []*f64{
			jsii.Number(123),
		},
	},
	OriginProperty: &OriginProperty{
		DomainName: jsii.String("domainName"),
		Id: jsii.String("id"),

		// the properties below are optional
		ConnectionAttempts: jsii.Number(123),
		ConnectionTimeout: jsii.Number(123),
		CustomOriginConfig: &CustomOriginConfigProperty{
			OriginProtocolPolicy: jsii.String("originProtocolPolicy"),

			// the properties below are optional
			HttpPort: jsii.Number(123),
			HttpsPort: jsii.Number(123),
			IpAddressType: jsii.String("ipAddressType"),
			OriginKeepaliveTimeout: jsii.Number(123),
			OriginMtlsConfig: &OriginMtlsConfigProperty{
				ClientCertificateArn: jsii.String("clientCertificateArn"),
			},
			OriginReadTimeout: jsii.Number(123),
			OriginSslProtocols: []*string{
				jsii.String("originSslProtocols"),
			},
		},
		OriginAccessControlId: jsii.String("originAccessControlId"),
		OriginCustomHeaders: []interface{}{
			&OriginCustomHeaderProperty{
				HeaderName: jsii.String("headerName"),
				HeaderValue: jsii.String("headerValue"),
			},
		},
		OriginPath: jsii.String("originPath"),
		OriginShield: &OriginShieldProperty{
			Enabled: jsii.Boolean(false),
			OriginShieldRegion: jsii.String("originShieldRegion"),
		},
		ResponseCompletionTimeout: jsii.Number(123),
		S3OriginConfig: &S3OriginConfigProperty{
			OriginAccessIdentity: jsii.String("originAccessIdentity"),
			OriginReadTimeout: jsii.Number(123),
		},
		VpcOriginConfig: &VpcOriginConfigProperty{
			VpcOriginId: jsii.String("vpcOriginId"),

			// the properties below are optional
			OriginKeepaliveTimeout: jsii.Number(123),
			OriginReadTimeout: jsii.Number(123),
			OwnerAccountId: jsii.String("ownerAccountId"),
		},
	},
	SelectionCriteria: awscdk.Aws_cloudfront.OriginSelectionCriteria_DEFAULT,
}
```

## Properties

- `failoverConfig`: [OriginFailoverConfig](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.OriginFailoverConfig.html) — The failover configuration for this Origin.

  **Default:** nothing is returned

- `originProperty`: [CfnDistribution.OriginProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.CfnDistribution.OriginProperty.html) — The CloudFormation OriginProperty configuration for this Origin.

  **Default:** nothing is returned

- `selectionCriteria`: [OriginSelectionCriteria](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.OriginSelectionCriteria.html) = OriginSelectionCriteria.DEFAULT — The selection criteria for how your origins are selected.
