Skip to content

Resource: awsMedialiveChannel

Terraform resource for managing an AWS MediaLive Channel.

Example Usage

Basic Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.medialiveChannel.MedialiveChannel(this, "example", {
  channelClass: "STANDARD",
  destinations: [
    {
      id: "destination",
      settings: [
        {
          url: "s3://${aws_s3_bucket.main.id}/test1",
        },
        {
          url: "s3://${aws_s3_bucket.main2.id}/test2",
        },
      ],
    },
  ],
  encoderSettings: {
    audioDescriptions: [
      {
        audioSelectorName: "example audio selector",
        name: "audio-selector",
      },
    ],
    outputGroups: [
      {
        outputGroupSettings: {
          archiveGroupSettings: [
            {
              destination: {
                destinationRefId: "destination",
              },
            },
          ],
        },
        outputs: [
          {
            audioDescriptionNames: ["audio-selector"],
            outputName: "example-name",
            outputSettings: {
              archiveOutputSettings: {
                containerSettings: {
                  m2TsSettings: {
                    audioBufferModel: "ATSC",
                    bufferModel: "MULTIPLEX",
                    rateMode: "CBR",
                  },
                },
                extension: "m2ts",
                nameModifier: "_1",
              },
            },
            videoDescriptionName: "example-video",
          },
        ],
      },
    ],
    timecodeConfig: {
      source: "EMBEDDED",
    },
    videoDescriptions: [
      {
        name: "example-video",
      },
    ],
  },
  inputAttachments: [
    {
      inputAttachmentName: "example-input",
      inputId: "${aws_medialive_input.example.id}",
    },
  ],
  inputSpecification: {
    codec: "AVC",
    inputResolution: "HD",
    maximumBitrate: "MAX_20_MBPS",
  },
  name: "example-channel",
  roleArn: "${aws_iam_role.example.arn}",
});

Argument Reference

The following arguments are required:

  • channelClass - (Required) Concise argument description.
  • destinations - (Required) Destinations for channel. See Destinations for more details.
  • encoderSettings - (Required) Encoder settings. See Encoder Settings for more details.
  • inputSpecification - (Required) Specification of network and file inputs for the channel.
  • name - (Required) Name of the Channel.

The following arguments are optional:

  • cdiInputSpecification - (Optional) Specification of CDI inputs for this channel. See CDI Input Specification for more details.
  • inputAttachments - (Optional) Input attachments for the channel. See Input Attachments for more details.
  • logLevel - (Optional) The log level to write to Cloudwatch logs.
  • maintenance - (Optional) Maintenance settings for this channel. See Maintenance for more details.
  • roleArn - (Optional) Concise argument description.
  • startChannel - (Optional) Whether to start/stop channel. Default: false
  • tags - (Optional) A map of tags to assign to the channel. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
  • vpc - (Optional) Settings for the VPC outputs.

CDI Input Specification

  • resolution - (Required) - Maximum CDI input resolution.

Destinations

  • id - (Required) User-specified id. Ths is used in an output group or an output.
  • mediaPackageSettings - (Optional) Destination settings for a MediaPackage output; one destination for both encoders. See Media Package Settings for more details.
  • multiplexSettings - (Optional) Destination settings for a Multiplex output; one destination for both encoders. See Multiplex Settings for more details.
  • settings - (Optional) Destination settings for a standard output; one destination for each redundant encoder. See Settings for more details.

Encoder Settings

  • audioDescriptions - (Required) Audio descriptions for the channel. See Audio Descriptions for more details.
  • outputGroups - (Required) Output groups for the channel. See Output Groups for more details.
  • timecodeConfig - (Required) Contains settings used to acquire and adjust timecode information from inputs. See Timecode Config for more details.
  • videoDescriptions - (Required) Video Descriptions. See Video Descriptions for more details.
  • availBlanking - (Optional) Settings for ad avail blanking. See Avail Blanking for more details.

Input Attachments

  • inputAttachmentName - (Optional) User-specified name for the attachment.
  • inputId - (Required) The ID of the input.
  • inputSettings - (Optional) Settings of an input. See Input Settings for more details

