UNPKG

@pulumi/gcp

Version:

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

431 lines • 21.1 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * An online schedule that triggers running pipeline jobs or notebook execution jobs. * * ## Example Usage * * ### Vertex Ai Schedule * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const bucket = new gcp.storage.Bucket("bucket", { * name: "pipeline-job", * location: "us-central1", * uniformBucketLevelAccess: true, * forceDestroy: true, * }); * const schedule = new gcp.vertex.AiSchedule("schedule", { * displayName: "test-schedule", * location: "us-central1", * maxConcurrentRunCount: "2", * cron: "*&#47;5 * * * *", * allowQueueing: true, * maxConcurrentActiveRunCount: "2", * maxRunCount: "10", * startTime: "2030-01-01T00:00:00Z", * endTime: "2030-01-02T00:00:00Z", * createPipelineJobRequest: { * parent: project.then(project => `projects/${project.projectId}/locations/us-central1`), * pipelineJob: { * displayName: "test-pipeline-job", * preflightValidations: true, * labels: { * key: "value-one", * }, * pipelineSpec: JSON.stringify({ * pipelineInfo: { * name: "hello-world", * }, * root: { * dag: { * tasks: {}, * }, * }, * schemaVersion: "2.1.0", * sdkVersion: "kfp-2.0.0", * }), * runtimeConfig: { * gcsOutputDirectory: pulumi.interpolate`gs://${bucket.name}/pipeline_root`, * failurePolicy: "PIPELINE_FAILURE_POLICY_FAIL_FAST", * }, * }, * }, * }); * ``` * ### Vertex Ai Schedule Notebook * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const bucket = new gcp.storage.Bucket("bucket", { * name: "notebook-job", * location: "us-central1", * uniformBucketLevelAccess: true, * forceDestroy: true, * }); * const notebook = new gcp.storage.BucketObject("notebook", { * name: "notebook.ipynb", * content: "{ \"cells\": [], \"metadata\": {}, \"nbformat\": 4, \"nbminor\": 0 }", * bucket: bucket.name, * }); * const schedule = new gcp.vertex.AiSchedule("schedule", { * displayName: "test-schedule-notebook", * location: "us-central1", * maxConcurrentRunCount: "2", * cron: "*&#47;5 * * * *", * startTime: "2030-01-01T00:00:00Z", * createNotebookExecutionJobRequest: { * parent: project.then(project => `projects/${project.projectId}/locations/us-central1`), * notebookExecutionJob: { * displayName: "test-notebook-execution-job", * gcsOutputUri: pulumi.interpolate`gs://${bucket.name}`, * serviceAccount: project.then(project => `${project.number}-compute@developer.gserviceaccount.com`), * gcsNotebookSource: { * uri: pulumi.interpolate`gs://${bucket.name}/${notebook.name}`, * generation: notebook.generation.apply(x =>String(x)), * }, * customEnvironmentSpec: { * machineSpec: { * machineType: "n1-standard-4", * acceleratorType: "NVIDIA_TESLA_T4", * acceleratorCount: 1, * }, * persistentDiskSpec: { * diskSizeGb: "100", * diskType: "pd-standard", * }, * networkSpec: { * enableInternetAccess: true, * }, * }, * executionTimeout: "86400s", * kernelName: "python3", * labels: { * test: "value", * }, * }, * }, * }); * ``` * * ## Import * * Schedule can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/schedules/{{name}}` * * `{{project}}/{{location}}/{{name}}` * * `{{location}}/{{name}}` * * When using the `pulumi import` command, Schedule can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:vertex/aiSchedule:AiSchedule default projects/{{project}}/locations/{{location}}/schedules/{{name}} * $ pulumi import gcp:vertex/aiSchedule:AiSchedule default {{project}}/{{location}}/{{name}} * $ pulumi import gcp:vertex/aiSchedule:AiSchedule default {{location}}/{{name}} * ``` */ export declare class AiSchedule extends pulumi.CustomResource { /** * Get an existing AiSchedule 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?: AiScheduleState, opts?: pulumi.CustomResourceOptions): AiSchedule; /** * Returns true if the given object is an instance of AiSchedule. 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 AiSchedule; /** * Whether new scheduled runs can be queued when maxConcurrentRuns limit is reached. If set to true, new runs will be queued instead of skipped. Default to false. */ readonly allowQueueing: pulumi.Output<boolean | undefined>; /** * Whether to backfill missed runs when the schedule is resumed from PAUSED state. If set to true, all missed runs will be scheduled. New runs will be scheduled after the backfill is complete. Default to false. */ readonly catchUp: pulumi.Output<boolean>; /** * Request message for [NotebookService.CreateNotebookExecutionJob] * Structure is documented below. */ readonly createNotebookExecutionJobRequest: pulumi.Output<outputs.vertex.AiScheduleCreateNotebookExecutionJobRequest | undefined>; /** * Request message for PipelineService.CreatePipelineJob. * Structure is documented below. */ readonly createPipelineJobRequest: pulumi.Output<outputs.vertex.AiScheduleCreatePipelineJobRequest | undefined>; /** * Timestamp when this Schedule was created. */ readonly createTime: pulumi.Output<string>; /** * Cron schedule (https://en.wikipedia.org/wiki/Cron) to launch scheduled runs. To explicitly set a timezone to the cron tab, apply a prefix in the cron tab: "CRON_TZ=${IANA_TIME_ZONE}" or "TZ=${IANA_TIME_ZONE}". The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone database. For example, "CRON_TZ=America/New_York 1 * * * *", or "TZ=America/New_York 1 * * * *". */ readonly cron: pulumi.Output<string | undefined>; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ readonly deletionPolicy: pulumi.Output<string>; /** * User provided name of the Schedule. The name can be up to 128 characters long and can consist of any UTF-8 characters. */ readonly displayName: pulumi.Output<string>; /** * Timestamp after which no new runs can be scheduled. If specified, The schedule will be completed when either endTime is reached or when scheduledRunCount >= max_run_count. If not specified, new runs will keep getting scheduled until this Schedule is paused or deleted. Already scheduled runs will be allowed to complete. Unset if not specified. */ readonly endTime: pulumi.Output<string | undefined>; /** * Timestamp when this Schedule was last paused. Unset if never paused. */ readonly lastPauseTime: pulumi.Output<string>; /** * Timestamp when this Schedule was last resumed. Unset if never resumed from pause. */ readonly lastResumeTime: pulumi.Output<string>; /** * Status of a scheduled run. * Structure is documented below. */ readonly lastScheduledRunResponses: pulumi.Output<outputs.vertex.AiScheduleLastScheduledRunResponse[]>; /** * The location of the Schedule. eg us-central1 */ readonly location: pulumi.Output<string>; /** * Specifies the maximum number of active runs that can be executed concurrently for this Schedule. This limits the number of runs that can be in a non-terminal state at the same time. Currently, this field is only supported for requests of type CreatePipelineJobRequest. */ readonly maxConcurrentActiveRunCount: pulumi.Output<string | undefined>; /** * Maximum number of runs that can be started concurrently for this Schedule. This is the limit for starting the scheduled requests and not the execution of the operations/jobs created by the requests (if applicable). */ readonly maxConcurrentRunCount: pulumi.Output<string>; /** * Maximum run count of the schedule. If specified, The schedule will be completed when either startedRunCount >= maxRunCount or when endTime is reached. If not specified, new runs will keep getting scheduled until this Schedule is paused or deleted. Already scheduled runs will be allowed to complete. Unset if not specified. */ readonly maxRunCount: pulumi.Output<string | undefined>; /** * The resource name of the Schedule. */ readonly name: pulumi.Output<string>; /** * Timestamp when this Schedule should schedule the next run. Having a nextRunTime in the past means the runs are being started behind schedule. */ readonly nextRunTime: 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>; /** * Timestamp after which the first run can be scheduled. Default to Schedule create time if not specified. */ readonly startTime: pulumi.Output<string>; /** * The number of runs started by this schedule. */ readonly startedRunCount: pulumi.Output<string>; /** * The state of this Schedule. Possible values: ACTIVE PAUSED COMPLETED */ readonly state: pulumi.Output<string>; /** * Timestamp when this Schedule was updated. */ readonly updateTime: pulumi.Output<string>; /** * Create a AiSchedule 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: AiScheduleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering AiSchedule resources. */ export interface AiScheduleState { /** * Whether new scheduled runs can be queued when maxConcurrentRuns limit is reached. If set to true, new runs will be queued instead of skipped. Default to false. */ allowQueueing?: pulumi.Input<boolean | undefined>; /** * Whether to backfill missed runs when the schedule is resumed from PAUSED state. If set to true, all missed runs will be scheduled. New runs will be scheduled after the backfill is complete. Default to false. */ catchUp?: pulumi.Input<boolean | undefined>; /** * Request message for [NotebookService.CreateNotebookExecutionJob] * Structure is documented below. */ createNotebookExecutionJobRequest?: pulumi.Input<inputs.vertex.AiScheduleCreateNotebookExecutionJobRequest | undefined>; /** * Request message for PipelineService.CreatePipelineJob. * Structure is documented below. */ createPipelineJobRequest?: pulumi.Input<inputs.vertex.AiScheduleCreatePipelineJobRequest | undefined>; /** * Timestamp when this Schedule was created. */ createTime?: pulumi.Input<string | undefined>; /** * Cron schedule (https://en.wikipedia.org/wiki/Cron) to launch scheduled runs. To explicitly set a timezone to the cron tab, apply a prefix in the cron tab: "CRON_TZ=${IANA_TIME_ZONE}" or "TZ=${IANA_TIME_ZONE}". The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone database. For example, "CRON_TZ=America/New_York 1 * * * *", or "TZ=America/New_York 1 * * * *". */ cron?: pulumi.Input<string | undefined>; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ deletionPolicy?: pulumi.Input<string | undefined>; /** * User provided name of the Schedule. The name can be up to 128 characters long and can consist of any UTF-8 characters. */ displayName?: pulumi.Input<string | undefined>; /** * Timestamp after which no new runs can be scheduled. If specified, The schedule will be completed when either endTime is reached or when scheduledRunCount >= max_run_count. If not specified, new runs will keep getting scheduled until this Schedule is paused or deleted. Already scheduled runs will be allowed to complete. Unset if not specified. */ endTime?: pulumi.Input<string | undefined>; /** * Timestamp when this Schedule was last paused. Unset if never paused. */ lastPauseTime?: pulumi.Input<string | undefined>; /** * Timestamp when this Schedule was last resumed. Unset if never resumed from pause. */ lastResumeTime?: pulumi.Input<string | undefined>; /** * Status of a scheduled run. * Structure is documented below. */ lastScheduledRunResponses?: pulumi.Input<pulumi.Input<inputs.vertex.AiScheduleLastScheduledRunResponse>[] | undefined>; /** * The location of the Schedule. eg us-central1 */ location?: pulumi.Input<string | undefined>; /** * Specifies the maximum number of active runs that can be executed concurrently for this Schedule. This limits the number of runs that can be in a non-terminal state at the same time. Currently, this field is only supported for requests of type CreatePipelineJobRequest. */ maxConcurrentActiveRunCount?: pulumi.Input<string | undefined>; /** * Maximum number of runs that can be started concurrently for this Schedule. This is the limit for starting the scheduled requests and not the execution of the operations/jobs created by the requests (if applicable). */ maxConcurrentRunCount?: pulumi.Input<string | undefined>; /** * Maximum run count of the schedule. If specified, The schedule will be completed when either startedRunCount >= maxRunCount or when endTime is reached. If not specified, new runs will keep getting scheduled until this Schedule is paused or deleted. Already scheduled runs will be allowed to complete. Unset if not specified. */ maxRunCount?: pulumi.Input<string | undefined>; /** * The resource name of the Schedule. */ name?: pulumi.Input<string | undefined>; /** * Timestamp when this Schedule should schedule the next run. Having a nextRunTime in the past means the runs are being started behind schedule. */ nextRunTime?: pulumi.Input<string | undefined>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string | undefined>; /** * Timestamp after which the first run can be scheduled. Default to Schedule create time if not specified. */ startTime?: pulumi.Input<string | undefined>; /** * The number of runs started by this schedule. */ startedRunCount?: pulumi.Input<string | undefined>; /** * The state of this Schedule. Possible values: ACTIVE PAUSED COMPLETED */ state?: pulumi.Input<string | undefined>; /** * Timestamp when this Schedule was updated. */ updateTime?: pulumi.Input<string | undefined>; } /** * The set of arguments for constructing a AiSchedule resource. */ export interface AiScheduleArgs { /** * Whether new scheduled runs can be queued when maxConcurrentRuns limit is reached. If set to true, new runs will be queued instead of skipped. Default to false. */ allowQueueing?: pulumi.Input<boolean | undefined>; /** * Request message for [NotebookService.CreateNotebookExecutionJob] * Structure is documented below. */ createNotebookExecutionJobRequest?: pulumi.Input<inputs.vertex.AiScheduleCreateNotebookExecutionJobRequest | undefined>; /** * Request message for PipelineService.CreatePipelineJob. * Structure is documented below. */ createPipelineJobRequest?: pulumi.Input<inputs.vertex.AiScheduleCreatePipelineJobRequest | undefined>; /** * Cron schedule (https://en.wikipedia.org/wiki/Cron) to launch scheduled runs. To explicitly set a timezone to the cron tab, apply a prefix in the cron tab: "CRON_TZ=${IANA_TIME_ZONE}" or "TZ=${IANA_TIME_ZONE}". The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone database. For example, "CRON_TZ=America/New_York 1 * * * *", or "TZ=America/New_York 1 * * * *". */ cron?: pulumi.Input<string | undefined>; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ deletionPolicy?: pulumi.Input<string | undefined>; /** * User provided name of the Schedule. The name can be up to 128 characters long and can consist of any UTF-8 characters. */ displayName: pulumi.Input<string>; /** * Timestamp after which no new runs can be scheduled. If specified, The schedule will be completed when either endTime is reached or when scheduledRunCount >= max_run_count. If not specified, new runs will keep getting scheduled until this Schedule is paused or deleted. Already scheduled runs will be allowed to complete. Unset if not specified. */ endTime?: pulumi.Input<string | undefined>; /** * The location of the Schedule. eg us-central1 */ location: pulumi.Input<string>; /** * Specifies the maximum number of active runs that can be executed concurrently for this Schedule. This limits the number of runs that can be in a non-terminal state at the same time. Currently, this field is only supported for requests of type CreatePipelineJobRequest. */ maxConcurrentActiveRunCount?: pulumi.Input<string | undefined>; /** * Maximum number of runs that can be started concurrently for this Schedule. This is the limit for starting the scheduled requests and not the execution of the operations/jobs created by the requests (if applicable). */ maxConcurrentRunCount: pulumi.Input<string>; /** * Maximum run count of the schedule. If specified, The schedule will be completed when either startedRunCount >= maxRunCount or when endTime is reached. If not specified, new runs will keep getting scheduled until this Schedule is paused or deleted. Already scheduled runs will be allowed to complete. Unset if not specified. */ maxRunCount?: pulumi.Input<string | undefined>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string | undefined>; /** * Timestamp after which the first run can be scheduled. Default to Schedule create time if not specified. */ startTime?: pulumi.Input<string | undefined>; } //# sourceMappingURL=aiSchedule.d.ts.map