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

Defines an AWS Elemental MediaConnect Router Input.

Extends: Construct › Resource › RouterInput
Implements: IRouterInput, IResource, IEnvironmentAware, IRouterInputRef, IConstruct, IDependable

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

## Example

```ts
declare const stack: Stack;
declare const mediaLiveChannel: medialive.IChannel;

const input = new RouterInput(stack, 'ChannelInput', {
  routerInputName: 'channel-input',
  maximumBitrate: Bitrate.mbps(20),
  routingScope: RoutingScope.REGIONAL,
  tier: RouterInputTier.INPUT_20,
  configuration: RouterInputConfiguration.mediaLiveChannel({
    channel: mediaLiveChannel,
    outputName: 'router-ts',
    pipeline: MediaLivePipeline.PIPELINE_0,
  }),
});
```

## Initializer

```ts
new RouterInput(scope: Construct, id: string, props: RouterInputProps)
```

## Construct Props

- `configuration`: [RouterInputConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-mediaconnect-alpha.RouterInputConfiguration.html) (required) — Configuration for the Router Input (standard, failover, merge, or MediaConnect flow).

- `maintenanceConfiguration`: [MaintenanceConfiguration](/cdk/api/v2/docs/@aws-cdk_aws-mediaconnect-alpha.MaintenanceConfiguration.html) — Maintenance window configuration.

  **Default:** Default maintenance window will be used

- `maximumBitrate`: [Bitrate](/cdk/api/v2/docs/aws-cdk-lib.Bitrate.html) (required) — The maximum bitrate for the router input.

  Must fall within the limits of the selected `tier`.

- `regionName`: string — The AWS Region where the router input is located.

  **Default:** Defaults to the same region as stack

- `routerInputName`: string — Name of the Router Input.

  **Default:** Generated automatically

- `routingScope`: [RoutingScope](/cdk/api/v2/docs/@aws-cdk_aws-mediaconnect-alpha.RoutingScope.html) (required) — Indicates whether the router input is configured for Regional or global routing.

- `tags`: { [key: string]: string } — Tags to add to the Router Input.

  **Default:** No tagging

- `tier`: [RouterInputTier](/cdk/api/v2/docs/@aws-cdk_aws-mediaconnect-alpha.RouterInputTier.html) = RouterInputTier.INPUT_20 — Tier for this input.

  The tier determines the capacity limits, performance characteristics,
  and associated costs; `maximumBitrate` must fall within its limits.

- `transitEncryption`: [TransitEncryption](/cdk/api/v2/docs/@aws-cdk_aws-mediaconnect-alpha.TransitEncryption.html) — Transit encryption configuration using AWS Secrets Manager.

  **Default:** Automatic encryption will be configured

  When provided without a role, a scoped IAM role is automatically created with read
  access to the secret.

## Properties

- `createdAt`: string — The timestamp when the router input was created.

- `endpoints`: [RouterInputEndpoint](/cdk/api/v2/docs/@aws-cdk_aws-mediaconnect-alpha.RouterInputEndpoint.html)[] (required) — The ingest endpoints (URL + port) where the router input listens.

  Returns one entry for standard protocol-based variants (RTP, RIST, SRT listener),
  and one entry per source for failover and merge configurations built from those
  protocols. For example a failover RTP input will return:

  ```
  [
    { url: 'rtp://203.0.113.10:5000', port: 5000 },
    { url: 'rtp://203.0.113.10:5001', port: 5001 },
  ]
  ```

  Accessing this on SRT caller (where the router input dials out to a remote
  source), MediaConnect Flow, MediaLive Channel, or imported inputs throws — those
  variants do not expose host:port pairs the input listens on.

- `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.

- `grants`: [RouterInputGrants](/cdk/api/v2/docs/@aws-cdk_aws-mediaconnect-alpha.RouterInputGrants.html) (required) — Collection of grant methods for this router input.

- `ipAddress`: string (required) — The IP address of the router input.

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

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

- `routerInputArn`: string (required) — The Amazon Resource Name (ARN) of the router input.

- `routerInputId`: string (required) — The unique identifier of the router input.

- `routerInputRef`: [RouterInputReference](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_mediaconnect.RouterInputReference.html) (required) — A reference to this Router Input resource.

  Required by the auto-generated IRouterInputRef interface.

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

- `transitEncryptionSecret`: [ISecret](/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.ISecret.html) — The Secrets Manager secret containing the transit encryption passphrase.

  Only available when the Router Input was created with explicit
  `transitEncryption` configuration. Not available for
  automatic encryption or imported inputs.

- `updatedAt`: string — The timestamp when the router input was last updated.

## Methods

- `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`).

- `fromRouterInputArn(scope: Construct, id: string, routerInputArn: string): IRouterInput` (static) — Import an existing Router Input from its ARN.

  Use `fromRouterInputAttributes()` instead if you need to expose `routerInputId`
  or `ipAddress` on the imported construct.

  **Parameters**

  - `scope` — The parent construct.
  - `id` — The construct id.
  - `routerInputArn` — The ARN of the Router Input.

  **Returns:** A Router Input construct

- `fromRouterInputAttributes(scope: Construct, id: string, attrs: RouterInputAttributes): IRouterInput` (static) — Import an existing Router Input from its attributes.

  Provide `routerInputId` and/or `ipAddress` when importing an input that was deployed
  externally — otherwise accessing those properties on the imported construct will throw.

  **Parameters**

  - `scope` — The parent construct.
  - `id` — The construct id.
  - `attrs` — The Router Input attributes.

  **Returns:** A Router Input construct

- `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.

- `metric(metricName: string, props?: MetricOptions): Metric` — Create a CloudWatch metric for this router input.

- `metricBitrate(props?: MetricOptions): Metric` — Metric for the bitrate of the router input's payload.

- `metricConnected(props?: MetricOptions): Metric` — Metric for the router input connection state (1 connected, 0 disconnected).

  Applies to SRT sources only.

- `metricContinuityCounterErrors(props?: MetricOptions): Metric` — Metric for continuity counter errors in the transport stream.

- `metricFailoverSwitches(props?: MetricOptions): Metric` — Metric for the number of times the router input has switched sources in Failover mode.

- `metricLatency(props?: MetricOptions): Metric` — Metric for the recovery latency of the input stream.

  Applies to RIST, SRT, and RTP-FEC.

- `metricNotRecoveredPackets(props?: MetricOptions): Metric` — Metric for packets lost in transit that were not recovered by error correction.

- `metricTotalPackets(props?: MetricOptions): Metric` — Metric for the total number of packets received by the router input.

- `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.