Input Settings

  • audioSelectors - (Optional) Used to select the audio stream to decode for inputs that have multiple. See Audio Selectors for more details.
  • captionSelectors - (Optional) Used to select the caption input to use for inputs that have multiple available. See Caption Selectors for more details.
  • deblockFilter - (Optional) Enable or disable the deblock filter when filtering.
  • denoiseFilter - (Optional) Enable or disable the denoise filter when filtering.
  • filterStrength - (Optional) Adjusts the magnitude of filtering from 1 (minimal) to 5 (strongest).
  • inputFilter - (Optional) Turns on the filter for the input.
  • networkInputSettings - (Optional) Input settings. See Network Input Settings for more details.
  • scte35Pid - (Optional) PID from which to read SCTE-35 messages.
  • smpte2038DataPreference - (Optional) Specifies whether to extract applicable ancillary data from a SMPTE-2038 source in the input.
  • sourceEndBehavior - (Optional) Loop input if it is a file.

Audio Selectors

  • name - (Required) The name of the audio selector.

Caption Selectors

  • name - (Optional) The name of the caption selector.
  • languageCode - (Optional) When specified this field indicates the three letter language code of the caption track to extract from the source.

Network Input Settings

  • hlsInputSettings - (Optional) Specifies HLS input settings when the uri is for a HLS manifest. See HLS Input Settings for more details.
  • serverValidation - (Optional) Check HTTPS server certificates.

HLS Input Settings

  • bandwidth - (Optional) The bitrate is specified in bits per second, as in an HLS manifest.
  • bufferSegments - (Optional) Buffer segments.
  • retries - (Optional) The number of consecutive times that attempts to read a manifest or segment must fail before the input is considered unavailable.
  • retryInterval - (Optional) The number of seconds between retries when an attempt to read a manifest or segment fails.
  • scte35SourceType - (Optional) Identifies the source for the SCTE-35 messages that MediaLive will ingest.

Maintenance

  • maintenanceDay - (Optional) The day of the week to use for maintenance.
  • maintenanceStartTime - (Optional) The hour maintenance will start.

Media Package Settings

  • channelId - (Required) ID of the channel in MediaPackage that is the destination for this output group.

Multiplex Settings

  • multiplexId - (Required) The ID of the Multiplex that the encoder is providing output to.
  • programName - (Optional) The program name of the Multiplex program that the encoder is providing output to.

