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

Properties for a MediaPackage V2 Origin with OAC.

Extends: [OriginProps](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.OriginProps.html)
Used as props by: [MediaPackageV2Origin](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-mediapackagev2-alpha.MediaPackageV2Origin.html)

- Stability: [Experimental](https://docs.aws.amazon.com/cdk/api/stability.html)
- Source: [`lib/cloudfront-origin.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-mediapackagev2-alpha/lib/cloudfront-origin.ts#L13)

## Example

TypeScript:

```ts
declare const endpoint: OriginEndpoint;
declare const group: ChannelGroup;

new cloudfront.Distribution(this, 'Distribution', {
  defaultBehavior: {
    origin: new MediaPackageV2Origin(endpoint, {
      channelGroup: group,
    }),
  },
});
```

Python:

```python
# endpoint: OriginEndpoint
# group: ChannelGroup

cloudfront.Distribution(self, "Distribution",
    default_behavior=cloudfront.BehaviorOptions(
        origin=MediaPackageV2Origin(endpoint,
            channel_group=group
        )
    )
)
```

Java:

```java
OriginEndpoint endpoint;
ChannelGroup group;

Distribution.Builder.create(this, "Distribution")
        .defaultBehavior(BehaviorOptions.builder()
                .origin(MediaPackageV2Origin.Builder.create(endpoint)
                        .channelGroup(group)
                        .build())
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.MediaPackageV2.Alpha
OriginEndpoint endpoint;
ChannelGroup group;

new Distribution(this, "Distribution", new DistributionProps {
    DefaultBehavior = new BehaviorOptions {
        Origin = new MediaPackageV2Origin(endpoint, new MediaPackageV2OriginProps {
            ChannelGroup = group
        })
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awsmediapackagev2alpha/v2
var endpoint OriginEndpoint
var group ChannelGroup

cloudfront.NewDistribution(this, jsii.String("Distribution"), &DistributionProps{
	DefaultBehavior: &BehaviorOptions{
		Origin: awsmediapackagev2alpha.NewMediaPackageV2Origin(endpoint, &MediaPackageV2OriginProps{
			ChannelGroup: group,
		}),
	},
})
```

## Properties

- `channelGroup`: [IChannelGroup](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-mediapackagev2-alpha.IChannelGroup.html) (required) — The channel group that the origin endpoint belongs to.

  Used to derive the egress domain for the CloudFront origin.

- `connectionAttempts`: number = 3 — The number of times that CloudFront attempts to connect to the origin;

  valid values are 1, 2, or 3 attempts.

- `connectionTimeout`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.seconds(10) — The number of seconds that CloudFront waits when trying to establish a connection to the origin.

  Valid values are 1-10 seconds, inclusive.

- `customHeaders`: { [key: string]: string } = {} — A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.

- `originAccessControl`: [IOriginAccessControlRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_cloudfront.IOriginAccessControlRef.html) — An optional Origin Access Control.

  **Default:** an Origin Access Control will be created automatically.

- `originAccessControlId`: string — The unique identifier of an origin access control for this origin.

  **Default:** no origin access control

- `originId`: string — A unique identifier for the origin.

  **Default:** an originid will be generated for you

  This value must be unique within the distribution.

- `originPath`: string = '/' — An optional path that CloudFront appends to the origin domain name when CloudFront requests content from the origin.

  Must begin, but not end, with '/' (e.g., '/production/images').

- `originShieldEnabled`: boolean = true — Origin Shield is enabled by setting originShieldRegion to a valid region, after this to disable Origin Shield again you must set this flag to false.

- `originShieldRegion`: string — When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.

  **Default:** origin shield not enabled

- `responseCompletionTimeout`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — The time that a request from CloudFront to the origin can stay open and wait for a response.

  **Default:** undefined - AWS CloudFront default is not enforcing a maximum value

  If the complete response isn't received from the origin by this time, CloudFront ends the connection.

  Valid values are 1-3600 seconds, inclusive.
