> **Experimental**
>
> `@aws-cdk/aws-mediaconnect-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# FailoverConfig

Source failover configuration for a flow.

MediaConnect supports two failover modes:
- {@link FailoverConfig.merge} combines two binary-identical sources into a single
  stream, recovering lost packets from the other source (SMPTE 2022-7).
- {@link FailoverConfig.failover} switches between a primary and backup source when
  the active source stops receiving data.

Obtainable from: FailoverConfig.failover, FailoverConfig.merge

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/flow.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/@aws-cdk/aws-mediaconnect-alpha/lib/flow.ts#L297)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as mediaconnect_alpha from '@aws-cdk/aws-mediaconnect-alpha';
const failoverConfig = mediaconnect_alpha.FailoverConfig.failover(/* all optional props */ {
  primarySource: 'primarySource',
  state: mediaconnect_alpha.State.ENABLED,
});
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_mediaconnect_alpha as mediaconnect_alpha

failover_config = mediaconnect_alpha.FailoverConfig.failover(
    primary_source="primarySource",
    state=mediaconnect_alpha.State.ENABLED
)
```

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

FailoverConfig failoverConfig = FailoverConfig.failover(FailoverFailoverOptions.builder()
        .primarySource("primarySource")
        .state(State.ENABLED)
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaConnect.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.MediaConnect.Alpha;

var failoverConfig = FailoverConfig.Failover(new FailoverFailoverOptions {
    PrimarySource = "primarySource",
    State = State.ENABLED
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awsmediaconnectalpha/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/awsmediaconnectalpha"

failoverConfig := mediaconnect_alpha.FailoverConfig_Failover(&FailoverFailoverOptions{
	PrimarySource: jsii.String("primarySource"),
	State: mediaconnect_alpha.State_ENABLED,
})
```

## Methods

- `failover(options?: FailoverFailoverOptions): FailoverConfig // chainable` (static) — Configure switchover-mode failover.

  The flow swaps to the backup source when the
  primary source stops receiving data.

- `merge(options?: MergeFailoverOptions): FailoverConfig // chainable` (static) — Configure merge-mode failover.

  Requires two binary-identical sources.
