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

A new IVS channel.

Extends: Construct › Resource › Channel
Implements: IChannel, IResource, IEnvironmentAware, IConstruct, IDependable

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/channel.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0-alpha.0/packages/@aws-cdk/aws-ivs-alpha/lib/channel.ts#L257)

## Example

```ts
const myRtmpChannel = new ivs.Channel(this, 'myRtmpChannel', {
  type: ivs.ChannelType.STANDARD,
  insecureIngest: true, // default value is false
});
```

## Initializer

```ts
new Channel(scope: Construct, id: string, props?: ChannelProps)
```

## Construct Props

- `authorized`: boolean = false — Whether the channel is authorized.

  If you wish to make an authorized channel, you will need to ensure that
  a PlaybackKeyPair has been uploaded to your account as this is used to
  validate the signed JWT that is required for authorization

- `channelName`: string — A name for the channel.

  **Default:** Automatically generated name

- `containerFormat`: [ContainerFormat](/cdk/api/v2/docs/@aws-cdk_aws-ivs-alpha.ContainerFormat.html) — Indicates which content-packaging format is used (MPEG-TS or fMP4).

  **Default:** `ContainerFormat.FRAGMENTED_MP4` is automatically set when the `multitrackInputConfiguration` is specified. If not specified, it remains undefined and uses the IVS default setting (TS).

  If `multitrackInputConfiguration` is specified, only fMP4 can be used.
  Otherwise, `containerFormat` may be set to `ContainerFormat.TS` or `ContainerFormat.FRAGMENTED_MP4`.

- `insecureIngest`: boolean = false — Whether the channel allows insecure RTMP ingest.

- `latencyMode`: [LatencyMode](/cdk/api/v2/docs/@aws-cdk_aws-ivs-alpha.LatencyMode.html) = LatencyMode.LOW — Channel latency mode.

- `multitrackInputConfiguration`: [MultitrackInputConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-ivs-alpha.MultitrackInputConfiguration.html) — Object specifying multitrack input configuration. You must specify `multitrackInputConfiguration` if you want to use MultiTrack Video.

  **Default:** undefined - IVS default setting is not use MultiTrack Video.

  `multitrackInputConfiguration` is only supported for `ChannelType.STANDARD`.

- `preset`: [Preset](/cdk/api/v2/docs/@aws-cdk_aws-ivs-alpha.Preset.html) — An optional transcode preset for the channel.

  **Default:** Preset.HIGHER_BANDWIDTH_DELIVERY if channelType is ADVANCED_SD or ADVANCED_HD, none otherwise

  Can be used for ADVANCED_HD and ADVANCED_SD channel types.
  When LOW or STANDARD is used, the preset will be overridden and set to none regardless of the value provided.

- `recordingConfiguration`: [IRecordingConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-ivs-alpha.IRecordingConfiguration.html) — A recording configuration for the channel.

  **Default:** recording is disabled

- `type`: [ChannelType](/cdk/api/v2/docs/@aws-cdk_aws-ivs-alpha.ChannelType.html) = ChannelType.STANDARD — The channel type, which determines the allowable resolution and bitrate.

  If you exceed the allowable resolution or bitrate, the stream will disconnect immediately

## Properties

- `channelArn`: string (required) — The channel ARN.

  For example: arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh

- `channelIngestEndpoint`: string (required) — Channel ingest endpoint, part of the definition of an ingest server, used when you set up streaming software.

  For example: a1b2c3d4e5f6.global-contribute.live-video.net

- `channelPlaybackUrl`: string (required) — Channel playback URL.

  For example:
  https://a1b2c3d4e5f6.us-west-2.playback.live-video.net/api/video/v1/us-west-2.123456789012.channel.abcdEFGH.m3u8

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) (required) — The environment this resource belongs to.

  For resources that are created and managed in a Stack (those created by
  creating new class instances like `new Role()`, `new Bucket()`, etc.), this
  is always the same as the environment of the stack they belong to.

  For referenced resources (those obtained from referencing methods like
  `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
  different than the stack they were imported into.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) (required) — The tree node.

- `PROPERTY_INJECTION_ID`: string (required) (static) — Uniquely identifies this class.

- `stack`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html) (required) — The stack in which this resource is defined.

## Methods

- `addStreamKey(id: string): StreamKey` — Adds a stream key for this IVS Channel.

- `applyCrossStackReferenceStrength(strength: ReferenceStrength): void` — Override the cross-stack reference strength for this resource.

  When set, any cross-stack reference to this resource will use the specified
  mechanism instead of the global default determined by the
  `@aws-cdk/core:defaultCrossStackReferences` context key. This is useful for
  selectively weakening specific references to avoid the "deadly embrace" problem
  without changing the app-wide default.

  **Parameters**

  - `strength` — - The reference strength to use for this resource.

- `applyRemovalPolicy(policy: RemovalPolicy): void` — Apply the given removal policy to this resource.

  The Removal Policy controls what happens to this resource when it stops
  being managed by CloudFormation, either because you've removed it from the
  CDK application or because you've made a change that requires the resource
  to be replaced.

  The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
  account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).

- `fromChannelArn(scope: Construct, id: string, channelArn: string): IChannel` (static) — Import an existing channel.

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  Use this method instead of `instanceof` to properly detect `Construct`
  instances, even when the construct library is symlinked.

  Explanation: in JavaScript, multiple copies of the `constructs` library on
  disk are seen as independent, completely different libraries. As a
  consequence, the class `Construct` in each copy of the `constructs` library
  is seen as a different class, and an instance of one class will not test as
  `instanceof` the other class. `npm install` will not create installations
  like this, but users may manually symlink construct libraries together or
  use a monorepo tool: in those cases, multiple copies of the `constructs`
  library can be accidentally installed, and `instanceof` will behave
  unpredictably. It is safest to avoid using `instanceof`, and using
  this type-testing method instead.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `isOwnedResource(construct: IConstruct): boolean` (static) — Returns true if the construct was created by CDK, and false otherwise.

- `isResource(construct: IConstruct): boolean` (static) — Check whether the given construct is a Resource.

- `toString(): string` — Returns a string representation of this construct.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.
  Use multiple `with()` calls if subsequent mixins should apply to added
  constructs.
