@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
598 lines • 20.5 kB
JavaScript
"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.JobTemplate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Transcoding Job Template Resource
*
* To get more information about JobTemplate, see:
*
* * [API documentation](https://cloud.google.com/transcoder/docs/reference/rest/v1/projects.locations.jobTemplates)
* * How-to Guides
* * [Transcoder](https://cloud.google.com/transcoder/docs/)
*
* ## Example Usage
*
* ### Transcoder Job Template Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.transcoder.JobTemplate("default", {
* jobTemplateId: "example-job-template",
* location: "us-central1",
* config: {
* inputs: [{
* key: "input0",
* }],
* editLists: [{
* key: "atom0",
* inputs: ["input0"],
* startTimeOffset: "0s",
* }],
* adBreaks: [{
* startTimeOffset: "3.500s",
* }],
* elementaryStreams: [
* {
* key: "video-stream0",
* videoStream: {
* h264: {
* widthPixels: 640,
* heightPixels: 360,
* bitrateBps: 550000,
* frameRate: 60,
* pixelFormat: "yuv420p",
* rateControlMode: "vbr",
* crfLevel: 21,
* gopDuration: "3s",
* vbvSizeBits: 550000,
* vbvFullnessBits: 495000,
* entropyCoder: "cabac",
* profile: "high",
* preset: "veryfast",
* },
* },
* },
* {
* key: "video-stream1",
* videoStream: {
* h264: {
* widthPixels: 1280,
* heightPixels: 720,
* bitrateBps: 550000,
* frameRate: 60,
* pixelFormat: "yuv420p",
* rateControlMode: "vbr",
* crfLevel: 21,
* gopDuration: "3s",
* vbvSizeBits: 2500000,
* vbvFullnessBits: 2250000,
* entropyCoder: "cabac",
* profile: "high",
* preset: "veryfast",
* },
* },
* },
* {
* key: "audio-stream0",
* audioStream: {
* codec: "aac",
* bitrateBps: 64000,
* channelCount: 2,
* channelLayouts: [
* "fl",
* "fr",
* ],
* sampleRateHertz: 48000,
* },
* },
* ],
* muxStreams: [
* {
* key: "sd",
* fileName: "sd.mp4",
* container: "mp4",
* elementaryStreams: [
* "video-stream0",
* "audio-stream0",
* ],
* },
* {
* key: "hd",
* fileName: "hd.mp4",
* container: "mp4",
* elementaryStreams: [
* "video-stream1",
* "audio-stream0",
* ],
* },
* ],
* },
* labels: {
* label: "key",
* },
* });
* ```
* ### Transcoder Job Template Overlays
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const _default = new gcp.transcoder.JobTemplate("default", {
* jobTemplateId: "example-job-template",
* location: "us-central1",
* config: {
* inputs: [{
* key: "input0",
* uri: "gs://example/example.mp4",
* }],
* output: {
* uri: "gs://example/outputs/",
* },
* editLists: [{
* key: "atom0",
* inputs: ["input0"],
* startTimeOffset: "0s",
* }],
* adBreaks: [{
* startTimeOffset: "3.500s",
* }],
* overlays: [{
* animations: [{
* animationFade: {
* fadeType: "FADE_IN",
* startTimeOffset: "1.500s",
* endTimeOffset: "3.500s",
* xy: {
* x: 1,
* y: 0.5,
* },
* },
* }],
* image: {
* uri: "gs://example/overlay.png",
* },
* }],
* elementaryStreams: [
* {
* key: "video-stream0",
* videoStream: {
* h264: {
* widthPixels: 640,
* heightPixels: 360,
* bitrateBps: 550000,
* frameRate: 60,
* pixelFormat: "yuv420p",
* rateControlMode: "vbr",
* crfLevel: 21,
* gopDuration: "3s",
* vbvSizeBits: 550000,
* vbvFullnessBits: 495000,
* entropyCoder: "cabac",
* profile: "high",
* preset: "veryfast",
* },
* },
* },
* {
* key: "video-stream1",
* videoStream: {
* h264: {
* widthPixels: 1280,
* heightPixels: 720,
* bitrateBps: 550000,
* frameRate: 60,
* pixelFormat: "yuv420p",
* rateControlMode: "vbr",
* crfLevel: 21,
* gopDuration: "3s",
* vbvSizeBits: 2500000,
* vbvFullnessBits: 2250000,
* entropyCoder: "cabac",
* profile: "high",
* preset: "veryfast",
* },
* },
* },
* {
* key: "audio-stream0",
* audioStream: {
* codec: "aac",
* bitrateBps: 64000,
* channelCount: 2,
* channelLayouts: [
* "fl",
* "fr",
* ],
* sampleRateHertz: 48000,
* },
* },
* ],
* muxStreams: [
* {
* key: "sd",
* fileName: "sd.mp4",
* container: "mp4",
* elementaryStreams: [
* "video-stream0",
* "audio-stream0",
* ],
* },
* {
* key: "hd",
* fileName: "hd.mp4",
* container: "mp4",
* elementaryStreams: [
* "video-stream1",
* "audio-stream0",
* ],
* },
* ],
* },
* labels: {
* label: "key",
* },
* });
* ```
* ### Transcoder Job Template Encryptions
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const encryptionKey = new gcp.secretmanager.Secret("encryption_key", {
* secretId: "transcoder-encryption-key",
* replication: {
* auto: {},
* },
* });
* const encryptionKeySecretVersion = new gcp.secretmanager.SecretVersion("encryption_key", {
* secret: encryptionKey.name,
* secretData: "4A67F2C1B8E93A4F6D3E7890A1BC23DF",
* });
* const _default = new gcp.transcoder.JobTemplate("default", {
* jobTemplateId: "example-job-template",
* location: "us-central1",
* config: {
* elementaryStreams: [
* {
* key: "es_video",
* videoStream: {
* h264: {
* profile: "main",
* heightPixels: 600,
* widthPixels: 800,
* bitrateBps: 1000000,
* frameRate: 60,
* },
* },
* },
* {
* key: "es_audio",
* audioStream: {
* codec: "aac",
* channelCount: 2,
* bitrateBps: 160000,
* },
* },
* ],
* encryptions: [
* {
* id: "aes-128",
* secretManagerKeySource: {
* secretVersion: encryptionKeySecretVersion.name,
* },
* drmSystems: {
* clearkey: {},
* },
* aes128: {},
* },
* {
* id: "cenc",
* secretManagerKeySource: {
* secretVersion: encryptionKeySecretVersion.name,
* },
* drmSystems: {
* widevine: {},
* },
* mpegCenc: {
* scheme: "cenc",
* },
* },
* {
* id: "cbcs",
* secretManagerKeySource: {
* secretVersion: encryptionKeySecretVersion.name,
* },
* drmSystems: {
* widevine: {},
* },
* mpegCenc: {
* scheme: "cbcs",
* },
* },
* ],
* muxStreams: [
* {
* key: "ts_aes128",
* container: "ts",
* elementaryStreams: [
* "es_video",
* "es_audio",
* ],
* segmentSettings: {
* segmentDuration: "6s",
* },
* encryptionId: "aes-128",
* },
* {
* key: "fmp4_cenc_video",
* container: "fmp4",
* elementaryStreams: ["es_video"],
* segmentSettings: {
* segmentDuration: "6s",
* },
* encryptionId: "cenc",
* },
* {
* key: "fmp4_cenc_audio",
* container: "fmp4",
* elementaryStreams: ["es_audio"],
* segmentSettings: {
* segmentDuration: "6s",
* },
* encryptionId: "cenc",
* },
* {
* key: "fmp4_cbcs_video",
* container: "fmp4",
* elementaryStreams: ["es_video"],
* segmentSettings: {
* segmentDuration: "6s",
* },
* encryptionId: "cbcs",
* },
* {
* key: "fmp4_cbcs_audio",
* container: "fmp4",
* elementaryStreams: ["es_audio"],
* segmentSettings: {
* segmentDuration: "6s",
* },
* encryptionId: "cbcs",
* },
* ],
* manifests: [
* {
* fileName: "manifest_aes128.m3u8",
* type: "HLS",
* muxStreams: ["ts_aes128"],
* },
* {
* fileName: "manifest_cenc.mpd",
* type: "DASH",
* muxStreams: [
* "fmp4_cenc_video",
* "fmp4_cenc_audio",
* ],
* },
* {
* fileName: "manifest_cbcs.mpd",
* type: "DASH",
* muxStreams: [
* "fmp4_cbcs_video",
* "fmp4_cbcs_audio",
* ],
* },
* ],
* },
* labels: {
* label: "key",
* },
* });
* ```
* ### Transcoder Job Template Pubsub
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const transcoderNotifications = new gcp.pubsub.Topic("transcoder_notifications", {name: "transcoder-notifications"});
* const _default = new gcp.transcoder.JobTemplate("default", {
* jobTemplateId: "example-job-template",
* location: "us-central1",
* config: {
* inputs: [{
* key: "input0",
* uri: "gs://example/example.mp4",
* }],
* output: {
* uri: "gs://example/outputs/",
* },
* editLists: [{
* key: "atom0",
* inputs: ["input0"],
* startTimeOffset: "0s",
* }],
* adBreaks: [{
* startTimeOffset: "3.500s",
* }],
* elementaryStreams: [
* {
* key: "video-stream0",
* videoStream: {
* h264: {
* widthPixels: 640,
* heightPixels: 360,
* bitrateBps: 550000,
* frameRate: 60,
* pixelFormat: "yuv420p",
* rateControlMode: "vbr",
* crfLevel: 21,
* gopDuration: "3s",
* vbvSizeBits: 550000,
* vbvFullnessBits: 495000,
* entropyCoder: "cabac",
* profile: "high",
* preset: "veryfast",
* },
* },
* },
* {
* key: "video-stream1",
* videoStream: {
* h264: {
* widthPixels: 1280,
* heightPixels: 720,
* bitrateBps: 550000,
* frameRate: 60,
* pixelFormat: "yuv420p",
* rateControlMode: "vbr",
* crfLevel: 21,
* gopDuration: "3s",
* vbvSizeBits: 2500000,
* vbvFullnessBits: 2250000,
* entropyCoder: "cabac",
* profile: "high",
* preset: "veryfast",
* },
* },
* },
* {
* key: "audio-stream0",
* audioStream: {
* codec: "aac",
* bitrateBps: 64000,
* channelCount: 2,
* channelLayouts: [
* "fl",
* "fr",
* ],
* sampleRateHertz: 48000,
* },
* },
* ],
* muxStreams: [
* {
* key: "sd",
* fileName: "sd.mp4",
* container: "mp4",
* elementaryStreams: [
* "video-stream0",
* "audio-stream0",
* ],
* },
* {
* key: "hd",
* fileName: "hd.mp4",
* container: "mp4",
* elementaryStreams: [
* "video-stream1",
* "audio-stream0",
* ],
* },
* ],
* pubsubDestination: {
* topic: transcoderNotifications.id,
* },
* },
* labels: {
* label: "key",
* },
* });
* ```
*
* ## Import
*
* JobTemplate can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/jobTemplates/{{job_template_id}}`
*
* * `{{project}}/{{location}}/{{job_template_id}}`
*
* * `{{location}}/{{job_template_id}}`
*
* When using the `pulumi import` command, JobTemplate can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:transcoder/jobTemplate:JobTemplate default projects/{{project}}/locations/{{location}}/jobTemplates/{{job_template_id}}
* ```
*
* ```sh
* $ pulumi import gcp:transcoder/jobTemplate:JobTemplate default {{project}}/{{location}}/{{job_template_id}}
* ```
*
* ```sh
* $ pulumi import gcp:transcoder/jobTemplate:JobTemplate default {{location}}/{{job_template_id}}
* ```
*/
class JobTemplate extends pulumi.CustomResource {
/**
* Get an existing JobTemplate resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new JobTemplate(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of JobTemplate. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === JobTemplate.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["config"] = state?.config;
resourceInputs["effectiveLabels"] = state?.effectiveLabels;
resourceInputs["jobTemplateId"] = state?.jobTemplateId;
resourceInputs["labels"] = state?.labels;
resourceInputs["location"] = state?.location;
resourceInputs["name"] = state?.name;
resourceInputs["project"] = state?.project;
resourceInputs["pulumiLabels"] = state?.pulumiLabels;
}
else {
const args = argsOrState;
if (args?.jobTemplateId === undefined && !opts.urn) {
throw new Error("Missing required property 'jobTemplateId'");
}
if (args?.location === undefined && !opts.urn) {
throw new Error("Missing required property 'location'");
}
resourceInputs["config"] = args?.config;
resourceInputs["jobTemplateId"] = args?.jobTemplateId;
resourceInputs["labels"] = args?.labels;
resourceInputs["location"] = args?.location;
resourceInputs["project"] = args?.project;
resourceInputs["effectiveLabels"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["pulumiLabels"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(JobTemplate.__pulumiType, name, resourceInputs, opts);
}
}
exports.JobTemplate = JobTemplate;
/** @internal */
JobTemplate.__pulumiType = 'gcp:transcoder/jobTemplate:JobTemplate';
//# sourceMappingURL=jobTemplate.js.map