UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

681 lines (680 loc) • 23 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * 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}} * ``` */ export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: JobTemplateState, opts?: pulumi.CustomResourceOptions): JobTemplate; /** * 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: any): obj is JobTemplate; /** * The configuration for this template. * Structure is documented below. */ readonly config: pulumi.Output<outputs.transcoder.JobTemplateConfig>; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ readonly effectiveLabels: pulumi.Output<{ [key: string]: string; }>; /** * ID to use for the Transcoding job template. */ readonly jobTemplateId: pulumi.Output<string>; /** * The labels associated with this job template. You can use these to organize and group your job templates. * * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ readonly labels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The location of the transcoding job template resource. */ readonly location: pulumi.Output<string>; /** * The resource name of the job template. */ readonly name: pulumi.Output<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ readonly pulumiLabels: pulumi.Output<{ [key: string]: string; }>; /** * Create a JobTemplate resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: JobTemplateArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering JobTemplate resources. */ export interface JobTemplateState { /** * The configuration for this template. * Structure is documented below. */ config?: pulumi.Input<inputs.transcoder.JobTemplateConfig>; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ effectiveLabels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * ID to use for the Transcoding job template. */ jobTemplateId?: pulumi.Input<string>; /** * The labels associated with this job template. You can use these to organize and group your job templates. * * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The location of the transcoding job template resource. */ location?: pulumi.Input<string>; /** * The resource name of the job template. */ name?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ pulumiLabels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; } /** * The set of arguments for constructing a JobTemplate resource. */ export interface JobTemplateArgs { /** * The configuration for this template. * Structure is documented below. */ config?: pulumi.Input<inputs.transcoder.JobTemplateConfig>; /** * ID to use for the Transcoding job template. */ jobTemplateId: pulumi.Input<string>; /** * The labels associated with this job template. You can use these to organize and group your job templates. * * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The location of the transcoding job template resource. */ location: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; }