🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

awscdk-construct-input-switch-scheduler

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

awscdk-construct-input-switch-scheduler

AWS CDK Construct for scheduling input switch of MediaLive

0.0.4
latest
Source
npm
Version published
Weekly downloads
121
19.8%
Maintainers
0
Weekly downloads
 
Created
Source

awscdk-construct-input-switch-scheduler

View on Construct Hub

CDK Construct for scheduling input switch of MediaLive

  • Input:
    • MediaLive channel id
    • List of input attachements to be switched in a toggle manner
    • Switch interval (minutes)
  • Output:
    • Lambda function for calling MediaLive schedule API
    • EventBridge rule for periodically invoking the function

Install

NPM

Usage

import { Stack, StackProps, CfnOutput } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { LiveChannelFromMp4 } from 'awscdk-construct-live-channel-from-mp4-file';
import { InputSwitchScheduler } from 'awscdk-construct-input-switch-scheduler';

export class ExampleStack extends Stack {
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    // Create a live channel (MediaLive + MediaPackage)
    const {eml, empv1: emp} = new LiveChannelFromMp4(this, 'LiveChannelFromMp4', {
      sourceUrl: [
        's3ssl://example_bucket/test-1.mp4',
        's3ssl://example_bucket/test-2.mp4',
      ],
      autoStart: true,
    });

    // Perform input switch every 15 minutes
    new InputSwitchScheduler(this, 'InputSwitchScheduler', {
      channelId: eml.channel.ref,
      inputAttachments: eml.channel.inputAttachments?.map(({inputAttachmentName}) => inputAttachmentName),
      intervalInMinutes: 15,
    });

    // Print MediaPackage endpoint URL (HLS)
    new CfnOutput(this, "MediaPackageEndpointURL", {
      value: emp.endpoints.hls.attrUrl,
      exportName: "MediaPackageEndpointURL",
      description: "MediaPackage endpoint URL",
    });
  }
}

Keywords

EventBridge

FAQs

Package last updated on 01 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts