Huge News!Announcing our $40M Series B led by Abstract Ventures.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.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
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

FAQs

Package last updated on 09 Jul 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc