# OriginFailoverConfig

The failover configuration used for Origin Groups, returned in `OriginBindConfig.failoverConfig`.

- 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#L49)

## 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 originFailoverConfig: cloudfront.OriginFailoverConfig = {
  failoverOrigin: origin,

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

# origin: cloudfront.IOrigin

origin_failover_config = cloudfront.OriginFailoverConfig(
    failover_origin=origin,

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

IOrigin origin;

OriginFailoverConfig originFailoverConfig = OriginFailoverConfig.builder()
        .failoverOrigin(origin)

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

IOrigin origin;

var originFailoverConfig = new OriginFailoverConfig {
    FailoverOrigin = origin,

    // the properties below are optional
    StatusCodes = new [] { 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"

var origin IOrigin

originFailoverConfig := &OriginFailoverConfig{
	FailoverOrigin: origin,

	// the properties below are optional
	StatusCodes: []*f64{
		jsii.Number(123),
	},
}
```

## Properties

- `failoverOrigin`: [IOrigin](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.IOrigin.html) (required) — The origin to use as the fallback origin.

- `statusCodes`: number[] — The HTTP status codes of the response that trigger querying the failover Origin.

  **Default:** 500, 502, 503 and 504
