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

Configuration parameters for an AWS Elemental MediaPackage V2 Origin Endpoint.

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

## Example

TypeScript:

```ts
declare const stack: Stack;

// Create a channel group
const group = new ChannelGroup(stack, 'MyChannelGroup', {
  channelGroupName: 'my-channel-group',
});

// Add a channel using the factory method
const channel = group.addChannel('MyChannel', {
  channelName: 'my-channel',
  input: InputConfiguration.cmaf(),
});

// Add an origin endpoint using the factory method
const endpoint = channel.addOriginEndpoint('MyEndpoint', {
  originEndpointName: 'my-endpoint',
  segment: Segment.cmaf(),
  manifests: [Manifest.hls({ manifestName: 'index' })],
});
```

Python:

```python
# stack: Stack

# Create a channel group
group = ChannelGroup(stack, "MyChannelGroup",
    channel_group_name="my-channel-group"
)

# Add a channel using the factory method
channel = group.add_channel("MyChannel",
    channel_name="my-channel",
    input=InputConfiguration.cmaf()
)

# Add an origin endpoint using the factory method
endpoint = channel.add_origin_endpoint("MyEndpoint",
    origin_endpoint_name="my-endpoint",
    segment=Segment.cmaf(),
    manifests=[Manifest.hls(manifest_name="index")]
)
```

Java:

```java
Stack stack;

// Create a channel group
ChannelGroup group = ChannelGroup.Builder.create(stack, "MyChannelGroup")
        .channelGroupName("my-channel-group")
        .build();

// Add a channel using the factory method
Channel channel = group.addChannel("MyChannel", ChannelOptions.builder()
        .channelName("my-channel")
        .input(InputConfiguration.cmaf())
        .build());

// Add an origin endpoint using the factory method
OriginEndpoint endpoint = channel.addOriginEndpoint("MyEndpoint", OriginEndpointOptions.builder()
        .originEndpointName("my-endpoint")
        .segment(Segment.cmaf())
        .manifests(List.of(Manifest.hls(HlsManifestConfiguration.builder().manifestName("index").build())))
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaPackageV2.Alpha
Stack stack;

// Create a channel group
var group = new ChannelGroup(stack, "MyChannelGroup", new ChannelGroupProps {
    ChannelGroupName = "my-channel-group"
});

// Add a channel using the factory method
var channel = group.AddChannel("MyChannel", new ChannelOptions {
    ChannelName = "my-channel",
    Input = InputConfiguration.Cmaf()
});

// Add an origin endpoint using the factory method
var endpoint = channel.AddOriginEndpoint("MyEndpoint", new OriginEndpointOptions {
    OriginEndpointName = "my-endpoint",
    Segment = Segment.Cmaf(),
    Manifests = new [] { Manifest.Hls(new HlsManifestConfiguration { ManifestName = "index" }) }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awsmediapackagev2alpha/v2
var stack Stack

// Create a channel group
group := awsmediapackagev2alpha.NewChannelGroup(stack, jsii.String("MyChannelGroup"), &ChannelGroupProps{
	ChannelGroupName: jsii.String("my-channel-group"),
})

// Add a channel using the factory method
channel := group.addChannel(jsii.String("MyChannel"), &ChannelOptions{
	ChannelName: jsii.String("my-channel"),
	Input: awsmediapackagev2alpha.InputConfiguration_Cmaf(),
})

// Add an origin endpoint using the factory method
endpoint := channel.addOriginEndpoint(jsii.String("MyEndpoint"), &OriginEndpointOptions{
	OriginEndpointName: jsii.String("my-endpoint"),
	Segment: awsmediapackagev2alpha.Segment_Cmaf(),
	Manifests: []Manifest{
		awsmediapackagev2alpha.Manifest_Hls(&HlsManifestConfiguration{
			ManifestName: jsii.String("index"),
		}),
	},
})
```

## Properties

- `cdnAuth`: [CdnAuthConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-mediapackagev2-alpha.CdnAuthConfiguration.html) — Provide access to MediaPackage V2 Origin Endpoint via secret header.

  **Default:** undefined - Not configured on endpoint

  Use this when your CDN doesn't support AWS Signature Version 4 (SigV4)
  authentication. For SigV4-based access with Amazon CloudFront, see
  `MediaPackageV2Origin`.

  Setting `cdnAuth` auto-creates the following policy on the OriginEndpoint:

  ```json
  {
    "Version":"2012-10-17",
    "Statement": [
      {
        "Sid": "AllowGetObjectAccessForAuthorizedRequest",
        "Effect": "Allow",
        "Principal": "*",
        "Action": "mediapackagev2:GetObject",
        "Resource": "arn:aws:mediapackagev2:us-east-1:111122223333:channelGroup/channelGroupName/channel/channelName/originEndpoint/originEndpointName",
        "Condition": {
          "Bool": {
            "mediapackagev2:RequestHasMatchingCdnAuthHeader": "true"
          }
        }
      }
    ]
  }
  ```

- `description`: string — The description associated with the origin endpoint.

  **Default:** undefined - No description is added to Origin Endpoint

- `forceEndpointConfigurationConditions`: [EndpointErrorConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-mediapackagev2-alpha.EndpointErrorConfiguration.html)[] — The failover settings for the endpoint.

  **Default:** undefined - No force endpoint configuration is configured

- `manifests`: [Manifest](/cdk/api/v2/docs/@aws-cdk_aws-mediapackagev2-alpha.Manifest.html)[] (required) — Manifests configuration for HLS, Low Latency HLS and DASH.

- `originEndpointName`: string = autogenerated — The name of the origin endpoint associated with the origin endpoint configuration.

- `removalPolicy`: [RemovalPolicy](/cdk/api/v2/docs/aws-cdk-lib.RemovalPolicy.html) = RemovalPolicy.DESTROY — Policy to apply when the origin endpoint is removed from the stack.

  Even though MediaPackage ChannelGroups, Channels and OriginEndpoints are technically stateful,
  their contents are transient and it is common to add and remove these while rearchitecting your application.
  The default is therefore `DESTROY`. Change it to `RETAIN` if the content (in a lookback window) are so
  valuable that accidentally losing it would be unacceptable.

- `segment`: [SegmentConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-mediapackagev2-alpha.SegmentConfiguration.html) (required) — The segment associated with the origin endpoint.

  Inside the segment configuration you can define options such as encryption, SPEKE parameters and other
  general segment configurations.

  Use Segment.ts() or Segment.cmaf() to create the configuration.

- `startoverWindow`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = 900 — The size of the window to specify a window of the live stream that's available for on-demand viewing.

  Viewers can start-over or catch-up on content that falls within the window.

- `tags`: { [key: string]: string } — The tags associated with the origin endpoint.

  **Default:** No tagging