Settings

  • passwordParam - (Optional) Key used to extract the password from EC2 Parameter store.
  • streamName - (Optional) Stream name RTMP destinations (URLs of type rtmp://)
  • url - (Optional) A URL specifying a destination.
  • username - (Optional) Username for destination.

Audio Descriptions

  • audioSelectorName - (Required) The name of the audio selector used as the source for this AudioDescription.
  • name - (Required) The name of this audio description.
  • audioNormalizationSettings - (Optional) Advanced audio normalization settings. See Audio Normalization Settings for more details.
  • audioType - (Optional) Applies only if audioTypeControl is useConfigured. The values for audioType are defined in ISO-IEC 13818-1.
  • audioTypeControl - (Optional) Determined how audio type is determined.
  • audioWatermarkSettings - (Optional) Settings to configure one or more solutions that insert audio watermarks in the audio encode. See Audio Watermark Settings for more details.
  • codecSettings - (Optional) Audio codec settings. See Audio Codec Settings for more details.

Audio Normalization Settings

  • algorithm - (Optional) Audio normalization algorithm to use. itu17701 conforms to the CALM Act specification, itu17702 to the EBU R-128 specification.
  • algorithmControl - (Optional) Algorithm control for the audio description.
  • targetLkfs - (Optional) Target LKFS (loudness) to adjust volume to.

Audio Watermark Settings

  • nielsenWatermarkSettings - (Optional) Settings to configure Nielsen Watermarks in the audio encode. See Nielsen Watermark Settings for more details.

Audio Codec Settings

  • aacSettings - (Optional) Aac Settings. See AAC Settings for more details.
  • ac3Settings - (Optional) Ac3 Settings. See AC3 Settings for more details.
  • eac3AtmosSettings - (Optional) - Eac3 Atmos Settings. See EAC3 Atmos Settings
  • eac3Settings - (Optional) - Eac3 Settings. See EAC3 Settings

AAC Settings

  • bitrate - (Optional) Average bitrate in bits/second.
  • codingMode - (Optional) Mono, Stereo, or 5.1 channel layout.
  • inputType - (Optional) Set to "broadcasterMixedAd" when input contains pre-mixed main audio + AD (narration) as a stereo pair.
  • profile - (Optional) AAC profile.
  • rateControlMode - (Optional) The rate control mode.
  • rawFormat - (Optional) Sets LATM/LOAS AAC output for raw containers.
  • sampleRate - (Optional) Sample rate in Hz.
  • spec - (Optional) Use MPEG-2 AAC audio instead of MPEG-4 AAC audio for raw or MPEG-2 Transport Stream containers.
  • vbrQuality - (Optional) VBR Quality Level - Only used if rateControlMode is VBR.

AC3 Settings

  • bitrate - (Optional) Average bitrate in bits/second.
  • bitstreamMode - (Optional) Specifies the bitstream mode (bsmod) for the emitted AC-3 stream.
  • codingMode - (Optional) Dolby Digital coding mode.
  • dialnorm - (Optional) Sets the dialnorm of the output.
  • drcProfile - (Optional) If set to filmStandard, adds dynamic range compression signaling to the output bitstream as defined in the Dolby Digital specification.
  • lfeFilter - (Optional) When set to enabled, applies a 120Hz lowpass filter to the LFE channel prior to encoding.
  • metadataControl - (Optional) Metadata control.

EAC3 Atmos Settings

  • bitrate - (Optional) Average bitrate in bits/second.
  • codingMode - (Optional) Dolby Digital Plus with dolby Atmos coding mode.
  • dialnorm - (Optional) Sets the dialnorm for the output.
  • drcLine - (Optional) Sets the Dolby dynamic range compression profile.
  • drcRf - (Optional) Sets the profile for heavy Dolby dynamic range compression.
  • heightTrim - (Optional) Height dimensional trim.
  • surroundTrim - (Optional) Surround dimensional trim.

EAC3 Settings

  • attenuationControl - (Optional) Sets the attenuation control.
  • bitrate - (Optional) Average bitrate in bits/second.
  • bitstreamMode - (Optional) Specifies the bitstream mode (bsmod) for the emitted AC-3 stream.
  • codingMode - (Optional) Dolby Digital Plus coding mode.

Nielsen Watermark Settings

  • nielsenCbetSettings - (Optional) Used to insert watermarks of type Nielsen CBET. See Nielsen CBET Settings for more details.
  • nielsenDistributionType - (Optional) Distribution types to assign to the watermarks. Options are PROGRAM_CONTENT and FINAL_DISTRIBUTOR.
  • nielsenNaesIiNwSettings - (Optional) Used to insert watermarks of type Nielsen NAES, II (N2) and Nielsen NAES VI (NW). See Nielsen NAES II NW Settings for more details.

Nielsen CBET Settings

  • cbetCheckDigit - (Required) CBET check digits to use for the watermark.
  • cbetStepaside - (Required) Determines the method of CBET insertion mode when prior encoding is detected on the same layer.
  • csid - (Required) CBET source ID to use in the watermark.

Nielsen NAES II NW Settings

  • checkDigit - (Required) Check digit string for the watermark.
  • sid - (Required) The Nielsen Source ID to include in the watermark.

Output Groups

  • outputGroupSettings - (Required) Settings associated with the output group. See Output Group Settings for more details.
  • outputs - (Required) List of outputs. See Outputs for more details.
  • name - (Optional) Custom output group name defined by the user.

Output Group Settings

  • archiveGroupSettings - (Optional) Archive group settings. See Archive Group Settings for more details.
  • mediaPackageGroupSettings - (Optional) Media package group settings. See Media Package Group Settings for more details.
  • multiplexGroupSttings - (Optional) Multiplex group settings. Attribute can be passed as an empty block.
  • rtmpGroupSettings - (Optional) RTMP group settings. See RTMP Group Settings for more details.
  • udpGroupSttings - (Optional) UDP group settings. See UDP Group Settings for more details.

Outputs

  • outputSettings - (Required) Settings for output. See Output Settings for more details.
  • audioDescriptionNames - (Optional) The names of the audio descriptions used as audio sources for the output.
  • captionDescriptionNames - (Optional) The names of the caption descriptions used as caption sources for the output.
  • outputName - (Required) The name used to identify an output.
  • videoDescriptionName - (Optional) The name of the video description used as video source for the output.

Timecode Config

  • source - (Optional) The source for the timecode that will be associated with the events outputs.
  • syncThreshold - (Optional) Threshold in frames beyond which output timecode is resynchronized to the input timecode.

Video Descriptions

  • name - (Required) The name of the video description.
  • codecSettings - (Optional) The video codec settings. See Video Codec Settings for more details.
  • height - Output video height in pixels.
  • respondToAfd - (Optional) Indicate how to respond to the AFD values that might be in the input video.
  • scalingBehavior - (Optional) Behavior on how to scale.
  • sharpness - (Optional) Changes the strength of the anti-alias filter used for scaling.
  • width - (Optional) Output video width in pixels.

Video Codec Settings

  • frameCaptureSettings - (Optional) Frame capture settings. See Frame Capture Settings for more details.
  • h264Settings - (Optional) H264 settings. See H264 Settings for more details.

Frame Capture Settings

  • captureInterval - (Optional) The frequency at which to capture frames for inclusion in the output.
  • captureIntervalUnits - (Optional) Unit for the frame capture interval.

H264 Settings

  • adaptiveQuantization - (Optional) Enables or disables adaptive quantization.
  • afdSignaling - (Optional) Indicates that AFD values will be written into the output stream.
  • bitrate - (Optional) Average bitrate in bits/second.
  • bufFilPct - (Optional) Percentage of the buffer that should initially be filled.
  • bufSize - (Optional) Size of buffer in bits.
  • colorMetadata - (Optional) Includes color space metadata in the output.
  • entropyEncoding - (Optional) Entropy encoding mode.
  • filterSettings - (Optional) Filters to apply to an encode. See H264 Filter Settings for more details.
  • fixedAfd - (Optional) Four bit AFD value to write on all frames of video in the output stream.
  • flicerAq - (Optional) Makes adjustments within each frame to reduce flicker on the I-frames.
  • forceFieldPictures - (Optional) Controls whether coding is performed on a field basis or on a frame basis.
  • framerateControl - (Optional) Indicates how the output video frame rate is specified.
  • framerateDenominator - (Optional) Framerate denominator.
  • framerateNumerator - (Optional) Framerate numerator.
  • gopBReference - (Optional) GOP-B reference.
  • gopClosedCadence - (Optional) Frequency of closed GOPs.
  • gopNumBFrames - (Optional) Number of B-frames between reference frames.
  • gopSize - (Optional) GOP size in units of either frames of seconds per gopSizeUnits.
  • gopSizeUnits - (Optional) Indicates if the gopSize is specified in frames or seconds.
  • level - (Optional) H264 level.
  • lookAheadRateControl - (Optional) Amount of lookahead.
  • maxBitrate - (Optional) Set the maximum bitrate in order to accommodate expected spikes in the complexity of the video.
  • minInterval - (Optional) Min interval.
  • numRefFrames - (Optional) Number of reference frames to use.
  • parControl - (Optional) Indicates how the output pixel aspect ratio is specified.
  • parDenominator - (Optional) Pixel Aspect Ratio denominator.
  • parNumerator - (Optional) Pixel Aspect Ratio numerator.
  • profile - (Optional) H264 profile.
  • qualityLevel - (Optional) Quality level.
  • qvbrQualityLevel - (Optional) Controls the target quality for the video encode.
  • rateControlMode - (Optional) Rate control mode.
  • scanType - (Optional) Sets the scan type of the output.
  • sceneChangeDetect - (Optional) Scene change detection.
  • slices - (Optional) Number of slices per picture.
  • softness - (Optional) Softness.
  • spatialAq - (Optional) Makes adjustments within each frame based on spatial variation of content complexity.
  • subgopLength - (Optional) Subgop length.
  • syntax - (Optional) Produces a bitstream compliant with SMPTE RP-2027.
  • temporalAq - (Optional) Makes adjustments within each frame based on temporal variation of content complexity.
  • timecodeInsertion - (Optional) Determines how timecodes should be inserted into the video elementary stream.

H264 Filter Settings

Temporal Filter Settings

  • postFilterSharpening - (Optional) Post filter sharpening.
  • strength - (Optional) Filter strength.

Avail Blanking

  • availBlankingImage - (Optional) Blanking image to be used. See Avail Blanking Image for more details.
  • state - (Optional) When set to enabled, causes video, audio and captions to be blanked when insertion metadata is added.

Avail Blanking Image

  • uri - (Required) Path to a file accessible to the live stream.
  • passwordParam - (Optional) Key used to extract the password from EC2 Parameter store.
  • username - (Optional). Username to be used.

Archive Group Settings

  • destination - (Required) A director and base filename where archive files should be written. See Destination for more details.
  • archiveCdnSettings - (Optional) Parameters that control the interactions with the CDN. See Archive CDN Settings for more details.
  • rolloverInterval - (Optional) Number of seconds to write to archive file before closing and starting a new one.

Media Package Group Settings

  • destination - (Required) A director and base filename where archive files should be written. See Destination for more details.

RTMP Group Settings

  • adMarkers - (Optional) The ad marker type for this output group.
  • authenticationScheme - (Optional) Authentication scheme to use when connecting with CDN.
  • cacheFullBehavior - (Optional) Controls behavior when content cache fills up.
  • cacheLength - (Optional) Cache length in seconds, is used to calculate buffer size.
  • captionData - (Optional) Controls the types of data that passes to onCaptionInfo outputs.
  • inputLossAction - (Optional) Controls the behavior of the RTMP group if input becomes unavailable.
  • restartDelay - (Optional) Number of seconds to wait until a restart is initiated.

UDP Group Settings

  • inputLossAction - (Optional) Specifies behavior of last resort when input video os lost.
  • timedMetadataId3Frame - (Optional) Indicates ID3 frame that has the timecode.
  • timedMetadtaId3Period- (Optional) Timed metadata interval in seconds.

Destination

  • destinationRefId - (Required) Reference ID for the destination.

Archive CDN Settings

  • archiveS3Settings - (Optional) Archive S3 Settings. See Archive S3 Settings for more details.

Archive S3 Settings

  • cannedAcl - (Optional) Specify the canned ACL to apply to each S3 request.

Output Settings

  • archiveOutputSettings - (Optional) Archive output settings. See Archive Output Settings for more details.
  • mediaPackageOutputSettings - (Optional) Media package output settings. This can be set as an empty block.
  • multiplexOutputSettings - (Optional) Multiplex output settings. See Multiplex Output Settings for more details.
  • rtmpOutputSettings - (Optional) RTMP output settings. See RTMP Output Settings for more details.
  • udpOutputSettings - (Optional) UDP output settings. See UDP Output Settings for more details

Archive Output Settings

  • containerSettings - (Required) Settings specific to the container type of the file. See Container Settings for more details.
  • extension - (Optional) Output file extension.
  • nameModifier - (Optional) String concatenated to the end of the destination filename. Required for multiple outputs of the same type.

Multiplex Output Settings

  • destination - (Required) Destination is a multiplex. See Destination for more details.

RTMP Output Settings

  • destination - (Required) The RTMP endpoint excluding the stream name. See Destination for more details.
  • certificateMode - (Optional) Setting to allow self signed or verified RTMP certificates.
  • connectionRetryInterval - (Optional) Number of seconds to wait before retrying connection to the flash media server if the connection is lost.
  • numRetries - (Optional) Number of retry attempts.

Container Settings

  • m2TsSettings - (Optional) M2ts Settings. See M2ts Settings for more details.
  • rawSettings- (Optional) Raw Settings. This can be set as an empty block.

UDP Output Settings

  • containerSettings - (Required) UDP container settings. See Container Settings for more details.
  • destination - (Required) Destination address and port number for RTP or UDP packets. See Destination for more details.
  • bufferMsec - (Optional) UDP output buffering in milliseconds.
  • fecOutputSetting - (Optional) Settings for enabling and adjusting Forward Error Correction on UDP outputs. See FEC Output Settings for more details.

FEC Output Settings

  • columnDepth - (Optional) The height of the FEC protection matrix.
  • includeFec - (Optional) Enables column only or column and row based FEC.
  • rowLength - (Optional) The width of the FEC protection matrix.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - ARN of the Channel.
  • channelId - ID of the Channel.

Timeouts

Configuration options:

  • create - (Default 15M)
  • update - (Default 15M)
  • delete - (Default 15M)

Import

MediaLive Channel can be imported using the channelId, e.g.,

$ terraform import aws_medialive_channel.example 1234567